You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline/processors/conditional-processing.md
+16-27Lines changed: 16 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,16 @@
1
1
# Conditional processing
2
2
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.
7
4
8
5
Conditional processing is available in Fluent Bit version 4.0 and greater.
9
6
10
7
## Configuration
11
8
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.
14
10
15
11
{% 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).
18
14
{% endhint %}
19
15
20
16
These `condition` blocks use the following syntax:
@@ -45,19 +41,14 @@ pipeline:
45
41
{% endtab %}
46
42
{% endtabs %}
47
43
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.
51
45
52
46
### Condition evaluation
53
47
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:
56
49
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).
61
52
62
53
### Rules
63
54
@@ -104,8 +95,7 @@ The `conditions.rules.op` parameter has the following possible values:
104
95
105
96
### Basic condition
106
97
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"`:
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.
0 commit comments