Converting Location field into lat and long

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?

Thanks
Gauti

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.

@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?

Thanks
Gauti

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.

hey @fkelbert , sorry for late response,

This is how my document looks like,

<result>
<close_code>Closed/Resolved by Caller</close_code>
<assignment_group>Service Desk</assignment_group>
<description>User can't access email on mail.company.com.</description>
<child_incidents/>
<closed_by>System Administrator</closed_by>
<number>INC0000001</number>
<contact_type>Chat Bot</contact_type>
<urgency>1 - High</urgency>
<sys_created_on>2014-02-19 10:24:13</sys_created_on>
<problem_id>PRB0000007</problem_id>
<caller_id.location.longitude/>
<company/>
<state>Closed</state>
<reassignment_count>1</reassignment_count>
<caller_id.location.latitude/>
<sys_created_by>pat</sys_created_by>
<assigned_to>Charlie Whitherspoon</assigned_to>
<knowledge>false</knowledge>
<severity>1 - High</severity>
<closed_at>2015-07-22 16:10:06</closed_at>
<cmdb_ci>MailServerUS</cmdb_ci>
<impact>1 - High</impact>
<reopen_count/>
<priority>1 - Critical</priority>
<escalation>Normal</escalation>
<resolved_at>2015-10-21 12:56:12</resolved_at>
<location>Oklahoma</location>
<category>Network</category>
</result>

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

Thanks
Gauti

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.

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