我有点怀疑你在刷屏

logstash怎么把csv文件中的x列和y列编程geo_shape的point导入es集群中

Logstash | 作者 zhangleikxyt | 发布于2018年10月25日 | | 阅读数:3312

最近开始研究elasticsearch例如添加geo_hash类型的坐标是这样的

filter { 
    mutate { 
        add_field => {"location" => "%{y},%{x}"}  --把x,y变为location属性,类型为geohash
remove_field => ["@version","@timestamp","qsdwmc","gldwmc","bz","sjly","rksj","guid","clsj"," czsj","x","y","mjzrq","gxsj"]
    } 
}
 
但是我看了官网上的例子:
 PUT /example
{
    "mappings": {
        "doc": {
            "properties": {
                "location": {
                    "type": "geo_shape"
                }
            }
        }
    }
}
POST /example/doc?refresh
{
    "name": "Wind & Wetter, Berlin, Germany",
    "location": {
        "type": "point",
        "coordinates": [13.400544, 52.530286]
    }
}
 
请问各位大佬通过logstash怎么添加这样子的location的属性,type为point,然后还有个coordinates数组

[尊重社区原创,转载请保留或注明出处]
本文地址:http://elasticsearch.cn/article/1001


0 个评论

要回复文章请先登录注册