【问题标题】:how to add geo_point type data to elasticsearch from logstash?如何从logstash将geo_point类型数据添加到elasticsearch?
【发布时间】:2015-08-31 21:46:13
【问题描述】:

我想在我的程序中添加一些自定义地理搜索功能(不是 geoip,将 IP 地址转换为坐标)。如何将自定义 lat 和 lng 数据过滤为 elasticsearch geo_type 格式数据,以便在 kibana 平铺地图中可视化?

【问题讨论】:

    标签: elasticsearch filter logstash kibana geo


    【解决方案1】:

    您可能已经发现,有一个(有些笨拙的)解决方案。 基本上,您需要先设置 geo_point 字段的映射,然后才能以这种方式记录数据(我也直接使用 ES python 模块而不是通过 logstash 记录.. 只是为了确定)。

    那么如何设置正确的映射呢?

    1. 确保使用新的 elasticsearch 实例(或至少尚未设置索引和您将使用的类型的映射)

    2. 从感觉运行(或使用适当的 curl 命令)

    PUT <index_name> { "mappings": { "<type_name>": { "properties": { "timestamp": { "type": "date" }, "message": { "type": "string" }, "location": { "type": "geo_point" } <etc.> } } } }

    现在你是金子了,只要确保你的 geo_points 是 ES 除外的格式

    更多关于在此处映射 geo_points 的信息:

    ElasticSearch how to setup geo_point

    这里:

    https://discuss.elastic.co/t/geo-point-logging-from-python-to-elasticsearch/37336

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多