|
1 | 1 | # Parser |
2 | 2 |
|
3 | | -The _Parser Filter_ plugin allows for parsing fields in event records. |
| 3 | +The _Parser_ filter allows for parsing fields in event records. |
4 | 4 |
|
5 | | -## Configuration Parameters |
| 5 | +## Configuration parameters |
6 | 6 |
|
7 | 7 | The plugin supports the following configuration parameters: |
8 | 8 |
|
9 | 9 | | Key | Description | Default | |
10 | 10 | | :--- | :--- | :--- | |
11 | | -| Key\_Name | Specify field name in record to parse. | | |
12 | | -| Parser | Specify the parser name to interpret the field. Multiple _Parser_ entries are allowed \(one per line\). | | |
13 | | -| Preserve\_Key | Keep original `Key_Name` field in the parsed result. If false, the field will be removed. | False | |
14 | | -| Reserve\_Data | Keep all other original fields in the parsed result. If false, all other original fields will be removed. | False | |
| 11 | +| `Key_Name` | Specify field name in record to parse. | _none_ | |
| 12 | +| `Parser` | Specify the parser name to interpret the field. Multiple parser entries are allowed (one per line). | _none_ | |
| 13 | +| `Preserve_Key` | Keep the original `Key_Name` field in the parsed result. If false, the field will be removed. | `False` | |
| 14 | +| `Reserve_Data` | Keep all other original fields in the parsed result. If false, all other original fields will be removed. | `False` | |
15 | 15 |
|
16 | | -## Getting Started |
| 16 | +## Get started |
17 | 17 |
|
18 | | -### Configuration File |
19 | | - |
20 | | -This is an example of parsing a record `{"data":"100 0.5 true This is example"}`. |
| 18 | +### Configuration file |
21 | 19 |
|
22 | 20 | The plugin needs a parser file which defines how to parse each field. |
23 | 21 |
|
| 22 | +This is an example of parsing a record `{"data":"100 0.5 true This is example"}`. |
| 23 | + |
24 | 24 | ```python |
25 | 25 | [PARSER] |
26 | 26 | Name dummy_test |
27 | 27 | Format regex |
28 | 28 | Regex ^(?<INT>[^ ]+) (?<FLOAT>[^ ]+) (?<BOOL>[^ ]+) (?<STRING>.+)$ |
29 | 29 | ``` |
30 | 30 |
|
31 | | -The path of the parser file should be written in configuration file under the **\[SERVICE\]** section. |
| 31 | +The path of the parser file should be written in configuration file under the `[SERVICE]` section. |
32 | 32 |
|
33 | 33 | ```python |
34 | 34 | [SERVICE] |
@@ -113,7 +113,7 @@ Copyright (C) Treasure Data |
113 | 113 | [3] dummy.data: [1499347996.001320284, {"INT"=>"100", "FLOAT"=>"0.5", "BOOL"=>"true", "STRING"=>"This is example"}, "key1":"value1", "key2":"value2"] |
114 | 114 | ``` |
115 | 115 |
|
116 | | -If you enable `Reserved_Data` and `Preserve_Key`, the original key field will be preserved as well: |
| 116 | +If you enable `Reserved_Data` and `Preserve_Key`, the original key field will also be preserved: |
117 | 117 |
|
118 | 118 | ```python |
119 | 119 | [PARSER] |
|
0 commit comments