Following the request:
{
"docvalue_fields": [
"geolocation"
],
"size": 10000,
"_source": false,
"stored_fields": [
"geolocation"
],
"script_fields": {},
"query": {
"bool": {
"must": [],
"filter": [
{
"range": {
"@timestamp": {
"gte": "2020-04-07T13:11:53.117Z",
"lte": "2020-04-09T13:11:53.118Z",
"format": "strict_date_optional_time"
}
}
}
],
"should": [],
"must_not": []
}
}
}
The index mapping is the following:
{
"mapping": {
"_doc": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Airport_ID": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Altitude": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"City": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Country": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"DST": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"IATA": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"ICAO": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Latitude": {
"type": "float"
},
"Longitude": {
"type": "float"
},
"Name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Source": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Timezone": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"database_time_zone": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"geoLocation": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"geolocation": {
"type": "geo_point"
},
"host": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"message": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"tags": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
Whenever I am loading them I start logstash like this: /usr/share/logstash/bin/logstash -f ./logstash_geolocation.conf
My Conf file is the following:
input {
stdin { }
}
filter {
csv {
separator => ","
columns => ["Airport_ID","Name","City","Country","IATA","ICAO","Latitude","Longitude","Altitude","Timezone","DST","database_time_zone","Type","Source"]
}
mutate {convert => ["Airport_ID", "string"] }
mutate {convert => ["Name", "string"] }
mutate {convert => ["City", "string"] }
mutate {convert => ["Country", "string"] }
mutate {convert => ["IATA", "string"] }
mutate {convert => ["ICAO", "string"] }
mutate {convert => ["Latitude", "float"] }
mutate {convert => ["Longitude", "float"] }
mutate {convert => ["Altitude", "string"] }
mutate {convert => ["Timezone", "string"] }
mutate {convert => ["DST", "string"] }
mutate {convert => ["database_time_zone", "string"] }
mutate {convert => ["Type", "string"] }
mutate {convert => ["Source", "string"] }
mutate {
add_field => {
"geoLocation" => "%{Latitude},%{Longitude}"
}
}
}
output {
elasticsearch {
hosts => ["elasticsearch-master.monitoring.svc.cluster.local:9200"]
index => "airportgeolocation"
}
stdout { codec => rubydebug }
}