Py学习  »  Elasticsearch

在ElasticSearch模板中创建geoip字段

pkaramol • 5 年前 • 1094 次点击  

我正在使用 geoip 插件 logstash 获取主机的地理信息。

我正在使用

          geoip {
            source => "dst"
          }

这似乎有效,但在我的 elasticsearch 文件

enter image description here

如何将这些连接到 地磁 进入?

类似于复合JSON对象,例如:

"geoip"  : {
  "properties" : {
    "latitude" : { "type" : "half_float" },
    "longitude" : { "type" : "half_float" }
  }
}
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/30718
 
1094 次点击  
文章 [ 1 ]  |  最新文章 5 年前
Val
Reply   •   1 楼
Val    5 年前

您需要在索引模板中创建以下字段:

{
  "properties": {
     ...
     "geoip": {
       "type": "object",
       "properties": {
         "location": {
           "type": "geo_point"
         }
       }
     }
  }
}