Skip to content

[Q&A] How send only records that meet some conditions #4736

Answered by bdragoiu
icalvete asked this question in Q&A
Discussion options

You must be logged in to vote

You could use the https://docs.fluentd.org/output/rewrite_tag_filter to change the tag using multiple blocks. Then simply those tags and go from there.

	<main_tag.local3.*>
		@type rewrite_tag_filter
		<rule>
			key as
			pattern ^200$
			tag as200.${tag}
                        invert  true # in order to exclude
		</rule>
		<rule>
			key x
			pattern ^(apache|nginx)$
			tag $1.${tag} # regex capture group in pattern, referenced with $1
		</rule>
	</match>

       <match as200.**></match>
       <match apache.**></match>
       <match nginx.**></match>

       <match **></match> # Do not forget to match what's left in case you care about it

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@icalvete
Comment options

Answer selected by icalvete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants