Skip to content

Condition either breaks Logstash or is ignored #11744

@q2dg

Description

@q2dg

Hello.
I'm running JournalBeat 7.6.0 which sends unfiltered data to a Logstash 7.6.0 server , all running in one Fedora 30 system.
I just want to process events from sudo command with a priority greather than 1. So, inside a filter { } section in a Logstash conf file I've put this:

if [process][name] != "sudo" and [syslog][priority] > 1 { drop { } }

Well, Logstash breaks very badly with the error message I've attached in following image

Captura de pantalla de 2020-04-02 02-08-10

Finally I've discovered the problem was the ">" character. So, although it's not the same, I've tried with this other configuration:

if [process][name] != "sudo" and [syslog][priority] != 1 { drop { } }

Writing "!=" instead of ">" makes Logstash not to break, but the bad new is that now the second condition is completely ignored: I record all events generated by sudo regardless the priority value.

So I infer it's a Logstash bug.

P.S: If I put the line include_matches:["syslog.priority=1"] inside journalbeat.yml file and then I put this condition ( if [process][name] != "sudo" { drop { } } ) in Logstash conf file, it works, so it's not problem from original data: something is wrong when Logstash parses this numerical conditional.

Thanks

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