Skip to content
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

filter_rewrite_tag: add examples for yaml configuration #1309

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all 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
26 changes: 26 additions & 0 deletions pipeline/filters/rewrite-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ You can use `true` or `false` to decide the expected behavior. There is no defau

The following configuration example will emit a dummy \(hand-crafted\) record, the filter will rewrite the tag, discard the old record and print the new record to the standard output interface:

{% tabs %}
{% tab title="fluent-bit.conf" %}
```python
[SERVICE]
Flush 1
Expand All @@ -137,6 +139,30 @@ The following configuration example will emit a dummy \(hand-crafted\) record, t
Name stdout
Match from.*
```
{% endtab %}

{% tab title="fluent-bit.yaml" %}
```yaml
service:
flush: 1
log_level: info
pipeline:
inputs:
- name: dummy
tag: test_tag
dummy: '{"tool": "fluent", "sub": {"s1": {"s2": "bit"}}}'
filters:
- name: rewrite_tag
match: test_tag
rule: $tool ^(fluent)$ from.$TAG.new.$tool.$sub['s1']['s2'].out false
emitter_name: re_emitted
outputs:
- name: stdout
match: from.*
```
{% endtab %}
{% endtabs %}


The original tag `test_tag` will be rewritten as `from.test_tag.new.fluent.bit.out`:

Expand Down