Ruby exception occurred: undefined method `*' for nil:NilClass

filter {

grok {
match => ["message", "%{TIMESTAMP_ISO8601:a} %{WORD} %{USER}] %{WORD} %{WORD} %{WORD:keyvalue}"]
add_tag => "warn"
}
metrics
{
meter => "events.%{keyvalue}"
add_tag => "metric"
ignore_older_than => 10
}
if "metric" in [tags] {
ruby {
        code => "event.cancel if event.get('events.all.rate_1m') * 60 < 5"
    }
}

}

The error is
[2017-05-04T03:13:32,431][ERROR][logstash.filters.ruby ] Ruby exception occurred: undefined method `*' for nil:NilClass
I don't know where is not correct.

Subfields are referenced via [field][subfield], not field.subfield, so you need to adjust your event.get call.

Thank you, I have changed by code => "event.cancel if event['events.all']['rate_1m'] * 60 < 5"

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.