Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions pipeline/filters/grep.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@

The plugin supports the following configuration parameters:

| Key | Value Format | Description |
| ------------ | ------------ | ----------- |
| `Regex` | `KEY REGEX` | Keep records where the content of `KEY` matches the regular expression. |
| `Exclude` | `KEY REGEX` | Exclude records where the content of `KEY` matches the regular expression. |
| `Logical_Op` | `Operation` | Specify a logical operator: `AND`, `OR` or `legacy` (default). In `legacy` mode the behaviour is either `AND` or `OR` depending on whether the `grep` is including (uses `AND`) or excluding (uses OR). Available from 2.1 or higher. |
| Key | Value Format | Record Type | Description |
| :--- | :--- | :--- | :--- |
| `Regex` | `KEY REGEX` | String | Keep records in which the content of `KEY` matches the regular expression. |
| `Exclude` | `KEY REGEX` | String | Exclude records in which the content of `KEY` matches the regular expression. |
| `number_equal` | `KEY NUMBER` | number | Keep records in which the content of `KEY` is equal to `NUMBER`. |
| `number_not_equal` | `KEY NUMBER` | number | Keep records in which the content of `KEY` is not equal to `NUMBER`. |

Check warning on line 18 in pipeline/filters/grep.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Contractions] Feel free to use 'isn't' instead of 'is not'. Raw Output: {"message": "[FluentBit.Contractions] Feel free to use 'isn't' instead of 'is not'.", "location": {"path": "pipeline/filters/grep.md", "range": {"start": {"line": 18, "column": 91}}}, "severity": "INFO"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this, why have we removed the logical_op as well?

I would expect us to add additional operators really rather than weird looking text strings.

It needs examples, e.g. to show precedence and conflict resolution when you define multiple rules for example.

| `number_less_than` | `KEY NUMBER` | number | Keep records in which the content of `KEY` is less than the `NUMBER`. |
| `number_less_than_or_equal` | `KEY NUMBER` | number | Keep records in which the content of `KEY` is less than or equal to `NUMBER`. |
| `number_greater_than` | `KEY NUMBER` | number | Keep records in which the content of `KEY` is greater than the `NUMBER`. |
| `number_greater_than_or_equal` | `KEY NUMBER` | number | Keep records in which the content of `KEY` is greater than or equal to `NUMBER`. |


If you use the number compare parameters with a KEY that does not have a NUMBER as a value, it will be excluded.

Check warning on line 25 in pipeline/filters/grep.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Contractions] Feel free to use 'doesn't' instead of 'does not'. Raw Output: {"message": "[FluentBit.Contractions] Feel free to use 'doesn't' instead of 'does not'.", "location": {"path": "pipeline/filters/grep.md", "range": {"start": {"line": 25, "column": 58}}}, "severity": "INFO"}

Check warning on line 25 in pipeline/filters/grep.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Acronyms] Spell out 'KEY', if it's unfamiliar to the audience. Raw Output: {"message": "[FluentBit.Acronyms] Spell out 'KEY', if it's unfamiliar to the audience.", "location": {"path": "pipeline/filters/grep.md", "range": {"start": {"line": 25, "column": 49}}}, "severity": "INFO"}

If you use `REGEX` or `EXCLUDE` with a number, it will never match it.

### Record accessor enabled

Expand Down