Hi team,
I am trying to parse web server logs , i have return configuration file it looks as bellow
input {
file {
path => "/var/log/nginx/access.log"
type => "nginx-access"
sincedb_path => "/var/log/sincedb"
start_position => "beginning"
}
}filter {
if [type] == "nginx-access" {
grok{
match => {
"message" => '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} [%{HTTPDATE:time}] "%{WORD:method} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:status} (?:-|%{NUMBER:bytes}) %{QS:referrer} %{QS:agent} %{NUMBER:responseTime}'
}}
mutate {
convert => { "bytes" => "integer"}
convert => { "status" => "integer"}
convert => { "responseTime" => "float"}
}geoip {
source => "clientip"
}useragent {
source => "agent"
target => "useragent"
}
date {
match => [ "time", "dd/MMM/YYYY:HH:mm:ss Z" ]
locale => en
}
}}
output {
if "_grokparsefailure" not in [tags]
{
elasticsearch {
hosts => ["localhost:9200"]
index => "nginx_log_data"
}
}
stdout { codec => rubydebug }
}
sample logs are :
127.0.0.1 - - [25/Jul/2018:12:14:51 +0530] "GET /favicon.ico HTTP/1.1" 404 324 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0" 0.000 -
what's wrong with my configuration , why it is throwing exception? kindly help me.
when i am trying it manualy means from grok debugger, pattern and input matching perfectly.
