Logstash Conf file (geo location) - coordinates points always to the center of the Kibana tile map

Hi,
I´m having some trouble configuring the logstash conf file with geo location. I have in my mapping:

"cpe_location" : {
"properties" : {
"location" : { "type" : "geo_point" }
}
}

And I try in the filter part:

mutate {
add_filed => { "location" => "lat,lon" }
}

or

mutate {
add_filed => { "[cpe_location][location]" => lat }
add_filed => { "[cpe_location][location]" => lon }
}

I try both ways as strings or convert to float, but none of them work. The geo location points to the center of the kibana tile map.

Thanks,

Neither of those mutate's look correct, the first one won't work as you aren't referring to the fields correctly, the second one will just overwrite the location (and you aren't referencing the fields right either).

Try something like this, just adapt to your fields;

  mutate {
    add_field => {
      "coords" => "%{LATITUDE}"
      "tmplat" => "%{LONGITUDE}"
    }
  }
  mutate {
    merge => ["coords", "tmplat"]
  }
  mutate {
    convert => [ "coords", "float" ]
    remove_field => [ "tmplat", "LONGITUDE", "LATITUDE" ]
  }

Thanks mate! I have another doubt. According to your example, what is the correct way to add the coords values to the geo_point field?

mutate {
add_field => { "[cpe_location][location]" => "coords" }
}

or

mutate {
add_field => { "location" => "coords" }
}

Since my geo_point field mapping is:

"mappings" : {
"cpe_location" : {
"properties" : {
"location" : {
"type" : "geo_point"
}
}
}
}

Thanks.