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
Legend

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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...