<?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: Is it possible to do a CIDR match in a tstats where clause? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252372#M75513</link>
    <description>&lt;P&gt;if you're satisfied of the answer, please, accept the answer.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2016 11:06:50 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2016-09-09T11:06:50Z</dc:date>
    <item>
      <title>Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252370#M75511</link>
      <description>&lt;P&gt;Is it possible to match IP address range in tstats where clause? &lt;/P&gt;

&lt;P&gt;Example: &lt;BR /&gt;
It's possible to do this with search+stats: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test IP="10.1.1.0/25" | stats count by IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But since we have IP extracted at index time, I'd rather take advantage of tstats performance and run something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=test IP="10.1.1.0/25" by IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but that doesn't work as expected - tstats matches any IP as if the filter was IP="*" &lt;BR /&gt;
Ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 22:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252370#M75511</guid>
      <dc:creator>IgorB</dc:creator>
      <dc:date>2016-07-11T22:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252371#M75512</link>
      <description>&lt;P&gt;I think that you already used the tscollect (eg.g. in test_stats) command before use tstats, something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index=test earliest=-30d latest=now | table _time IP field1 field2 field3 ... | tscollect test_stats
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so the command could be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | tstats count FROM tests_stats GROUPBY IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 07:02:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252371#M75512</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-07-12T07:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252372#M75513</link>
      <description>&lt;P&gt;if you're satisfied of the answer, please, accept the answer.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 11:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252372#M75513</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-09-09T11:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252373#M75514</link>
      <description>&lt;P&gt;I downvoted this post because: &lt;BR /&gt;
Sorry, can't accept. your reply doesn't answer my question:&lt;BR /&gt;
1. your assumption that I've used  '| tscollect' is incorrect&lt;BR /&gt;
2. '| tstats ... ' you proposed misses the point of returning only ips in a specific range&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 14:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252373#M75514</guid>
      <dc:creator>IgorB</dc:creator>
      <dc:date>2016-09-12T14:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252374#M75515</link>
      <description>&lt;P&gt;tstats is not CIDR aware for where clauses. Sorry &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252374#M75515</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2016-12-21T15:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252375#M75516</link>
      <description>&lt;P&gt;Actually, natural CIDR filters work in &lt;CODE&gt;tstats&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count FROM datamodel=Network_Traffic WHERE index=* AND All_Traffic.src="10.0.0.0/8"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* AND host="10.0.0.0/8"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This has been in Splunk for a long time, but maybe not always.  It works in all versions of 7.*&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 17:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252375#M75516</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-25T17:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252376#M75517</link>
      <description>&lt;P&gt;Apparently this is no longer true in Splunk v.7.x. &lt;BR /&gt;
Thanks to @woodcock  for pointing this out&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 19:17:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/252376#M75517</guid>
      <dc:creator>IgorB</dc:creator>
      <dc:date>2019-06-25T19:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a CIDR match in a tstats where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/517666#M145583</link>
      <description>&lt;P&gt;Is the negative form suppose to work as well?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;PRE&gt;| tstats count FROM datamodel=Network_Traffic WHERE index=* AND All_Traffic.src!="10.0.0.0/8"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 08:28:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-CIDR-match-in-a-tstats-where-clause/m-p/517666#M145583</guid>
      <dc:creator>astatrial</dc:creator>
      <dc:date>2020-09-03T08:28:58Z</dc:date>
    </item>
  </channel>
</rss>

