Not getting each error email alert from logstash 1.5.4

孤街醉人 提交于 2019-12-12 02:49:56

问题


I have my ELK setup like below:

HOST1: Component(which generates log) + Logstash (To send logs to redis)

HOST2: Redis + Elasticsearch + Logstash ( To parse data based on grok and send it to elasticsearch on same setup)

HOST3: Redis + Elasticsearch + Logstash ( To parse data based on grok and send it to elasticsearch on same setup)

HOST4: nginx + Kibana 4

Now when I send one error log line from logstash to redis, I get double entry in Kibana 4. Like below:

Plus I didnt get any email alert from logstash, although it is configured to send alert when severity == "Erro".

this is part of logstash conf file:

output {
elasticsearch { host => ["<ELK IP>"]  port => "9200" protocol => "http" }
if [severity] =~ /Erro/
{
email {
        from => "someone@somedomain.com"
        subject => "Error Alert"
        to => "someone@somedomain.com"
        via => "smtp"
        htmlbody => "<h2>Error Alert1</h2><br/><br/><div
        align='center'>%{message}</div>"
        options => [
               "smtpIporHost", "smtp.office365.com",
               "port", "587",
               "domain", "smtp.office365.com",
               "userName", "someone@somedomain.com",
               "password", "somepasswd",
               "authenticationType", "login",
               "starttls", "true"
       ]
}
}
stdout { codec => rubydebug }
}

I am using following custom grok pattern to parse log line:

ABTIMESTAMP %{YEAR}%{MONTHNUM2}%{MONTHDAY} %{USERNAME}
ABLOGLEVEL (Note|Erro|Fatl|Warn|Urgt)
ABLOG %{ABTIMESTAMP:timestamp} %{HOST:hostname} %{WORD:servername} %{INT:pid} %{INT:lwp} %{INT:thread} %{ABLOGLEVEL:severity};%{USERNAME:event}\(%{NUMBER:msgcat}/%{NUMBER:msgnum}\)%{GREEDYDATA:greedydata}

Any help here as, how to get each email alert for every error log line?

Thanks in advance!


回答1:


resolved it... Actually I was having multiple conf files in logstash/conf.d folder. I removed all unnecessary files and only kept my conf file and now its working. :). Thank you Val for your help



来源:https://stackoverflow.com/questions/32371673/not-getting-each-error-email-alert-from-logstash-1-5-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!