ECONNREFUSED: Connection refused - connect (2) for "localhost" port 587

Hi, good day. I used email config and i encounter this Connection refused - connect (2) for "localhost" port 587

output {
elasticsearch {
hosts => ["localhost:9200"]
}
stdout {
codec => rubydebug
}
if "shouldmail" in [tags] {
email {
to => "xxx@teligent.ph"
username => "xxx03"
from => "xxx@gmail.com"
subject => "Alert"
body => "try logstash email"
domain => "smtp.gmail.com"
port => 587
password => "jarpvwyhwxhfkasr"
use_tls => true
via => "smtp"
}
}
}

You have not set the address option on the email output, so by default it connects to localhost.

1 Like

Thank you, Badger!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.