Hello,
I am trying to plot a group of store locations on a map, i have zip and lat and long of the store.
version being used is 6.4.2
I am covert the location feild to geo_point using logstash output for elastic and specifying custom template.
My Logstash cofig
input {
file {
path => "/opt/ELK/log_lat.txt"
start_position => "beginning"
sincedb_path => "/dev/null"
tags => ["lati"]
}
}
filter {
if "lati" in [tags]{
csv {
separator => ","
columns => ["ZIP","LAT","LNG"]
}
if [LAT] and [LNG] {
mutate {
add_field => {
"[location][lat]" => "%{LAT}"
"[location][lon]" => "%{LNG}"
}
}
mutate {
convert => {
"[location][lat]" => "float"
"[location][lon]" => "float"
}
}
}
}
}
output {
if "lati" in [tags]{
elasticsearch {
manage_template => "false"
template => "/tmp/template_mapping.json"
hosts => "http://localhost:9200"
index => "xstorelat-index"
}
}
stdout {}
}
My template file
{
"index_patterns": ["xstorelat*"],
"settings": {
"number_of_shards": 1
},
"mappings": {
"_doc": {
"_source": {
"enabled": false
},
"properties": {
"ZIP": {
"type": "text"
},
"location": {
"type": "geo_point"
}
}
}
}
}
there is no error but when the data is in the elasticsearch after the run the location feild does not change to geo_point its still as below.
"location": {
"properties": {
"lat": {
"type": "float"
},
"lon": {
"type": "float"
}
}
}
Please help