Hi there,
This is my first post here. I went through many conversations you guys have but I am still struggling with making my ELK working as I'd like it to.
I am using ELK 6.5.4. version, running everything with docker-compose
Log event that I have is following :
93.136.229.0 - - [23/Jan/2019:14:31:16 +0000] "GET / HTTP/1.1" 200 3476 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:64.0) Gecko/20100101 Firefox/64.0"
Grok pattern that I have is following:
%{IPORHOST:remote_ip} - - \[%{HTTPDATE:access_time}\] \"%{WORD:http_method} / HTTP/%{NUMBER:http_version}\" %{NUMBER:response_code} %{NUMBER:body_sent_bytes} %{GREEDYDATA:msg}
While this works great in grok construct and grok debug sites i.e. everything gets broken into key:value output like dictionary but this is not the case with Kibana. In Kibana everything ends up in message field.
I have tried kv filter with add_field option but I guess I am doing something wrong since I don't get values in Kibana next to the wanted field. Instead of that I get:
`access_time:%{[doc][access_time]}`
Here are the links I was following:
My grok in Logstash config file looks like the one below:
filter { if [type] == "apache" { grok { match => { "message" => "%{IPORHOST:remote_ip} - - \[%{HTTPDATE:access_time}\] \"%{WORD:http_method} / HTTP/%{NUMBER:http_version}\" %{NUMBER:response_code} %{NUMBER:body_sent_bytes} %{GREEDYDATA:msg}" } } } }
I have given up adding kv filter or anything else since I don't know anymore if:
- kv filter goes under the same filter that grok does
- anything else is needed that kv recognizes all the keys and values in grok pattern
I also don't understand very well how does Logstsh recognize the log event from above, my beginner's conclusion is that it comes in plain format and not in json. If I add kv filter as a standalone below the one where grok is then Kibana picks up IP of the host as the key and everything else as the value and this is where my struggle of misunderstanding begins.
If anyone would be so kind telling me what am I doing wrong and showing me:
- simple example how to do a proper syntax inside logstash config so when I open Kibana I get:
access_time: 28th of January 2019
remote_ip: 193.74.34.5
instead of message: Entire log event as is
or
access_time:%{[doc][access_time]}
Not to forget I am using filebeat 6.5.4 as input, elasticsearch:9200 and rubydebug codec as output