【问题标题】:Convert lat and lon to geoshape point in logstash conf?在logstash conf中将lat和lon转换为geoshape点?
【发布时间】:2017-05-23 10:35:05
【问题描述】:

如何在输出到 elasticsearch 之前存储输入值(例如 lat 和 lon)以创建 geoshape 点 例子 需要输出到elasticsearch “地点”: { “类型”:“点”, “坐标”:[-84.636,33.33] } 为了生成上面的代码,应该在 logstash conf 文件中添加什么过滤器?

【问题讨论】:

    标签: logstash


    【解决方案1】:

    经过长时间的搜索,伙计们得到了答案。就像这样 如果您想将 lat lon 存储到已经具有映射的 elasticsearch 中

    "location": {
                "type": "geo_shape"
              }
    

    在您的logstash 中的conf 文件中 您将不得不使用过滤器 mutate

    mutate {
         add_field => { "[location][type]" => "point"
                        "[location][coordinates]" => ["%{LocationDataLng}",
                        "%{LocationDataLat}"]
         }
       }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-14
      • 2014-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-31
      相关资源
      最近更新 更多