ruby - ELK – Logstash Email Alerting Config Issues -
i've been playing around logstash , wanting know how configure email alerting correctly.
i'm looking pick string "bvdcs_lap" , send mail onto address given.
the config have is:
input { udp { port => 5000 type => syslog } } filter { if [type] == "syslog" { grok { match => { "message" => "%{syslogtimestamp:syslog_timestamp} %{sysloghost:syslog_hostname} %{data:syslog_program}(?:\[%{posint:syslog_pid}\])?: %{greedydata:syslog_message}" } add_field => [ "received_at", "%{@timestamp}" ] add_field => [ "received_from", "%{host}" ] } syslog_pri { } date { match => [ "syslog_timestamp", "mmm d hh:mm:ss", "mmm dd hh:mm:ss" ] } } } output { elasticsearch { host => localhost } stdout { codec => rubydebug } } email { => "mymail@domain" match => { "bvdcs_lap", "message,bvdcs_lap", "bvdcs_lap", "message,bvdcs_lap" } subject => "%{matchname}" => "mymail@domain" via => "smtp" body => "here event line occured: %{message}" htmlbody => "<h2>%{matchname}</h2><br/><br/><h3>full event</h3><br/><br/><div align='center'>%{@message}</div>" } } e-mails not being sent , in logstash.conf i'm seeing below on line 27:
{:timestamp=>"2015-07-07t12:55:50.597000+0100", :message=>"error: expected 1 of #, input, filter, output @ line 27, column 8 (byte 649) after "}
i’m curious know if original grok coding correct , if work out how set tag syslog message , use email output?
thanks
logstash not built alerts. i've seen couple of people try use limited (single strings) , worked in small scale.
you can try solution logz.io (disclaimer: work there) offers alerts on top of logstash/elasticsearch. ship logs logstash logz.io, configure string you're looking , sends email alerts when string matches.
Comments
Post a Comment