I'm trying to get an IP field so I can then geoip it. I've looked at the blog posts and other sites, and tried everything, but still no working IP fields. I looked at the internal blog posts, and some seem to minimize the need for a working solution on this. Please let me assure you, and I think you already know this, that getting IP addresses into IP fields (instead of strings) is very important for many of us! There were concerns about performance, but if you could do a mutate / convert on the field, that might minimize the performance issues for the masses, and allow IP fields for those that really need it.
In any case, here's what I'm doing, and I'm hoping someone could advise on why it's not working. I should mention I am doing this work on Windows 10.
From the logstash .conf file (yes, I have custom patterns):
filter {
grok {
match => { "message" => "%{HEADER:header} %{TIMESTAMP_ISO8601:syslog_timestamp} %{IP:h_hostname} %{REALM:h_realm} %{NUMBER:unknown1} %{IDNUM:id}" }
}
kv {}
geoip {
source => "h_hostname"
}
}
output {
elasticsearch { hosts => ["localhost:9200"] template => "C:\logstash\sa_elasticsearch-template.json" template_overwrite => true }
stdout {}
}
From the custom template .json:
"properties" : {
"@timestamp": { "type": "date", "doc_values" : true },
"@version": { "type": "string", "index": "not_analyzed", "doc_values" : true },
"ip": { "type": "ip"},
"geoip" : {
"type" : "object",
"dynamic": true,
"properties" : {
"ip": { "type": "ip", "doc_values" : true },
"location" : { "type" : "geo_point", "doc_values" : true },
"latitude" : { "type" : "float", "doc_values" : true },
"longitude" : { "type" : "float", "doc_values" : true }
}
}
As can be seen, I modified the default template to include an IP definition, but I'm still seeing my IP fields as strings, and not seeing any geoip fields. Any help would be appreciated. Thanks!