Skip to content

Instantly share code, notes, and snippets.

@mdesanti
Created July 18, 2016 15:10
Show Gist options
  • Save mdesanti/dd6f9b6eb744aee6dbb01596d18fb3aa to your computer and use it in GitHub Desktop.
Save mdesanti/dd6f9b6eb744aee6dbb01596d18fb3aa to your computer and use it in GitHub Desktop.
files:
"/etc/logstash/conf.d/rails.conf":
content: |
input {
file {
path => "/var/log/puma/rails_logstasher.log"
type => "rails_logs"
codec => json {
charset => "UTF-8"
}
}
}
filter {
geoip {
source => "ip"
target => "geoip"
database => "/etc/logstash/GeoLiteCity.dat"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
}
output {
elasticsearch {
hosts => 'your-elasticsearch-service-url'
document_id => "%{request_id}"
timeout => 15
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment