logstash配置ip库及添加过滤
地址库下载地址:curl -O "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"
默认安装位置下:/etc/logstash/conf.d/filebeat.conf
添加filter
filter { if [fields][log_source] == "%{[fields][log_source]}" { #这里用的是变量,注意index是用logstash开头的,不然kibana那边添加会报错。 geoip { source => "remote_addr" target => "geoip" database => "/etc/logstash/GeoLite2-City.mmdb" add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ] add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ] } mutate { convert => [ "[geoip][coordinates]", "float"] } } }
kibana添加Coordinate Map
参考文档:https://blog.csdn.net/yanggd1987/article/details/50469113
添加报错:No Compatible Fields: The "ldjly_hnyoulu_com_nginx_access_log-*" index pattern does not contain any of the following field types: geo_point
解决方法: index名字改成以logstash-
开头就可以了。
原文链接:kibana nginx访问地址在Visualize Coordinate Map中显示热图,转载请注明来源!