最近开始研究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数组
继续阅读 »
最近开始研究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数组
收起阅读 »