|
| 1 | +[](https://github.com/ztroop/py3grok/actions/workflows/build.yml) |
| 2 | +[](https://codecov.io/gh/ztroop/py3grok) |
| 3 | + |
1 | 4 | # py3grok
|
2 | 5 |
|
3 | 6 | A Python library to parse strings and extract information from structured or unstructured data. This library is based on [pygrok](https://github.com/garyelephant/pygrok).
|
@@ -42,23 +45,14 @@ print(grok.match(text))
|
42 | 45 |
|
43 | 46 | Now `age` is of type `int` and `weight` is of type `float`.
|
44 | 47 |
|
45 |
| -Some of the pattern you can use are listed here: |
46 |
| -``` |
47 |
| -`WORD` means \b\w+\b in regular expression. |
48 |
| -`NUMBER` means (?:%{BASE10NUM}) |
49 |
| -`BASE10NUM` means (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+))) |
50 |
| -
|
51 |
| -other patterns such as `IP`, `HOSTNAME`, `URIPATH`, `DATE`, `TIMESTAMP_ISO8601`, `COMMONAPACHELOG`.. |
52 |
| -``` |
53 |
| - |
54 | 48 | See all available patterns [here](./py3grok/patterns)!
|
55 | 49 |
|
56 | 50 | ## Additional Notes
|
57 | 51 |
|
58 |
| -Beause python re module does not support regular expression syntax atomic grouping(?>),so pygrok requires [regex](https://pypi.python.org/pypi/regex) to be installed. |
| 52 | +The python `re` module does not support regular expression syntax atomic grouping `(?>)`, so pygrok requires [regex](https://pypi.python.org/pypi/regex) to be installed. |
59 | 53 |
|
60 | 54 | Grok is a simple software that allows you to easily parse strings, logs and other files. With grok, you can turn unstructured log and event data into structured data.
|
61 | 55 |
|
62 |
| -I recommend you to have a look at [logstash filter grok](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html), it explains how Grok-like thing work. |
| 56 | +I recommend you to have a look at [logstash filter grok](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html), it explains how Grok works. |
63 | 57 |
|
64 |
| -pattern files come from [logstash filter grok's pattern files](https://github.com/logstash-plugins/logstash-patterns-core/tree/master/patterns) |
| 58 | +Pattern files come from [logstash filter grok's pattern files](https://github.com/logstash-plugins/logstash-patterns-core/tree/master/patterns) |
0 commit comments