<?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: How to specify the range of longitude and latitude in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744644#M241291</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309290"&gt;@Zhangyy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could try the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| iplocation yourIPField
| where abs(lon - 0.89) &amp;lt;= (100/111) AND abs(lat - 0.91) &amp;lt;= (100/111) &lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;This checks if a point with coordinates (&lt;/SPAN&gt;lon&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;lat&lt;SPAN&gt;) is within a rectangular area centered at (0.89, 0.91) with a "radius" of approximately 0.9009 degrees in both the longitude and latitude directions. This rectangle is approximately 100 kilometers wide and 100 kilometers tall, assuming a rough conversion of 1 degree of latitude to 111 kilometers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Apr 2025 07:17:42 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-04-22T07:17:42Z</dc:date>
    <item>
      <title>How to specify the range of longitude and latitude</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744623#M241287</link>
      <description>&lt;P&gt;Use iplocation or geostats to display within a range of 100 kilometers (with longitude of 0.89 degrees and latitude of 0.91 degrees) which regions' people have logged in, the login time, IP address, and the login method.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 02:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744623#M241287</guid>
      <dc:creator>Zhangyy</dc:creator>
      <dc:date>2025-04-22T02:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify the range of longitude and latitude</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744636#M241288</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309290"&gt;@Zhangyy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;latitude and longitude are numbers, so you can use the greater than (&amp;gt;) and less than (&amp;lt;) operators in your searches.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 06:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744636#M241288</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-04-22T06:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify the range of longitude and latitude</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744637#M241289</link>
      <description>&lt;P&gt;Not entirely sure what you're trying to do, but this is a macro for the haversine formula&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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_rlon, hv_rlon1, hv_a, hv_c&lt;/LI-CODE&gt;&lt;P&gt;Set it up to take 4 parameters and these are the named params&lt;/P&gt;&lt;P&gt;source_lat, source_lon, dest_lat, dest_lon&lt;/P&gt;&lt;P&gt;Then you can just use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`haversine(a_lat, a_lon, b_lat, b_lon)`&lt;/LI-CODE&gt;&lt;P&gt;to get the distance between two points&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 06:58:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744637#M241289</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-04-22T06:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify the range of longitude and latitude</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744644#M241291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309290"&gt;@Zhangyy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could try the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| iplocation yourIPField
| where abs(lon - 0.89) &amp;lt;= (100/111) AND abs(lat - 0.91) &amp;lt;= (100/111) &lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;This checks if a point with coordinates (&lt;/SPAN&gt;lon&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;lat&lt;SPAN&gt;) is within a rectangular area centered at (0.89, 0.91) with a "radius" of approximately 0.9009 degrees in both the longitude and latitude directions. This rectangle is approximately 100 kilometers wide and 100 kilometers tall, assuming a rough conversion of 1 degree of latitude to 111 kilometers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 07:17:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744644#M241291</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-22T07:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify the range of longitude and latitude</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744650#M241292</link>
      <description>&lt;P&gt;Thank you all for your timely reply. Sorry, it might be difficult to understand because the scope was not specified specifically&lt;/P&gt;&lt;P&gt;May I ask how to write SPL within the following range?&lt;/P&gt;&lt;P&gt;Latitude: From 35.5 degrees north latitude to 36.0 degrees north latitude&lt;/P&gt;&lt;P&gt;Longitude: From 139.5 degrees east longitude to 140.0 degrees&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote some content but an error occurred&lt;BR /&gt;index=xxxxx&lt;BR /&gt;| table FROM_IP&lt;BR /&gt;| iplocation FROM_IP&lt;BR /&gt;| where latitude &amp;gt;= 35.5 AND latitude &amp;lt;= 36.0&lt;BR /&gt;| where longitude &amp;gt;= 139.5 AND longitude &amp;lt;= 140&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 08:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744650#M241292</guid>
      <dc:creator>Zhangyy</dc:creator>
      <dc:date>2025-04-22T08:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify the range of longitude and latitude</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744660#M241293</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309290"&gt;@Zhangyy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;try without dots and use quotes.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 09:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744660#M241293</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-04-22T09:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify the range of longitude and latitude</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744664#M241295</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309290"&gt;@Zhangyy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should give you approx 25km in each direction as you've explaine:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where lat&amp;gt;=35.5 AND lat&amp;lt;=36.0 AND lon&amp;gt;=139.5 AND lon&amp;lt;=140.0&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 09:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-the-range-of-longitude-and-latitude/m-p/744664#M241295</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-22T09:29:49Z</dc:date>
    </item>
  </channel>
</rss>

