Skip to content

docs: filters: rewrite-tag: fix params, add yaml example#2389

Open
eschabell wants to merge 1 commit intofluent:masterfrom
eschabell:erics_filters_rewrite_tag_fixes
Open

docs: filters: rewrite-tag: fix params, add yaml example#2389
eschabell wants to merge 1 commit intofluent:masterfrom
eschabell:erics_filters_rewrite_tag_fixes

Conversation

@eschabell
Copy link
Collaborator

@eschabell eschabell commented Feb 27, 2026

  • Sort configuration parameters table alphabetically
  • Fix parameter name case to lowercase to match convention
  • Add fluent-bit.yaml tab to the multiple rules configuration example
  • Remove AND_COMBINE documentation: the fifth rule component is not implemented in the source (process_config() only reads four components; rewrite_rule struct has no and_combine field)
  • Fix blank line before ## Configuration example with multiple rules header
  • Fix MD031: add blank lines around code fences
  • Fix MD040: add missing language specifier on output code fence

Fixes #2388

Summary by CodeRabbit

  • Documentation
    • Standardized rewrite_tag filter configuration keys to snake_case for clarity.
    • Updated all examples, metrics, and descriptive text to use the new names: rule, emitter_name, emitter_storage.type, emitter_mem_buf_limit.
    • Reworked multiple-rule examples to show ordered evaluation (replacing prior AND_COMBINE guidance) and clarified buffer/emit behavior and metric naming in monitoring notes.

@eschabell eschabell self-assigned this Feb 27, 2026
@eschabell eschabell requested a review from a team as a code owner February 27, 2026 08:06
@eschabell eschabell added waiting-on-review Waiting on a review from mainteners 5.0 labels Feb 27, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e41521e and f9db25f.

📒 Files selected for processing (1)
  • pipeline/filters/rewrite-tag.md

📝 Walkthrough

Walkthrough

Documentation for the rewrite_tag filter was updated to rename public configuration keys from CamelCase to snake_case (e.g., Rulerule, Emitter_Nameemitter_name, Emitter_Storage.typeemitter_storage.type, Emitter_Mem_Buf_Limitemitter_mem_buf_limit) and to update examples, multi-rule demonstrations, and metric references accordingly.

Changes

Cohort / File(s) Summary
Documentation: rewrite_tag
pipeline/filters/rewrite-tag.md
Renamed public config keys from CamelCase to snake_case across text and examples; updated YAML and classic CONF examples for multiple ordered rules; adjusted metric examples to use emitter_name; revised buffer/pause wording.
Manifest / Changelog
.../manifest
Metadata/manifest lines updated to reflect documentation edits (lines changed: +52 / -13).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • cosmo0920
  • patrick-stephens

Poem

I nibble keys and tidy the trail,
Underscores hop where capitals fail,
YAML rows march, one, two, three,
Metrics call the emitter_name for me,
A rabbit dances — docs set sail. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes: fixing documentation parameter names and adding a YAML configuration example for the rewrite-tag filter.
Linked Issues check ✅ Passed The pull request directly addresses issue #2388 by adding a YAML example with multiple rewrite_tag rules and fixing parameter documentation to match project conventions.
Out of Scope Changes check ✅ Passed All changes are scoped to the rewrite-tag.md documentation file and directly support the objectives of fixing parameter names and providing YAML examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
pipeline/filters/rewrite-tag.md (2)

180-241: Excellent addition of YAML multiple-rules example.

This new section directly addresses the PR objectives and issue #2388 by providing a clear YAML configuration example for multiple rewrite_tag rules. The structure is well-organized with:

  • Clear explanation that rules are evaluated in order until one matches
  • Both YAML and .conf format examples in tabs
  • Consistent use of the 4-component rule format

The YAML syntax is correct, and the example demonstrates practical usage with multiple rules.

Optional: Consider using contraction for a conversational tone.

Line 182 could use "they're" instead of "they are" per the FluentBit style guide suggestion, though this is purely stylistic.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pipeline/filters/rewrite-tag.md` around lines 180 - 241, Change the sentence
"When multiple rules are defined, they are evaluated in order until one
matches." to use a contraction for a more conversational tone: replace "they
are" with "they're" in the rewrite-tag.md snippet so it reads "When multiple
rules are defined, they're evaluated in order until one matches." This is the
only change needed in the top explanatory line of the multi-rule example.

26-31: Configuration table correctly reflects YAML parameter conventions.

The parameter table has been appropriately updated to use snake_case naming, which aligns with YAML configuration format conventions. The descriptions are clear and technically accurate.

Minor: Consider addressing style guide feedback.

The pipeline validation suggests reviewing the use of "below" on line 28 per the FluentBit Style Guide. This is a directional term that style guides often recommend replacing with more specific references.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pipeline/filters/rewrite-tag.md` around lines 26 - 31, Update the phrasing
that uses the directional term "below" in the emitter buffer description to a
more specific, style-guide-compliant phrase; for example, replace "The pipeline
will remain paused until the output drains the buffer below the `10M` limit."
with "The pipeline will remain paused until the output drains the buffer to a
value less than the `10M` limit." Ensure this change is applied to the
description for emitter_mem_buf_limit in the table and keep the parameter name
`emitter_mem_buf_limit` and example value `10M` intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pipeline/filters/rewrite-tag.md`:
- Around line 180-241: Change the sentence "When multiple rules are defined,
they are evaluated in order until one matches." to use a contraction for a more
conversational tone: replace "they are" with "they're" in the rewrite-tag.md
snippet so it reads "When multiple rules are defined, they're evaluated in order
until one matches." This is the only change needed in the top explanatory line
of the multi-rule example.
- Around line 26-31: Update the phrasing that uses the directional term "below"
in the emitter buffer description to a more specific, style-guide-compliant
phrase; for example, replace "The pipeline will remain paused until the output
drains the buffer below the `10M` limit." with "The pipeline will remain paused
until the output drains the buffer to a value less than the `10M` limit." Ensure
this change is applied to the description for emitter_mem_buf_limit in the table
and keep the parameter name `emitter_mem_buf_limit` and example value `10M`
intact.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc38f3c and 207db50.

📒 Files selected for processing (1)
  • pipeline/filters/rewrite-tag.md

@eschabell eschabell force-pushed the erics_filters_rewrite_tag_fixes branch from 207db50 to 1d93613 Compare February 27, 2026 08:10
@eschabell
Copy link
Collaborator Author

@patrick-stephens and @cosmo0920 this is ready for review if you have some time please?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pipeline/filters/rewrite-tag.md`:
- Around line 187-210: The YAML example uses multiple duplicate "rule:" keys
under the rewrite_tag filter which is invalid YAML; update the filters block for
the "rewrite_tag" entry so there is a single "rule:" key whose value is a YAML
sequence (array) of quoted rule strings, each following the format KEY REGEX
NEW_TAG KEEP (with an optional 5th AND_COMBINE field), preserving the original
rule order and quoting each line (e.g., "$log ^(1)$ newtag_or false", "$log
^(.*and)$ newtag_and_1 false", etc.) so Fluent Bit evaluates them in sequence.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 207db50 and 1d93613.

📒 Files selected for processing (1)
  • pipeline/filters/rewrite-tag.md

@eschabell eschabell force-pushed the erics_filters_rewrite_tag_fixes branch from 1d93613 to e41521e Compare February 27, 2026 12:38
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pipeline/filters/rewrite-tag.md`:
- Around line 201-206: Update the multi-rule example so the expected output
matches first-match evaluation: change the displayed output tag for input
"10and" from newtag_and_2 to newtag_and_1 (because "$log ^(.*and)$  newtag_and_1
false" is evaluated before "$log ^(1.*)$  newtag_and_2 false"); ensure the same
correction is applied to the second occurrence of this example (lines referenced
in the comment).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d93613 and e41521e.

📒 Files selected for processing (1)
  • pipeline/filters/rewrite-tag.md

  - Sort configuration parameters table alphabetically
  - Fix parameter name case to lowercase to match convention
  - Add fluent-bit.yaml tab to the multiple rules configuration example
  - Remove AND_COMBINE documentation: the fifth rule component is not
    implemented in the source (process_config() only reads four components;
    rewrite_rule struct has no and_combine field)
  - Fix blank line before ## Configuration example with multiple rules header
  - Fix MD031: add blank lines around code fences
  - Fix MD040: add missing language specifier on output code fence

Fixes fluent#2388

Signed-off-by: Eric D. Schabell <eric@schabell.org>
@eschabell eschabell force-pushed the erics_filters_rewrite_tag_fixes branch from e41521e to f9db25f Compare February 27, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0 waiting-on-review Waiting on a review from mainteners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation of multiple rules for rewrite_tag in YAML format

2 participants