Skip to content

email output plugin keeps only most recent options #5

Open
@Goulart

Description

@Goulart

I have this config for logstash output section:

if [severity_code] {
     if [severity_code] < 5 {
       email {
         subject => "Alert: %{severity} Origem: %{hostname}"
         body => "Timestamp: %{@timestamp}\nHost: %{host}\nHostname: %{hostname}\nMessagebody: %{messagebody}\nBrowse2: http://vip-kibana.bportugal.pt/kibana/index.html#/dashboard/script/logstash.js?query=host:%22%{host}%22,severity=%22%{severity}%22"
         from => "from@addr.lz"
         to => "group@addr.lz"
         replyto =>  "me@addr.lz"
         options => [ "smtpIporHost", "smtpServer.addr.lz", "port", "25" ]
       }
     }
     if [severity_code] < 3 {
       email {
         subject => "s"
         body => "%{severity}\n%{hostname}\n%{messagebody}"
         from => "from@addr.lz"
         replyto =>  "from@addr.lz"
         to => "920000000@sms.smsgateway.addr.lz"
         options => [ "smtpIporHost", "smsgateway.addr.lz", "port", "25" ]
       }
     }
}

A severity_code 3 notification will send, as expected, 1 email and 1 sms.
But the email plugin options stick to the last definition, so all subsequent severity_code 5 notifications try to send mail to smsgateway.addr.lz.
It seems that only the last definition of plugin options are kept.
(Pier-Hugues Pellerin asked me to submit the issue here)
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions