<?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 write a stats search on syslog data to get a report of all country names that are blocked? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150269#M42099</link>
    <description>&lt;P&gt;Or you extract the ÌP&lt;CODE&gt;as field and use the IP field in the&lt;/CODE&gt;|iplocation` command &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Iplocation"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Iplocation&lt;/A&gt; which will give some more fields that you can use for some fancy Google Maps dashboards &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Oct 2014 06:05:01 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-10-03T06:05:01Z</dc:date>
    <item>
      <title>How to write a stats search on syslog data to get a report of all country names that are blocked?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150267#M42097</link>
      <description>&lt;P&gt;I'm very new to splunk, and just started using it. Please forgive my ignorance. &lt;/P&gt;

&lt;P&gt;I'm dumping my syslog from a sonicwall.  They look something like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Oct  2 16:12:06 10.89.55.40 id=firewall sn=xxxxxx  time="2014-10-02 16:12:06" fw= pri=1 c=0 m=1198 msg="Initiator from country blocked: Initiator IP:209.172.40.87 Country Name:China" note="Initiator IP:209.172.40.87 Country Name:China" sess=None n=176896 src=209.172.40.87:43642:X1:smtp-newslist-87.coremotivesmarketing.com dst=
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to get a report that would list all the country names that are blocked and give me totals/statistics.  &lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2014 21:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150267#M42097</guid>
      <dc:creator>smarra</dc:creator>
      <dc:date>2014-10-02T21:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a stats search on syslog data to get a report of all country names that are blocked?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150268#M42098</link>
      <description>&lt;P&gt;Hi smarra,&lt;/P&gt;

&lt;P&gt;first use some regex to get the Country name as field like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "Country\sName\:(?&amp;lt;Country&amp;gt;\w+)\"" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then use some &lt;CODE&gt;stats&lt;/CODE&gt;on this new field like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by Country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, by using something like this search command, you will get a statistical count of all blocked Countries:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=syslog id=firewall msg="*blocked*" | rex "Country\sName\:(?&amp;lt;Country&amp;gt;\w+)\"" | stats count by Country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if this matches your needs, you can create this as &lt;CODE&gt;search time field extraction&lt;/CODE&gt;. In this case the field will be available without the use of the regex.&lt;/P&gt;

&lt;P&gt;hope this helps to get you started ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2014 06:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150268#M42098</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-10-03T06:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a stats search on syslog data to get a report of all country names that are blocked?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150269#M42099</link>
      <description>&lt;P&gt;Or you extract the ÌP&lt;CODE&gt;as field and use the IP field in the&lt;/CODE&gt;|iplocation` command &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Iplocation"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Iplocation&lt;/A&gt; which will give some more fields that you can use for some fancy Google Maps dashboards &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2014 06:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150269#M42099</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-10-03T06:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a stats search on syslog data to get a report of all country names that are blocked?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150270#M42100</link>
      <description>&lt;P&gt;Perfect Thank you for your help! I'm terrible when it comes to this kind of stuff!&lt;/P&gt;

&lt;P&gt;I like fancy google maps stuff.  Thanks for the link.  Hopefully I can make head/tails of it!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2014 13:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150270#M42100</guid>
      <dc:creator>smarra</dc:creator>
      <dc:date>2014-10-03T13:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a stats search on syslog data to get a report of all country names that are blocked?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150271#M42101</link>
      <description>&lt;P&gt;you're welcome. Please mark this as answered, thx &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2014 13:32:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-stats-search-on-syslog-data-to-get-a-report-of/m-p/150271#M42101</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-10-03T13:32:52Z</dc:date>
    </item>
  </channel>
</rss>

