Skip to content

Instantly share code, notes, and snippets.

@zachfi
Created April 1, 2014 02:51
Show Gist options
  • Save zachfi/9906802 to your computer and use it in GitHub Desktop.
Save zachfi/9906802 to your computer and use it in GitHub Desktop.
input {
udp {
port => 9995
codec => netflow
}
}
filter {
geoip {
source => "[netflow][ipv4_src_addr]"
target => geoip
database => "/usr/local/logstash/logstash-1.4.0/vendor/geoip/GeoLiteCity.dat"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
geoip {
source => "[netflow][ipv4_dst_addr]"
target => geoip
database => "/usr/local/logstash/logstash-1.4.0/vendor/geoip/GeoLiteCity.dat"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float" ]
}
}
output {
elasticsearch {
bind_host => "192.168.0.10"
host => "es.domain.com"
protocol => "http"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment