@@ -12,6 +12,8 @@ The plugin supports the following configuration parameters:
12
12
| Parser | Specify the parser name to interpret the field. Multiple _ Parser_ entries are allowed \( one per line\) . | |
13
13
| Preserve\_ Key | Keep original ` Key_Name ` field in the parsed result. If false, the field will be removed. | False |
14
14
| Reserve\_ Data | Keep all other original fields in the parsed result. If false, all other original fields will be removed. | False |
15
+ | Reserve\_ Data | Keep all other original fields in the parsed result. If false, all other original fields will be removed. | False |
16
+ | Nest\_ Under | Specify field name to nest parsed records under. | |
15
17
16
18
## Getting Started
17
19
@@ -156,3 +158,42 @@ Fluent Bit v2.1.1
156
158
[0] dummy.data: [[1687122779.296906553, {}], {"INT"=>"100", "FLOAT"=>"0.5", "BOOL"=>"true", "STRING"=>"This is example", "data"=>"100 0.5 true This is example", "key1"=>"value1", "key2"=>"value2"}]
157
159
[0] dummy.data: [[1687122780.297475803, {}], {"INT"=>"100", "FLOAT"=>"0.5", "BOOL"=>"true", "STRING"=>"This is example", "data"=>"100 0.5 true This is example", "key1"=>"value1", "key2"=>"value2"}]
158
160
```
161
+
162
+ ### Nest parsed fields
163
+
164
+ Instead of expanding parsed fields at the root of the object,
165
+ you may choose to have them nested under a new field defined by ` Nest_Under ` :
166
+
167
+ ``` python copy
168
+ [SERVICE ]
169
+ Parsers_File / fluent- bit/ etc/ parsers.conf
170
+
171
+ [INPUT ]
172
+ Name Dummy
173
+ Dummy {" log" :" error: my error" ," element" :" {\" a\" :\" b\" ,\" c\" :{\" x\" :\" y\" }}" }
174
+ Tag dummy.data
175
+
176
+ [FILTER ]
177
+ Name parser
178
+ Match dummy.*
179
+ Parser json
180
+ Key_Name element
181
+ Nest_Under parsed
182
+
183
+ [OUTPUT ]
184
+ Name stdout
185
+ Match *
186
+ ```
187
+
188
+ Resulting in the following output:
189
+
190
+ ``` text
191
+ $ fluent-bit -c dummy.conf
192
+ Fluent Bit v2.1.1
193
+ * Copyright (C) 2015-2022 The Fluent Bit Authors
194
+ ...
195
+ ...
196
+ [0] dummy.data: [[1736759501.208000317, {}], {"parsed"=>{"a"=>"b", "c"=>{"x"=>"y"}}}]
197
+ [0] dummy.data: [[1736759502.207935361, {}], {"parsed"=>{"a"=>"b", "c"=>{"x"=>"y"}}}]
198
+ [0] dummy.data: [[1736759503.207765898, {}], {"parsed"=>{"a"=>"b", "c"=>{"x"=>"y"}}}]
199
+ ```
0 commit comments