NoMethodError: undefined method `<’ for nil:NilClass>

date
{
match => [ "event_timestamp", "dd MMM yyyy HH:mm:ss,SSS" ]
target => "event_timestamp"
add_field => {"[hour]" => "%{+HH}"}
add_field => {"[min]" => "%{+EEE}"}
}
mutate{
convert =>{ "hour" => "integer"}
}
Hi
In logstash output for elasticsearch am using below code and getting

NoMethodError: undefined method `<’ for nil:NilClass>

if ([hour] < 2 ){
elasticsearch{
host =>[10.343.434.343:9200]
index => index -1
}}
} else if ( 5 > [hour] and [hour] >=2 )
{
elasticsearch{
host =>[10.343.434.343:9200]
index => index -2
}
}

That configuration is not even close to being compilable. Please provide a configuration that actually demonstrates the issue.

That said, I would expect that error if you have pipeline.java_execution false and the [hour] field does not exist. (With java_execution true you get a much less informative NPE.)

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