Skip to content

Commit 2e9af2f

Browse files
committed
Pipeline: filters: nest: style updates
Signed-off-by: Lynette Miles <[email protected]>
1 parent c349252 commit 2e9af2f

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

pipeline/filters/nest.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Nest
22

3-
The _Nest Filter_ plugin lets you operate on or with nested data. Its modes of operation are:
3+
The _Nest_ filter plugin lets you operate on or with nested data. Its modes of operation are:
44

5-
- `nest` - Take a set of records and place them in a map.
6-
- `lift` - Take a map by key and lift its records up.
5+
- `nest`: Take a set of records and place them in a map.
6+
- `lift` Take a map by key and lift its records up.
77

88
## Example usage for `nest`
99

@@ -59,7 +59,7 @@ Output:
5959
}
6060
```
6161

62-
## Configuration Parameters
62+
## Configuration parameters
6363

6464
The plugin supports the following configuration parameters:
6565

@@ -69,23 +69,21 @@ The plugin supports the following configuration parameters:
6969
| `Wildcard` | FIELD WILDCARD | `nest` | Nest records which field matches the wildcard |
7070
| `Nest_under` | FIELD STRING | `nest` | Nest records matching the `Wildcard` under this key |
7171
| `Nested_under` | FIELD STRING | `lift` | Lift records nested under the `Nested_under` key |
72-
| `Add_prefix` | FIELD STRING | ANY | Prefix affected keys with this string |
73-
| `Remove_prefix` | FIELD STRING | ANY | Remove prefix from affected keys if it matches this string |
72+
| `Add_prefix` | FIELD STRING | Any | Prefix affected keys with this string |
73+
| `Remove_prefix` | FIELD STRING | Any | Remove prefix from affected keys if it matches this string |
7474

75-
## Getting Started
75+
## Get started
7676

77-
To start filtering records, run the filter from the command line or through the
78-
configuration file. The following example invokes the
79-
[Memory Usage Input Plugin](../inputs/memory-metrics.md), which outputs the
80-
following:
77+
To start filtering records, run the filter from the command line or through the configuration file. The following example invokes the
78+
[Memory Usage Input Plugin](../inputs/memory-metrics.md), which outputs the following:
8179

8280
```text
8381
[0] memory: [1488543156, {"Mem.total"=>1016044, "Mem.used"=>841388, "Mem.free"=>174656, "Swap.total"=>2064380, "Swap.used"=>139888, "Swap.free"=>1924492}]
8482
```
8583

8684
## Example 1 - nest
8785

88-
### Command Line
86+
### Use `nest` from the command Line
8987

9088
Using command line mode requires quotes to parse the wildcard properly. The use
9189
of a configuration file is recommended.
@@ -98,7 +96,7 @@ wildcard rule to the keys and nests the keys matching `Mem.*` under the new key
9896
bin/fluent-bit -i mem -p 'tag=mem.local' -F nest -p 'Operation=nest' -p 'Wildcard=Mem.*' -p 'Nest_under=Memstats' -p 'Remove_prefix=Mem.' -m '*' -o stdout
9997
```
10098

101-
### Configuration File
99+
### Nest configuration file
102100

103101
{% tabs %}
104102
{% tab title="fluent-bit.conf" %}
@@ -145,7 +143,7 @@ pipeline:
145143
{% endtab %}
146144
{% endtabs %}
147145
148-
### Result
146+
### Nest result
149147
150148
The output of both the command line and configuration invocations should be identical and result in the following output.
151149
@@ -154,12 +152,12 @@ The output of both the command line and configuration invocations should be iden
154152
[0] mem.local: [1522978514.007359767, {"Swap.total"=>1046524, "Swap.used"=>0, "Swap.free"=>1046524, "Memstats"=>{"total"=>4050908, "used"=>714984, "free"=>3335924}}]
155153
```
156154
157-
## Example 2 - nest and lift undo
155+
## Example 2 - `nest` and `lift` undo
158156

159157
This example nests all `Mem.*` and `Swap.*` items under the `Stats` key and then
160158
reverses these actions with a `lift` operation. The output appears unchanged.
161159

162-
### Example 2 Configuration File
160+
### `nest` and `lift` undo configuration file
163161

164162
{% tabs %}
165163
{% tab title="fluent-bit.conf" %}
@@ -220,19 +218,19 @@ pipeline:
220218
{% endtab %}
221219
{% endtabs %}
222220

223-
### Result
221+
### `nest` and `lift` undo result
224222

225223
```text
226224
[2018/06/21 17:42:37] [ info] [engine] started (pid=17285)
227225
[0] mem.local: [1529566958.000940636, {"Mem.total"=>8053656, "Mem.used"=>6940380, "Mem.free"=>1113276, "Swap.total"=>16532988, "Swap.used"=>1286772, "Swap.free"=>15246216}]
228226
```
229227

230-
## Example 3 - nest 3 levels deep
228+
## Example 3 - `nest` 3 levels deep
231229

232230
This example takes the keys starting with `Mem.*` and nests them under `LAYER1`,
233231
which is then nested under `LAYER2`, which is nested under `LAYER3`.
234232

235-
### Example 3 Configuration File
233+
### Deep `nest` configuration file
236234

237235
{% tabs %}
238236
{% tab title="fluent-bit.conf" %}
@@ -300,7 +298,7 @@ pipeline:
300298
{% endtab %}
301299
{% endtabs %}
302300

303-
### Result
301+
### Deep `nest` Result
304302

305303
```text
306304
[0] mem.local: [1524795923.009867831, {"Swap.total"=>1046524, "Swap.used"=>0, "Swap.free"=>1046524, "LAYER3"=>{"LAYER2"=>{"LAYER1"=>{"Mem.total"=>4050908, "Mem.used"=>1112036, "Mem.free"=>2938872}}}}]
@@ -322,14 +320,14 @@ pipeline:
322320
}
323321
```
324322

325-
## Example 4 - multiple nest and lift filters with prefix
323+
## Example 4 - multiple `nest` and `lift` filters with prefix
326324

327-
This example uses the 3-level deep nesting of _Example 2_ and applies the
325+
This example uses the 3-level deep nesting of Example 2 and applies the
328326
`lift` filter three times to reverse the operations. The end result is that all
329327
records are at the top level, without nesting, again. One prefix is added for each
330328
level that's lifted.
331329

332-
### Configuration file
330+
### `nest` and `lift` prefix configuration file
333331

334332
{% tabs %}
335333
{% tab title="fluent-bit.conf" %}
@@ -434,7 +432,7 @@ pipeline:
434432
{% endtab %}
435433
{% endtabs %}
436434

437-
### Result
435+
### `nest` and `lift` prefix result
438436

439437
```text
440438
[0] mem.local: [1524862951.013414798, {"Swap.total"=>1046524, "Swap.used"=>0, "Swap.free"=>1046524, "Lifted3_Lifted2_Lifted1_Mem.total"=>4050908, "Lifted3_Lifted2_Lifted1_Mem.used"=>1253912, "Lifted3_Lifted2_Lifted1_Mem.free"=>2796996}]

0 commit comments

Comments
 (0)