I have a nested file each document is like the following (contains a field "gateways" contains diffents number of gateways each one contains a latitude and longitude)
{
field1: "aa",
field2:"bb",
"gateways"[
{antennaLatitude:1222, antennaLongitude:1555},
{antennaLatitude:222, antennaLongitude:444}
]
}
First step I set my template which is like this
> {
"template" : "logstash-*", "version" : 50001, "settings" : { "index.refresh_interval" : "5s", "index.mapping.ignore_malformed": true }, "mappings" : { "_default_" : { "_all" : {"enabled" : true, "norms" : false}, "dynamic_templates" : [ { "message_field" : { "path_match" : "message", "match_mapping_type" : "string", "mapping" : { "type" : "text", "norms" : false } } }, { "string_fields" : { "match" : "*", "match_mapping_type" : "string", "mapping" : { "type" : "text", "norms" : false, "fields" : { "keyword" : { "type": "keyword", "ignore_above": 256 } } } } } ], "properties" : { "@timestamp": { "type": "date", "include_in_all": false }, "@version": { "type": "keyword", "include_in_all": false }, "geoip" : { "type" : "geo_point" }, "geoip_Dev": { "type" : "geo_point" }, "geoip_gwy": { "type" : "geo_point" }, "gtwys":{ "type": "nested", "properties": { "antennaLatitude":{"type":"keyword"}, "antennaLongitude":{"type":"keyword"}, "position": {"type": "geo_point"} } } } } } }
But I dont know how to index these nested json in logstash to correspond my template:
to produce 2 geo_point positions ?