【发布时间】:2015-11-12 14:15:22
【问题描述】:
我正在尝试使用可以在 Kibana 中可视化的 ELK 堆栈创建 GeoIP 数据。
我最近在 Ubuntu Server 14.04 的虚拟实例上安装了 ELK 堆栈(Elastic Search、Logstash 和 Kibana)。我正在使用 Bro 来捕获日志。
除了 GeoIP(最有趣的功能之一!)之外,在 Kibana 中与捕获、解析和查看日志有关的一切都运行良好。
我的 logstash 配置文件的 GeoIP 部分如下所示;
geoip {
add_tag => [ "geoip" ]
database => "/etc/logstash/GeoLiteCity.dat"
source => "id.orig_h"
target => "geoip"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}"]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float" ]
}
我从the following guide to setup GeoIP with Kibana. 获得了过滤器的那部分,我还看到其他一些地方使用了该过滤器。 我试图简化过滤器(只是源、目标、数据库),但没有成功。
当我对我的索引进行 curl 请求时,尤其是使用 add_tag ["geoip"] 时,它会返回空白数据;
"geoip" : {
"dynamic" : "true",
"properties" : {
"location" : {
"type" : "geo_point"
}
}
最后,这是我直接从 Kibana 中获取的一些经过清理的数据,采用 JSON 格式;
{
"_index": "logstash-2015.11.12",
"_type": "bro-conn_log",
"_id": "*****",
"_score": null,
"_source": {
"message": [
"*****"
],
"@version": "1",
"@timestamp": "2015-11-12T13:43:16.205Z",
"host": "elk",
"path": "/nsm/bro/logs/current/conn.log",
"type": "bro-conn_log",
"ts": "*****",
"uid": "*****",
"id.orig_h": "*****",
"id.orig_p": *****,
"id.resp_h": "*****",
"id.resp_p": *****,
"proto": "*****",
"service": "*****",
"duration": *****,
"orig_bytes": *****,
"resp_bytes": *****,
"conn_state": "*****",
"local_orig": "*****",
"missed_bytes": *****,
"history": "*****",
"orig_pkts": *****,
"orig_ip_bytes": *****,
"resp_pkts": *****,
"resp_ip_bytes": *****,
"tunnel_parents": "*****",
"column21": "(empty)",
"conn_state_full": "*****"
},
"fields": {
"@timestamp": [
1447335796205
]
},
"sort": [
1447335796205
]
}
总结一下:我正在尝试使用 ELK 堆栈获取 GeoIP 数据。尽管遵循指南描述了如何做到这一点,但 GeoIP 字段不会在 Kibana 中显示。任何建议将不胜感激。
【问题讨论】: