<?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 do I filter out countries when using geostats? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364580#M66412</link>
    <description>&lt;P&gt;You've already filtered the countries before geostats, so what's the purpose of filtering again? &lt;/P&gt;

&lt;P&gt;The thing is after geostats command, there is no field called Country, so you can't filter it after geostats. With geostats, each Country value will become a field in itself (your output will have fields geobin, latitude, longitude and one column for each Country). So, if you want to show data only for a specific country you'd need to use table or fields command. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   action=allowed | stats count by src_ip |iplocation src_ip | where Country != "United States"|geostats latfield=lat longfield=lon count by Country | table geobin, latitude, longitude, EnterCountryNameThatYouWantToShow
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action=allowed | stats count by src_ip |iplocation src_ip | where Country != "United States"|geostats latfield=lat longfield=lon count by Country | fields -  EnterCountryNameThatYouDon'tWantToShow
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Mar 2017 15:19:01 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-03-16T15:19:01Z</dc:date>
    <item>
      <title>How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364575#M66407</link>
      <description>&lt;P&gt;When I run this line I get the results mapped on the cluster map, but I want to filter out the US.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action=allowed | stats count by src_ip |iplocation src_ip |geostats latfield=lat longfield=lon count by Country 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried using the where clause below but it will not work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;where Country != "United States"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 14:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364575#M66407</guid>
      <dc:creator>jsisko1873</dc:creator>
      <dc:date>2017-03-16T14:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364576#M66408</link>
      <description>&lt;P&gt;Move the where clause to just after iplocation and before geostats command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action=allowed | stats count by src_ip |iplocation src_ip | where Country != "United States"|geostats latfield=lat longfield=lon count by Country
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 14:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364576#M66408</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-16T14:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364577#M66409</link>
      <description>&lt;P&gt;So I've tried putting it where you suggested and at the end. When I have it in the middle, I'll get events but I won't get statistics or the visualization option which I would like to have. Do you have any other ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 14:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364577#M66409</guid>
      <dc:creator>jsisko1873</dc:creator>
      <dc:date>2017-03-16T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364578#M66410</link>
      <description>&lt;P&gt;So, when you just run below, you can see some results in statistics tab, but when you add the geostats you don't get anything?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action=allowed | stats count by src_ip |iplocation src_ip | where Country != "United States"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 14:42:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364578#M66410</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-16T14:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364579#M66411</link>
      <description>&lt;P&gt;Correct. When I run what you posted (and actually its action=blocked, no difference though) I will get results, but as soon as I try to add geostats I can't find a way to filter countries. And that's why I'm not sure if its a placement thing unto where it goes, of if I should be using a different command to filter my results.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:04:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364579#M66411</guid>
      <dc:creator>jsisko1873</dc:creator>
      <dc:date>2017-03-16T15:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364580#M66412</link>
      <description>&lt;P&gt;You've already filtered the countries before geostats, so what's the purpose of filtering again? &lt;/P&gt;

&lt;P&gt;The thing is after geostats command, there is no field called Country, so you can't filter it after geostats. With geostats, each Country value will become a field in itself (your output will have fields geobin, latitude, longitude and one column for each Country). So, if you want to show data only for a specific country you'd need to use table or fields command. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   action=allowed | stats count by src_ip |iplocation src_ip | where Country != "United States"|geostats latfield=lat longfield=lon count by Country | table geobin, latitude, longitude, EnterCountryNameThatYouWantToShow
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action=allowed | stats count by src_ip |iplocation src_ip | where Country != "United States"|geostats latfield=lat longfield=lon count by Country | fields -  EnterCountryNameThatYouDon'tWantToShow
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:19:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364580#M66412</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-16T15:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364581#M66413</link>
      <description>&lt;P&gt;Perfect, thank you! The second block was what I wanted. Much appreciated! If I may ask one more quick question since you've been so helpful. I'm trying to rename a result in a field (There are only two results). I was trying to use the eval command to do that and haven't gotten it to work.&lt;BR /&gt;
For the firewall there is two rules for the "rule" field: out_to_in and in_to_out&lt;/P&gt;

&lt;P&gt;How do I need to change the eval or should I use something else?&lt;/P&gt;

&lt;P&gt;eval rule=case(rule==out_to_in,"Layer 3 Core access in",rule==in_to_out,"Subnet out to Layer 3 Core")&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364581#M66413</guid>
      <dc:creator>jsisko1873</dc:creator>
      <dc:date>2020-09-29T13:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364582#M66414</link>
      <description>&lt;P&gt;Do you get two rows one column or one row two columns, when you look at result in statistics tab?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:49:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364582#M66414</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-16T15:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364583#M66415</link>
      <description>&lt;P&gt;Rule and count are the columns, and then I have two rows, one for each rule.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364583#M66415</guid>
      <dc:creator>jsisko1873</dc:creator>
      <dc:date>2017-03-16T16:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364584#M66416</link>
      <description>&lt;P&gt;Then the eval you had should work. Just need to enclose value of the rules in double quotes.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval rule=case(rule=="out_to_in","Layer 3 Core access in",rule=="in_to_out","Subnet out to Layer 3 Core")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:08:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364584#M66416</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-16T16:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter out countries when using geostats?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364585#M66417</link>
      <description>&lt;P&gt;@jsisko1873 - Did the answer provided by somesoni2 help provide a working solution to your original question? If yes, please don't forget to resolve this post by clicking "Accept". If no, please leave a comment with more feedback. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 00:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-filter-out-countries-when-using-geostats/m-p/364585#M66417</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-03-17T00:43:29Z</dc:date>
    </item>
  </channel>
</rss>

