在elasticsearch模板中创建geoip字段
Create geoip field in elasticsearch template
我正在使用 logstash
的 geoip
插件来获取有关主机的地理信息。
我正在使用
geoip {
source => "dst"
}
这似乎有效,但在我的 elasticsearch
文档中创建了以下两个字段
如何将它们连接到 geoip
条目中?
类似于复合 json 对象的东西:
"geoip" : {
"properties" : {
"latitude" : { "type" : "half_float" },
"longitude" : { "type" : "half_float" }
}
}
您需要在索引模板中创建以下字段:
{
"properties": {
...
"geoip": {
"type": "object",
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
我正在使用 logstash
的 geoip
插件来获取有关主机的地理信息。
我正在使用
geoip {
source => "dst"
}
这似乎有效,但在我的 elasticsearch
文档中创建了以下两个字段
如何将它们连接到 geoip
条目中?
类似于复合 json 对象的东西:
"geoip" : {
"properties" : {
"latitude" : { "type" : "half_float" },
"longitude" : { "type" : "half_float" }
}
}
您需要在索引模板中创建以下字段:
{
"properties": {
...
"geoip": {
"type": "object",
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}