Never use more than one DATA or GREEDYDATA in the same expression. Build the expression gradually and be as exact as you can. Start with the simplest possible expression, ^%{TIME:time} and build from there.
It is working fine now. But when i tired to use the same pattern in my below else condition it is failing. First grok filter in if else condition is working but the else condition grok filter is not working. Is there any issue with my if else syntax?
Changed but the second else condition grok filter is not working. when i run the same grok filter in separate config file with out if condition it is working
For above query, i am able to fix it with your guidance. But i am facing issue when doing below comparison with float value in grok filter
Code snippet:
output {
if [totaldelay] >= 0.500 {
email {
to => 'govinda.rao@xxxx.com'
from => 'job@localhost.com'
subject => 'Alert - batch is running longer. Please check...'
body => "%{message}"
domain => 'mail.localhost.com'
port => 25
}
}
}
Error:
ArgumentError: comparison of Float with nil failed
>= at org/jruby/RubyFloat.java:595
output_func at (eval):128
output_batch at /home/govind/logstash-2.4.1/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/pipeline.rb:293
each at org/jruby/RubyArray.java:1613
inject at org/jruby/RubyEnumerable.java:852
output_batch at /home/govind/logstash-2.4.1/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/pipeline.rb:287
worker_loop at /home/govind/logstash-2.4.1/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/pipeline.rb:232
start_workers at /home/govind/logstash-2.4.1/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/pipeline.rb:201
Thanks Magnus it worked. Is there a way i can implement in the above output code snippet that, if [totaldelay] >=0.500 continuously for 15 minutes then send an email alert. Please help i am not getting any clue on this
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.