Logstash output conditional on elasticsearch connection -


i'm using logstash parse , output results of several similar commands elasticsearch, similar this:

input {   exec {     type => 'hist'     command => '/usr/bin/somecommand'     interval => 900     codec => "json"   }    exec {     type => 'hist'     command => '/usr/bin/somecommand'     interval => 900     codec => "json"   }    exec {     type => 'hist'     command => '/usr/bin/somecommand'     interval => 900     codec => "json"   } }  output {         if [type] == "hist" {                 elasticsearch {                         hosts => ["hostname.domain.com:9200"]                         index => "monitor-hist-%{+yyyy-mm-dd}"                 }         } } 

what able output stdout or file if connection elasticsearch fails, like:

if _connectionfails_ {     stdout {           codec => rubydebug     } } 

is possible? or other recommendations managing data when elastic unavailable?

logstash keeps events in main memory during processing. logstash responds sigterm attempting halt inputs , waiting pending events finish processing before shutting down. when pipeline cannot flushed due stuck output or filter, logstash waits indefinitely. example, when pipeline sends output database unreachable logstash instance, instance waits indefinitely after receiving sigterm.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -