-
Notifications
You must be signed in to change notification settings - Fork 541
Update the filter docs with YAML configuration examples, the first half of filters in list. Fixes #1872. #1873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
patrick-stephens
merged 11 commits into
fluent:master
from
eschabell:erics-filters-yaml-updates
Jul 7, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f5931f0
Adding YAML examples for aws metadata filter doc. Part of issue #1872.
eschabell 4c8c419
Adding YAML examples for ecs metadata filter doc. Part of issue #1872.
eschabell b46e8d6
Adding YAML examples for geoip2 filter doc. Part of issue #1872.
eschabell f8667d4
Adding YAML examples for kubernetes filter doc. Part of issue #1872.
eschabell fd50e80
Adding YAML examples for lua filter doc. Part of issue #1872.
eschabell f6c3e5f
Adding YAML examples for record modifier filter doc. Part of issue #1…
eschabell 5095879
Adding YAML examples for nightfall filter doc. Part of issue #1872.
eschabell 6c0233d
Adding YAML examples for standard output filter doc. Part of issue #1…
eschabell 68fdca3
Adding YAML examples for throttle filter doc. Part of issue #1872.
eschabell 574522f
Adding YAML examples for tensorflow filter doc. Part of issue #1872.
eschabell d3208e5
Adding YAML examples for multiline stacktrace filter doc. Part of iss…
eschabell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -35,9 +35,50 @@ The following template variables can be used for values with the `ADD` option. S | |||||||
|
|
||||||||
| ### Configuration file | ||||||||
|
|
||||||||
| Below configurations assume a properly configured parsers file and 'storage.path' variable defined in the services | ||||||||
| section of the fluent bit configuration (not shown below). | ||||||||
|
Comment on lines
+38
to
+39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We try not to use positional language, and we can't use line wraps because gitbook renders them and it makes the pages look bad. |
||||||||
|
|
||||||||
| #### Example 1: Attach Task ID and cluster name to container logs | ||||||||
|
|
||||||||
| ```python | ||||||||
| {% tabs %} | ||||||||
| {% tab title="fluent-bit.yaml" %} | ||||||||
|
|
||||||||
| ```yaml | ||||||||
| pipeline: | ||||||||
| inputs: | ||||||||
| - name: tail | ||||||||
| tag: ecs.* | ||||||||
| path: /var/lib/docker/containers/*/*.log | ||||||||
| docker_mode: on | ||||||||
| docker_mode_flush: 5 | ||||||||
| docker_mode_parser: container_firstline | ||||||||
| parser: docker | ||||||||
| db: /var/fluent-bit/state/flb_container.db | ||||||||
| mem_buf_limit: 50MB | ||||||||
| skip_long_lines: on | ||||||||
| refresh_interval: 10 | ||||||||
| rotate_wait: 30 | ||||||||
| storage.type: filesystem | ||||||||
| read_from_head: off | ||||||||
|
|
||||||||
| filters: | ||||||||
| - name: ecs | ||||||||
| match: '*' | ||||||||
| ecs_tag_prefix: ecs.var.lib.docker.containers. | ||||||||
| add: | ||||||||
| - ecs_task_id $TaskID | ||||||||
| - cluster $ClusterName | ||||||||
|
|
||||||||
| outputs: | ||||||||
| - name: stdout | ||||||||
| match: '*' | ||||||||
| format: json_lines | ||||||||
| ``` | ||||||||
|
|
||||||||
| {% endtab %} | ||||||||
| {% tab title="fluent-bit.conf" %} | ||||||||
|
|
||||||||
| ```text | ||||||||
| [INPUT] | ||||||||
| Name tail | ||||||||
| Tag ecs.* | ||||||||
|
|
@@ -67,6 +108,9 @@ The following template variables can be used for values with the `ADD` option. S | |||||||
| Format json_lines | ||||||||
| ``` | ||||||||
|
|
||||||||
| {% endtab %} | ||||||||
| {% endtabs %} | ||||||||
|
|
||||||||
| The output log should be similar to: | ||||||||
|
|
||||||||
| ```text | ||||||||
|
|
@@ -80,6 +124,42 @@ The output log should be similar to: | |||||||
|
|
||||||||
| #### Example 2: Attach customized resource name to container logs | ||||||||
|
|
||||||||
| {% tabs %} | ||||||||
| {% tab title="fluent-bit.yaml" %} | ||||||||
|
|
||||||||
| ```yaml | ||||||||
| pipeline: | ||||||||
| inputs: | ||||||||
| - name: tail | ||||||||
| tag: ecs.* | ||||||||
| path: /var/lib/docker/containers/*/*.log | ||||||||
| docker_mode: on | ||||||||
| docker_mode_flush: 5 | ||||||||
| docker_mode_parser: container_firstline | ||||||||
| parser: docker | ||||||||
| db: /var/fluent-bit/state/flb_container.db | ||||||||
| mem_buf_limit: 50MB | ||||||||
| skip_long_lines: on | ||||||||
| refresh_interval: 10 | ||||||||
| rotate_wait: 30 | ||||||||
| storage.type: filesystem | ||||||||
| read_from_head: off | ||||||||
|
|
||||||||
| filters: | ||||||||
| - name: ecs | ||||||||
| match: '*' | ||||||||
| ecs_tag_prefix: ecs.var.lib.docker.containers. | ||||||||
| add: resource $ClusterName.$TaskDefinitionFamily.$TaskID.$ECSContainerName | ||||||||
|
|
||||||||
| outputs: | ||||||||
| - name: stdout | ||||||||
| match: '*' | ||||||||
| format: json_lines | ||||||||
| ``` | ||||||||
|
|
||||||||
| {% endtab %} | ||||||||
| {% tab title="fluent-bit.conf" %} | ||||||||
|
|
||||||||
| ```text | ||||||||
| [INPUT] | ||||||||
| Name tail | ||||||||
|
|
@@ -109,6 +189,9 @@ The output log should be similar to: | |||||||
| Format json_lines | ||||||||
| ``` | ||||||||
|
|
||||||||
| {% endtab %} | ||||||||
| {% endtabs %} | ||||||||
|
|
||||||||
| The output log would be similar to: | ||||||||
|
|
||||||||
| ```text | ||||||||
|
|
@@ -124,9 +207,42 @@ The template variables in the value for the `resource` key are separated by dot | |||||||
|
|
||||||||
| #### Example 3: Attach cluster metadata to non-container logs | ||||||||
|
|
||||||||
| This examples shows a use case for the `Cluster_Metadata_Only` option- attaching cluster metadata to ECS Agent logs. | ||||||||
| This examples shows a use case for the `Cluster_Metadata_Only` option attaching cluster metadata to ECS Agent logs. | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| {% tabs %} | ||||||||
| {% tab title="fluent-bit.yaml" %} | ||||||||
|
|
||||||||
| ```yaml | ||||||||
| pipeline: | ||||||||
| inputs: | ||||||||
| - name: tail | ||||||||
| tag: ecsagent.* | ||||||||
| path: /var/log/ecs/* | ||||||||
| db: /var/fluent-bit/state/flb_ecs.db | ||||||||
| mem_buf_limit: 50MB | ||||||||
| skip_long_lines: on | ||||||||
| refresh_interval: 10 | ||||||||
| rotate_wait: 30 | ||||||||
| storage.type: filesystem | ||||||||
| # Collect all logs on instance | ||||||||
| read_from_head: on | ||||||||
|
|
||||||||
| ```python | ||||||||
| filters: | ||||||||
| - name: ecs | ||||||||
| match: '*' | ||||||||
| cluster_metadata_only: on | ||||||||
| add: cluster $ClusterName | ||||||||
|
|
||||||||
| outputs: | ||||||||
| - name: stdout | ||||||||
| match: '*' | ||||||||
| format: json_lines | ||||||||
| ``` | ||||||||
|
|
||||||||
| {% endtab %} | ||||||||
| {% tab title="fluent-bit.conf" %} | ||||||||
|
|
||||||||
| ```text | ||||||||
| [INPUT] | ||||||||
| Name tail | ||||||||
| Tag ecsagent.* | ||||||||
|
|
@@ -151,3 +267,6 @@ This examples shows a use case for the `Cluster_Metadata_Only` option- attaching | |||||||
| Match * | ||||||||
| Format json_lines | ||||||||
| ``` | ||||||||
|
|
||||||||
| {% endtab %} | ||||||||
| {% endtabs %} | ||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't put the prompt in commands - it prevents a direct copy & paste, and markdownlint errors.