Hi , I am trying to use grok filter on this log , There is a space after WARN I have tried using %s* \s* and also %{SPACE} but it is not triggering an email. can some one please help me.
[2017-03-25T00:00:07,137][WARN ]
input {
file {
path => "/var/log/logstash/sample"
start_position => beginning
}
}
filter {
grok {
match => { "message" => "\[%{TIMESTAMP_ISO8601:timestamp}\]\[%{LOGLEVEL:log-level}\s*\]" }
}
}
output {
email {
port => 25
address => "mail.tck.com"
authentication => "login"
use_tls => true
from => "alerts@logstash.com"
subject => "logstash alert"
to => "abc@tck.com"
via => "smtp"
body => "%{message}"
debug => true
}
}
~
~
I am using log stash 2.2.4