Skip to content

Instantly share code, notes, and snippets.

@behroozam
Created August 5, 2018 12:49
Show Gist options
  • Save behroozam/f8c4cb8813b799e9b8ef591aa6bf2dc4 to your computer and use it in GitHub Desktop.
Save behroozam/f8c4cb8813b799e9b8ef591aa6bf2dc4 to your computer and use it in GitHub Desktop.
logstash to elasticssearch gelf example
input {
gelf {
port => 12201
type => gelf
}
}
filter {
grok {
match => { "message" => "%{IPORHOST:remote_addr} - %{USERNAME:remote_user} \[%{HTTPDATE:time_local}\] \"%{DATA:request}\" %{INT:status} %{NUMBER:bytes_sent} \"%{DATA:http_referer}\" \"%{DATA:http_user_agent}\"" }
}
geoip {
source => "remote_addr"
}
}
output {
elasticsearch {
index => "yourstack-%{+YYYY.MM.dd}"
hosts => "elasticsearch:9200"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment