Skip to content

Modifiers are not honored in patterns config option #1436

Closed
@nathanielc

Description

@nathanielc

I expected the following logparser config to create a port tag and packets, bytes as integer fields. But instead I got three string fields and no tags:

[[inputs.logparser]]
   files = ["/var/lib/pmacct/in_port.txt"]
   from_beginning = true
   [inputs.logparser.grok]
     patterns = ["%{NONNEGINT:port:tag},%{NONNEGINT:packets:int},%{NONNEGINT:bytes:int}"]

This config on the other hand worked, which uses the custom_patterns config option.

[[inputs.logparser]]
   files = ["/var/lib/pmacct/in_port.txt"]
   from_beginning = true
   [inputs.logparser.grok]
     measurement = "net_in_port"
     patterns = ["%{CSV_PORT}"]
     custom_patterns = '''
CSV_PORT %{NONNEGINT:port:tag},%{NONNEGINT:packets:int},%{NONNEGINT:bytes:int}
'''

Either the patterns config needs to error if the patterns contain modifiers or they need to work.

Version: 1.0.0-beta2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions