Converting Location field into lat and long

(Gautham) #1

Hi All,

We have a field name "Location" which is getting into elasticsearch as a string value, how can i split this location field into latitude and longitude to visualize it as a coordinate map.

Is there any way to achieve this?


(Florian Kelbert) #2

You probably want to change how you are ingesting data into Elasticsearch. It will make sense to change the field mapping to type geopoint and to index accordingly. In Kibana, visualizations should then work out of the box.

(Gautham) #3

@fkelbert i'm using logstash to fetch data from a rest source, if i directly map the "Location" field as a geopoint it simply does not index the data, as far as i know we can map the location only by lat and long fields.

Do you have any suggestions for achieving this?


(Florian Kelbert) #4

The first thing you will need to do is to change the field mapping in Elasticsearch to geopoint.

You will then need to change your Logstash pipeline to transform your input data from the rest source into the expected format. The documentation I have linked lists several examples that show the required format of the data to be indexed.

Without knowing the structure of your data, it is not possible to advise in more detail.

(Gautham) #5

hey @fkelbert , sorry for late response,

This is how my document looks like,

<close_code>Closed/Resolved by Caller</close_code>
<assignment_group>Service Desk</assignment_group>
<description>User can't access email on</description>
<closed_by>System Administrator</closed_by>
<contact_type>Chat Bot</contact_type>
<urgency>1 - High</urgency>
<sys_created_on>2014-02-19 10:24:13</sys_created_on>
<assigned_to>Charlie Whitherspoon</assigned_to>
<severity>1 - High</severity>
<closed_at>2015-07-22 16:10:06</closed_at>
<impact>1 - High</impact>
<priority>1 - Critical</priority>
<resolved_at>2015-10-21 12:56:12</resolved_at>

That highlighted location field is what i need to show it in maps, how can i achieve this.


(Florian Kelbert) #6

You need some way to convert this information into lat,lon.

This thread discusses the very same topic. I'm afraid you won't be pleased by the answers -- the functionality you are looking for is not available out of the box.

(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.