Hi,
Below is my configuration file
filter {
if [type] == "sftp_authlog" {
grok {
pattern => "%{SYSLOGTIMESTAMP:timestamp} %{HOSTNAME:host_target} sshd[%{BASE10NUM}]: Failed password for (invalid user |)%{USERNAME:username} from %{IP:src_ip} port %{BASE10NUM:port} ssh2"
match => { "message" => "fail" }
}
}
}
output {
elasticsearch { host => localhost }
stdout { codec => rubydebug }
email {
#type => "sftp_authlog"
match => [ "fail","%{@message}" ]
match => { "message" => "fail" }
match =>["messageAndSourceMatch", "@message,fail"]
to => "gaurav.gurani@xyz.com"
from => "logstash@xyz.com"
options => [ "smtpIporHost", "x.x.x.x","port", "xx" ]
#from => "logstash@hcentive.com"
subject => "Found '%{matchName}' Alert on %{@source_host}"
#to => "gaurav.gurani@hcentive.com"
body => "Here is the event line that occured: %{@message}"
htmlbody => "
%{matchName}
Full Event
}
}
sftp_authlog- this is catching logs from remote host(with logstash-forwarder) and i am applying filter in logstash server.i am not able to receive the mails from above config .but when i am commenting the match inside email block then mail is coming but that was blank mail
Requirement :- i want to receive from logstash when certain login failure attempted