All Apps and Add-ons

Getting distance from multiple points

Justinboucher0
Path Finder

I need to find the distance from every point in a lookup from an event that has lat and long. I'm using the haversine app to calculate distance, and my current query is (sanitized):

| inputlookup keylocations | appendcols [search index="{my_sourcetype}" country="us" sourcetype="confirmed" providence_state="{some_location}"] | haversine originField=location_origin units=mi outputField=dist lat lon

Currently, haversine is only providing the distance to the first item in the lookup. How do I get the query to provide the distance to all points of interest (POI)? Ultimately, I need to find the closest POI to the event; however, the data feed is from an external source and they don't normalize their providence_state information so I can't use matching in the lookup.

Here is my csv file (sanitized):

location_name;location_origin;location_state
POI1;12.3456,-12.3456;WA
POI2;12.3456,-12.3456;D.C.

and finally what my event looks like (also sanitized):

_time;providence_state;country;lat;lon;value
2020-03-12 08:26:49.528380;New Castle, DE;US;39.5393;-75.6674;1

If this can't be done in haversine, then can someone please help me find a better solution? Thanks in advance.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.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 ...