Skip to content

Instantly share code, notes, and snippets.

@lanyonm
Created November 28, 2013 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lanyonm/7697747 to your computer and use it in GitHub Desktop.
Save lanyonm/7697747 to your computer and use it in GitHub Desktop.
Logstash configuration file
input {
file {
type => "nginx-access"
path => ["/var/log/nginx/access.log"]
}
}
filter {
if [type] == "nginx-access" {
grok {
# https://github.com/logstash/logstash/tree/master/patterns/grok-patterns
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
}
}
output {
statsd {
host => "localhost"
port => 8125
increment => "%{host}.nginx.response.%{response}"
}
elasticsearch {
embedded => true
}
# will log debug to the stdout
#stdout { codec => rubydebug }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment