<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Geographical distance calculation in Splunk Cloud (replacing haversine) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537342#M151900</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;awesome, thank you! I will give it ago and see if it works with our current application. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 04:47:20 GMT</pubDate>
    <dc:creator>rcornett</dc:creator>
    <dc:date>2021-01-27T04:47:20Z</dc:date>
    <item>
      <title>Geographical distance calculation in Splunk Cloud (replacing haversine)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537330#M151891</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are currently migrating from Splunk on-premise to the Cloud. One of the apps we heavily use is&amp;nbsp;haversine to calculate the distance between 2 locations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't been able to find a cloud-ready replacement for this. Just looking for recommendations on an app or solution to be able to do this in the cloud?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 02:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537330#M151891</guid>
      <dc:creator>rcornett</dc:creator>
      <dc:date>2021-01-27T02:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Geographical distance calculation in Splunk Cloud (replacing haversine)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537331#M151892</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184267"&gt;@rcornett&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a haversine macro (from macros.conf)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[haversine(4)]
args = source_lat, source_lon, dest_lat, dest_lon
definition = eval hv_rlat1 = pi()*$dest_lat$/180, hv_rlat2=pi()*$source_lat$/180, hv_rlat = pi()*($source_lat$-$dest_lat$)/180, hv_rlon= pi()*($source_lon$-$dest_lon$)/180 \
| eval hv_a = sin(hv_rlat/2) * sin(hv_rlat/2) + cos(hv_rlat1) * cos(hv_rlat2) * sin(hv_rlon/2) * sin(hv_rlon/2) \
| eval hv_c = 2 * atan2(sqrt(hv_a), sqrt(1-hv_a)) \
| eval distance = round(6371 * hv_c * 1000,0)\
| fields - hv_rlat, hv_rlat1, hv_rlat2, hv_rlon, hv_rlon1, hv_a, hv_c
iseval = 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Here's the distance from Sydney to San Francisco&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval source_lat=-33.8688, source_lon=151.2093, dest_lat=37.7749, dest_lon=-122.4194
| `haversine(source_lat, source_lon, dest_lat, dest_lon)`
| eval distance_in_km=distance/1000
| table distance_in_km&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 03:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537331#M151892</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-01-27T03:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Geographical distance calculation in Splunk Cloud (replacing haversine)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537342#M151900</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;awesome, thank you! I will give it ago and see if it works with our current application. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 04:47:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537342#M151900</guid>
      <dc:creator>rcornett</dc:creator>
      <dc:date>2021-01-27T04:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Geographical distance calculation in Splunk Cloud (replacing haversine)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537346#M151902</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184267"&gt;@rcornett&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it works for you, please remember to mark is as the solution, so others can make use of it&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 05:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Geographical-distance-calculation-in-Splunk-Cloud-replacing/m-p/537346#M151902</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-01-27T05:23:38Z</dc:date>
    </item>
  </channel>
</rss>

