I am new to grok function, can someone you help me to work this out
my log look like :
#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2018-04-25 00:00:00
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2018-04-25 00:00:00 100.00.0.00 HEAD / - 80 - 00.00.0.0 WhatsUp/0.0 - 1 1 1 62
and my conf file look like
input {
beats {
port => 5044
type => "log"
}
}
filter {
mutate {
add_field => {
"log_timestamp" => "%{date} %{time}"
}
}
}
grok {
match => {"message" => "%{TIMESTAMP_ISO8601:log_timestamp}%{SPACE}%{IPORHOST:s-ip}%{SPACE}%{WORD:cs-method}%{SPACE}%{URIPATH:cs-uri-stem}%{SPACE}%{IPORHOST:c-ip}%{SPACE}%{NOTSPACE:cs-(User-Agent)}%{SPACE}%{WORD:sc(Referer)}%{SPACE}%{NUMBER:sc-status}%{SPACE}%{NUMBER:sc-substatus}%{SPACE}%{NUMBER:sc-win32-status}%{SPACE}%{NUMBER:time-taken}"
}
}
}
output {
elasticsearch {
hosts => "localhost:9200"
manage_template => false
index => "iis_test1-%{+YYYY.MM}"
document_type => "log"
}
}
the massage do't parsed, I'm getting one field
t message 2018-05-01 23:58:49 172.18.1.23 GET /F5/F5.htm - 443 - 00.04.10.00 - - 200 0 0 0