File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,34 @@ The _JSON_ parser transforms JSON logs by converting them to internal binary rep
44
55For example, the default parsers configuration file includes a parser for parsing Docker logs (when the Tail input plugin is used):
66
7- ``` python
7+ {% tabs %}
8+ {% tab title="parsers.yaml" %}
9+
10+ ``` yaml
11+ parsers :
12+ - name : docker
13+ format : json
14+ time_key : time
15+ time_format : ' %Y-%m-%dT%H:%M:%S %z'
16+ ` ` `
17+
18+ {% endtab %}
19+ {% tab title="parsers.conf" %}
20+
21+ ` ` ` text
822[PARSER]
923 Name docker
1024 Format json
1125 Time_Key time
1226 Time_Format %Y-%m-%dT%H:%M:%S %z
1327```
1428
29+ {% endtab %}
30+ {% endtabs %}
31+
1532The following log entry is valid content for the previously defined parser:
1633
17- ``` javascript
34+ ``` text
1835{"key1": 12345, "key2": "abc", "time": "2006-07-28T13:22:04Z"}
1936```
2037
@@ -24,4 +41,4 @@ After processing, its internal representation will be:
2441[1154103724, {"key1"=>12345, "key2"=>"abc"}]
2542```
2643
27- The time was converted to a UTC timestamp and the map was reduced to each component of the original message.
44+ The time was converted to a UTC timestamp and the map was reduced to each component of the original message.
You can’t perform that action at this time.
0 commit comments