Ok Please pardon me for asking same question regarding geo_point. I have done tons of reading in this forum and have tried everything i can think of after reading but i just cant find a solution to my issue.
So here it is.
I am using file beat to ingest IBM HTTP server to Logstash. Logstash config has following filter
filter {
grok {
match => { "message" => '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} [%{HTTPDATE:timestamp}] %{WORD:verb} %{URIPATHPARAM:request} HTTP/%{NUMBER:httpversion} %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{NUMBER:responsetime} "%{DATA:referrer}" "%{DATA:agent}"' }
remove_field => [ "message" ]
}
geoip {
source => "clientip"
target => "geoip"
add_tag => [ "webserver-geoip" ]
}
if "_grokparsefailure" in [tags] {
drop { }
}
date {
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
remove_field => [ "timestamp" ]
}
mutate {
convert => {
"bytes" => "integer"
"response" => "integer"
"responsetime" => "float"
}
}
}
output {
elasticsearch {
hosts => [ "http://xx.xx.xx.xx:xxxxx" ]
template => "/mytemplate/template.json"
template_overwrite => true
index => "mywebservers-%{+YYYY.MM.dd}"
}
}
Here is my template.json
{
"template": "logstash-",
"settings": {"index.refresh_interval": "-1"},
"mappings": {
"default": {
"_all": {"enabled": false},
"date_detection": false,
"dynamic_templates": [
{"string_fields": {
"match": "",
"match_mapping_type": "string",
"mapping": {"type": "keyword"}
}}
],
"properties": {
"@timestamp": {"type": "date", "format": "dateOptionalTime"},
"agent": {"type": "text", "fields": {"raw": {"type": "keyword"}}},
"referrer": {"type": "text", "fields": {"raw": {"type": "keyword"}}},
"request": {"type": "text", "fields": {"raw": {"type": "keyword"}}},
"host": {"type": "keyword"},
"httpversion": {"type": "keyword"},
"user": {"type": "keyword"},
"operation": {"type": "keyword"},
"bytes": {"type": "long"},
"response": {"type": "short"},
"responsetime":{"type":"long" },
"clientip": {"type": "ip"},
"geoip" : {
"dynamic": true,
"properties" : {
"ip": { "type": "ip" },
"location" : { "type" : "geo_point" },
"latitude" : { "type" : "float" },
"longitude" : { "type" : "float" }
}
}
}
}
}
}
I am able to see all documents which has geo ip related details populated. Enitre json record has all geo related values populated. But there is no geo_point. My template.json is taking care of it but in visualization when i try to create coordinated map and select geo hash it gives me this error.
No Compatible Fields: The "mywebservers*" index pattern does not contain any of the following field types: geo_point
have i missed something ? is it very simple solution where in template.json "template": "logstash-", should be mywebservers ?
thanks
Raj