OS : Ubuntu 16.04
Installed : Elasticsearch, Kibana, Logstash (All 3 are of version 6.1)
Log type : iis
This is my config file for Logstash
input {
file {
type => "iis-w3c"
path => "/home/harsha/test.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
if [message] =~ "^#" {
drop {}
}
grok {
match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:serviceName} %{WORD:serverName} %{IP:serverIP} %{WORD:method} %{URIPATH:uriStem} %{NOTSPACE:uriQuery} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clientIP} %{NOTSPACE:protocolVersion} %{NOTSPACE:userAgent} %{NOTSPACE:cookie} %{NOTSPACE:referer} %{NOTSPACE:requestHost} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:win32response} %{NUMBER:bytesSent} %{NUMBER:bytesReceived} %{NUMBER:timetaken} %{IPORHOST:OriginalIP}"]
}
date {
match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss" ]
timezone => "Etc/UTC"
}
mutate {
convert => ["bytesSent", "integer"]
convert => ["bytesReceived", "integer"]
convert => ["timetaken", "integer"]
add_field => { "clientHostname" => "%{clientIP}" }
remove_field => [ "log_timestamp"]
}
}
output {
elasticsearch {
embedded => false
host => "localhost"
port => 9200
protocol => "http"
index => "my_index"
}
stdout {codec => rubydebug}
}
This is in the correct location etc/logstash/conf.d
I have ES installed and localhost:9200 is giving me what it is supposed to.
I have kibana installed as well and it is correctly configured to ES.
(Do I need to create the index beforehand in ES?, because I didn't.)
When I start Logstash using this "sudo systemctl start logstash.service" nothing is happening.
The test.log file is in the correct location and an example line of it is
2018-01-24 23:59:51 W3SVC11 happyweb 10.2.0.5 GET /blog/wp-content/uploads/2017/08/Mobile-accessories-min.jpg - 443 - 172.68.58.11 HTTP/1.1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.0;+Trident/5.0;++Trident/5.0) __cfduid=d422c9e6ed63a5957e526427f6341b8891516838382 - 200 0 0 50988 617 485 131.253.25.73
I have tested this with my format using grok debugger and the filters are fine according to it.
So I don't know what is missing. Can someone please help me figure it out?