Skip to content

Allow not - match - pattern #3057

@ferbar

Description

@ferbar

Is your feature request related to a problem? Please describe.
I'm having several input plugins, for example tags aaa.* bbb.* ccc.* etc
I would like to apply record_modifier to everything but aaa.*

Describe the solution you'd like

<filter /(?!aaa).*/ >
   @type record_modifier
   ....

== or ==

<filter !aaa.**>
   @type record_modifier
   ....

Describe alternatives you've considered

explicitly filter for bbb.** ccc.** etc

Additional context
(?!aaa) doesn't work at the moment because every non-word character is escaped in
https://github.com/fluent/fluentd/blob/master/lib/fluent/match.rb#L113

I see 3 possible, easy to implement solutions:

  1. allow regex with a / prefix, string must end with /
    <filter /some-regex/>

  2. don't escape "(?!" and the corresponding ")"

  3. allow pattern like
    !aaa.**

and create a regex (?!aaa).* from it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions