Skip to content

Commit 76f1ed3

Browse files
authored
filter_rewrite_tag: add examples for yaml configuration (#1309)
Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent 2f44d07 commit 76f1ed3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pipeline/filters/rewrite-tag.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ You can use `true` or `false` to decide the expected behavior. There is no defau
117117

118118
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:
119119

120+
{% tabs %}
121+
{% tab title="fluent-bit.conf" %}
120122
```python
121123
[SERVICE]
122124
Flush 1
@@ -137,6 +139,30 @@ The following configuration example will emit a dummy \(hand-crafted\) record, t
137139
Name stdout
138140
Match from.*
139141
```
142+
{% endtab %}
143+
144+
{% tab title="fluent-bit.yaml" %}
145+
```yaml
146+
service:
147+
flush: 1
148+
log_level: info
149+
pipeline:
150+
inputs:
151+
- name: dummy
152+
tag: test_tag
153+
dummy: '{"tool": "fluent", "sub": {"s1": {"s2": "bit"}}}'
154+
filters:
155+
- name: rewrite_tag
156+
match: test_tag
157+
rule: $tool ^(fluent)$ from.$TAG.new.$tool.$sub['s1']['s2'].out false
158+
emitter_name: re_emitted
159+
outputs:
160+
- name: stdout
161+
match: from.*
162+
```
163+
{% endtab %}
164+
{% endtabs %}
165+
140166
141167
The original tag `test_tag` will be rewritten as `from.test_tag.new.fluent.bit.out`:
142168

0 commit comments

Comments
 (0)