Error in comparing date type fields on logstash

Hi.

I have the following error when comparing two fields of date types:

An unexpected error occurred! {:error=>#<NoMethodError: undefined method >' for nil:NilClass>, :backtrace=>["(eval):81714:in block in initialize'", "org/jruby/RubyArray.java:1792:in each'", "(eval):81712:in block in initialize'", "(eval):81748:in block in initialize'", "org/jruby/RubyArray.java:1792:in each'",

The code in the filter looks like this:

      mutate{replace => {"Timestamp"=>"%{+YYYY-MM-dd}T%{hour}"}}
      mutate { add_field => { "Timestamp19" => "%{+YYYY-MM-dd}T19:00:00" } }
  
  #String to Date TimeStamp
 	 date
		{
			match => [  "Timestamp", "ISO8601", "YYYY-MM-dd HH:mm:ss", "YYYY-MM-dd HH:mm:ss ZZZ", "YYYY-MM-dd HH:mm:ss SSS"]
			target => "TimeStamp"
      locale => "en"
  		} 
     

   #String to Date TimeStamp19
 	 date
		{
			match => [  "Timestamp19", "ISO8601", "YYYY-MM-dd HH:mm:ss", "YYYY-MM-dd HH:mm:ss ZZZ", "YYYY-MM-dd HH:mm:ss SSS"]
			target => "TimeStamp19"
      locale => "en"
  		}  
     

   #Comparing 
   if [TimeStamp] > [TimeStamp19] {
      mutate { add_field => { "EsMayor" => "SI" } }
   
   }   

hour is a source field containing an hour

The two date fields are converted correctly, but the error occurs in the comparison

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