logstash插件
codec 插件 goeip插件
input {
file {
path => ["/data/nginx/logs/access.log"]
type =>"type"
start_position => "end"
codec => json
}
}
filter {
geoip {
source => "client"
fields => ["ip","city_name","country_name","location"]
}
}
output {
elasticsearch {
hosts => "127.0.0.1:9200"
index => "logstash-%{+YYYY.MM.dd}"
}
}