如何解决带有geoip过滤器的Logstash influxdb输出
我正在尝试使用logstash geoip过滤器通过InfluxDB输出插件将有关IP地址位置的数据发送到InfluxDB。
我的logstash conf文件是:
input {
file {
path => "/root/geoip_test.txt"
start_position => "beginning"
}
}
filter {
geoip {
source => "message"
fields => ["latitude","longitude"]
}
}
output {
stdout {codec => rubydebug}
influxdb {
host => "localhost"
port => 8086
db => "metrics"
measurement => "geoip_test"
codec => "json"
use_event_fields_for_data_points => true
}
}
geoip_test.txt文件仅包含一个IP地址:
14.143.35.10
我收到错误的输出是:
[2020-09-07T12:26:26,696][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
{
"geoip" => {
"latitude" => 12.9771,"longitude" => 77.5871
},"message" => "14.143.35.10","path" => "/root/geoip_test.txt","@timestamp" => 2020-09-07T10:26:33.963Z,"host" => "test","@version" => "1"
}
[2020-09-07T12:26:34,942][WARN ][logstash.outputs.influxdb][main][941178b6897abb80f9a5f7654e5e62ba752d5e20b68781bc62b466e489c2ce56] Non recoverable exception while writing to InfluxDB {:exception=>#<InfluxDB::Error: {"error":"unable to parse 'geoip_test,host=test geoip={\"latitude\"=\u003e12.9771,\"longitude\"=\u003e77.5871},path=\"/root/geoip_test.txt\" 1599474393963': invalid boolean"}
>}
我认为geoip过滤器会生成一些InfluxDB无法使用的布尔字段。
有人知道该怎么做吗?是否可以通过某种方式设置geoip过滤器,以便除了lon和lat字段之外什么都不会生成?
我们非常感谢您的帮助!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。