Skip to content

Instantly share code, notes, and snippets.

@ouychai
Created July 22, 2015 09:12
Show Gist options
  • Save ouychai/8a163a6eb3c3401573b5 to your computer and use it in GitHub Desktop.
Save ouychai/8a163a6eb3c3401573b5 to your computer and use it in GitHub Desktop.
Logstash config for reading access log file to show on kibana.
input {
file {
path => "/root/access.log"
start_position => beginning
}
}
filter {
if [path] =~ "access" {
mutate { replace => { "type" => "apache_access" } }
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
}
date {
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
}
}
output {
elasticsearch {
host => localhost
}
stdout { codec => rubydebug }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment