Skip to content
Merged
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
52 changes: 52 additions & 0 deletions pipeline/filters/rewrite-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,58 @@
...
[0] from.test_tag.new.fluent.bit.out: [1580436933.000050569, {"tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}}]
```
## Configuration Example with many Rules

Check warning on line 179 in pipeline/filters/rewrite-tag.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Headings] 'Configuration Example with many Rules' should use sentence-style capitalization. Raw Output: {"message": "[FluentBit.Headings] 'Configuration Example with many Rules' should use sentence-style capitalization.", "location": {"path": "pipeline/filters/rewrite-tag.md", "range": {"start": {"line": 179, "column": 4}}}, "severity": "INFO"}
In case of many rules, they are passed through in order until one rule matches. With`AND_COMBINE`value`true` as optional fifth

Check warning on line 180 in pipeline/filters/rewrite-tag.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Contractions] Feel free to use 'they're' instead of 'they are'. Raw Output: {"message": "[FluentBit.Contractions] Feel free to use 'they're' instead of 'they are'.", "location": {"path": "pipeline/filters/rewrite-tag.md", "range": {"start": {"line": 180, "column": 24}}}, "severity": "INFO"}
component, the rule is combined with the following rule like an 'and' combination. Only if first and following rule match, the message is retagged with the tag in the last matched rule.

Check warning on line 181 in pipeline/filters/rewrite-tag.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Spelling] Spelling check: 'retagged'? Raw Output: {"message": "[FluentBit.Spelling] Spelling check: 'retagged'?", "location": {"path": "pipeline/filters/rewrite-tag.md", "range": {"start": {"line": 181, "column": 139}}}, "severity": "INFO"}
An `AND_COMBINE` in the last rule is ignored.
```
[SERVICE]
Flush 5
Log_Level info
[INPUT]
Name tail
Tag tail
Path /var/tmp/loginput.txt
[FILTER]
Name rewrite_tag
Match tail
Rule $log ^(1)$ newtag_or false
Rule $log ^(.*and)$ newtag_and_1 false true
Rule $log ^(1.*)$ newtag_and_2 false
Rule $log ^(42)$ newtag_or false
Rule $log ^(9)$ newtag_and_3 false true
[OUTPUT]
Name stdout
Match *
```
inputfile /var/tmp/loginput.txt

Check warning on line 206 in pipeline/filters/rewrite-tag.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Spelling] Spelling check: 'inputfile'? Raw Output: {"message": "[FluentBit.Spelling] Spelling check: 'inputfile'?", "location": {"path": "pipeline/filters/rewrite-tag.md", "range": {"start": {"line": 206, "column": 1}}}, "severity": "INFO"}
```
1
2
3
9
10and
10
42
```

the logmessages will be rewritten:

Check warning on line 217 in pipeline/filters/rewrite-tag.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Spelling] Spelling check: 'logmessages'? Raw Output: {"message": "[FluentBit.Spelling] Spelling check: 'logmessages'?", "location": {"path": "pipeline/filters/rewrite-tag.md", "range": {"start": {"line": 217, "column": 5}}}, "severity": "INFO"}
```
fluent-bit_1 | [0] tail: [1596050753.241336500, {"log"=>"2"}]
fluent-bit_1 | [1] tail: [1596050753.241356700, {"log"=>"3"}]
fluent-bit_1 | [2] tail: [1596050753.241410100, {"log"=>"10"}]
fluent-bit_1 | [0] newtag_or: [1596050753.237370100, {"log"=>"1"}]
fluent-bit_1 | [1] newtag_or: [1596050753.241427200, {"log"=>"42"}]
fluent-bit_1 | [0] newtag_and_3: [1596050753.241374500, {"log"=>"9"}]
fluent-bit_1 | [0] newtag_and_2: [1596050753.241392800, {"log"=>"10and"}]
```





## Monitoring

Expand Down
Loading