Skip to content

Commit 13a10c6

Browse files
pipeline: processors: conditional processing: general cleanup
Signed-off-by: Alexa Kreizinger <[email protected]>
1 parent 09bcd1f commit 13a10c6

File tree

2 files changed

+17
-27
lines changed

2 files changed

+17
-27
lines changed

pipeline/processors/conditional-processing.md

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
# Conditional processing
22

3-
Conditional processing lets you selectively apply [processors](README.md) to
4-
logs based on the value of fields that those logs contain. This feature lets you
5-
create processing pipelines that only process records that meet certain
6-
criteria, and ignore the rest.
3+
Conditional processing lets you selectively apply [processors](README.md) to logs based on the value of fields that those logs contain. This feature lets you create processing pipelines that only process records that meet certain criteria, and ignore the rest.
74

85
Conditional processing is available in Fluent Bit version 4.0 and greater.
96

107
## Configuration
118

12-
You can turn a standard processor into a conditional processor by adding a
13-
`condition` block to the processor's YAML configuration settings.
9+
You can turn a standard processor into a conditional processor by adding a `condition` block to the processor's YAML configuration settings.
1410

1511
{% hint style="info" %}
16-
- Conditional processing is only available for [YAML configuration files](../../administration/configuring-fluent-bit/yaml/README.md), not [classic configuration files](../../administration/configuring-fluent-bit/classic-mode/README.md).
17-
- Conditional Processing feature is not supported when using [Filter as Processor](./filters.md).
12+
- Conditional processing is only available for [YAML configuration files](../administration/configuring-fluent-bit/yaml/README.md), not [classic configuration files](../administration/configuring-fluent-bit/classic-mode/README.md).
13+
- Conditional processing isn't supported if you're using a [filter as a processor](../pipeline/processors/filters).
1814
{% endhint %}
1915

2016
These `condition` blocks use the following syntax:
@@ -45,19 +41,14 @@ pipeline:
4541
{% endtab %}
4642
{% endtabs %}
4743

48-
Each processor can only have a single `condition` block, but that condition can
49-
include multiple rules. These rules are stored as items in the `condition.rules`
50-
array.
44+
Each processor can only have a single `condition` block, but that condition can include multiple rules. These rules are stored as items in the `condition.rules` array.
5145

5246
### Condition evaluation
5347

54-
The `condition.op` parameter specifies the condition's evaluation logic. It has
55-
two possible values:
48+
The `condition.op` parameter specifies the condition's evaluation logic. It can have one of the following values:
5649

57-
- `and`: A log entry meets this condition when all the rules in the `condition.rules`
58-
are [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy).
59-
- `or`: A log entry meets this condition when one or more rules in the `condition.rules`
60-
array are [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy).
50+
- `and`: A log entry meets this condition when all the rules in the `condition.rules` array are [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy).
51+
- `or`: A log entry meets this condition when one or more rules in the `condition.rules` array are [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy).
6152

6253
### Rules
6354

@@ -104,8 +95,7 @@ The `conditions.rules.op` parameter has the following possible values:
10495

10596
### Basic condition
10697

107-
This example applies a condition that only processes logs that contain the
108-
string `{"request": {"method": "POST"`:
98+
This example applies a condition that only processes logs that contain the string `{"request": {"method": "POST"`:
10999

110100
{% tabs %}
111101
{% tab title="fluent-bit.yaml" %}
@@ -116,7 +106,7 @@ pipeline:
116106
- name: dummy
117107
dummy: '{"request": {"method": "GET", "path": "/api/v1/resource"}}'
118108
tag: request.log
119-
109+
120110
processors:
121111
logs:
122112
- name: content_modifier
@@ -147,7 +137,7 @@ pipeline:
147137
- name: dummy
148138
dummy: '{"request": {"method": "POST", "path": "/api/v1/sensitive-data"}}'
149139
tag: request.log
150-
140+
151141
processors:
152142
logs:
153143
- name: content_modifier
@@ -181,7 +171,7 @@ pipeline:
181171
- name: dummy
182172
dummy: '{"request": {"method": "GET", "path": "/api/v1/resource", "status_code": 200, "response_time": 150}}'
183173
tag: request.log
184-
174+
185175
processors:
186176
logs:
187177
- name: content_modifier
@@ -215,7 +205,7 @@ pipeline:
215205
- name: dummy
216206
dummy: '{"request": {"method": "GET", "path": "/api/v1/resource"}}'
217207
tag: request.log
218-
208+
219209
processors:
220210
logs:
221211
- name: content_modifier
@@ -246,7 +236,7 @@ pipeline:
246236
- name: dummy
247237
dummy: '{"log": "Error: Connection refused", "level": "error", "service": "api-gateway"}'
248238
tag: app.log
249-
239+
250240
processors:
251241
logs:
252242
- name: content_modifier
@@ -262,7 +252,7 @@ pipeline:
262252
- field: "$service"
263253
op: in
264254
value: ["api-gateway", "authentication", "database"]
265-
255+
266256
- name: content_modifier
267257
action: insert
268258
key: paging_required
@@ -281,5 +271,4 @@ pipeline:
281271
{% endtab %}
282272
{% endtabs %}
283273

284-
This configuration adds an `alert` field to error logs from critical services,
285-
and adds a `paging_required` field to errors that contain specific critical patterns.
274+
This configuration adds an `alert` field to error logs from critical services, and adds a `paging_required` field to errors that contain specific critical patterns.

vale-styles/FluentBit/Spelling-exceptions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ Timeshift
194194
tolerations
195195
tooltip
196196
tooltips
197+
truthy
197198
uber
198199
unaggregated
199200
unary

0 commit comments

Comments
 (0)