Getting Data In

How to use spath and geom search commands to make one field called latlong?

martinstack
New Member

what am I doing wrong here. This isn't returning anything

|inputlookup geo_attr_countries 
| fields country 
| geom geo_countries featureIdField=country 
| spath output=latlong path=type.MultiPolygon.coordinates
0 Karma

DalJeanis
SplunkTrust
SplunkTrust

Your spath command is referring to a field that doesn't exist. Not sure where you got the idea there was a field named that coming out of the geom command.

Look at the output of this...

 | inputlookup geo_attr_countries | head 5
 | fields country 
 | geom geo_countries featureIdField=country 
 | spath input=geom output=lat path=coordinates{0}{0}{0}{0}
 | spath input=geom output=long path=coordinates{0}{0}{0}{1}

This is extracting the first pair of coordinates in the deeply nested array. Not sure whether that one is the one you want or not, but you can try various combinations of numbers in the various {}'s to select out the coordinates you want.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...