【问题标题】:Using geopoint on Elasticsearch from Logstash从 Logstash 在 Elasticsearch 上使用 geopoint
【发布时间】:2019-04-21 13:29:46
【问题描述】:

我想在 docker 的 elk 堆栈中使用 geoip。 根据这个文档,我添加了配置

https://www.elastic.co/blog/geoip-in-the-elastic-stack

这是我的logstash.conf

input {
  beats {
    port => 5044
  }
}

filter {
  grok {
    match => { "message" => "%{COMBINEDAPACHELOG}" }
  }
  geoip {
    source => "clientip"
  }
}

output {
  elasticsearch {
    hosts => "elasticsearch:9200"
    manage_template => false
    index => "logstash-%{+YYYY.MM.dd}"
  }
}

我知道我应该在某个地方添加这个 json。但我不知道我应该在哪里做这个?

"geoip"  : {
  "dynamic": true,
  "properties" : {
    "ip": { "type": "ip" },
    "location" : { "type" : "geo_point" },
    "latitude" : { "type" : "half_float" },
    "longitude" : { "type" : "half_float" }
  }
}

【问题讨论】:

    标签: elasticsearch logstash kibana geoip


    【解决方案1】:

    您的 logstash 管道很好。您尝试添加的 json 是由 logstash 自动生成的映射。

    考虑到您在 Elasticsearch 集群中使用 Kibana:

    go to management -> index patern -> Create Index Pattern -> type "logstash-*" or a name that fits your need with this index -> select 
    timestamp and hit "create index pattern".
    

    如果在此步骤中您无法可视化 geoip 数据,则可能是您数据中的 IP 在公共区域中不相关。 您可以在这里尝试您的 IP:https://www.maxmind.com/en/geoip-demo

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-20
      • 2012-08-31
      • 2017-11-21
      • 2021-07-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多