<?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: Filter records based on whether any records of a group match a given criteria in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191701#M38169</link>
    <description>&lt;P&gt;What do you think about create a new field for each source ip called Query_only?  The search would filter out any Query_only=False, and then set it to False if the record contains more than a single "Q" and then filters it out.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| while dns_type_ip!=False | if(dns_type!="Q", eval dns_type_ip="False" by src_ip) | while dns_type_ip!=False
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;..or maybe streamstats.. I am not completely clear on how it is used and have only seen it used to evaluate the current record in light of evaluations on a previous record.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:10:05 GMT</pubDate>
    <dc:creator>landen99</dc:creator>
    <dc:date>2020-09-28T16:10:05Z</dc:date>
    <item>
      <title>Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191697#M38165</link>
      <description>&lt;P&gt;In general, I am trying to filter records based on whether any records of a group match a given criteria.&lt;/P&gt;

&lt;P&gt;Specifically, I want to discard all DNS records from any IP where a DNS record is seen with an R in it (to the left of the Q):&lt;BR /&gt;
But records from any IP where  that look like the following to be discarded:&lt;BR /&gt;
3/17/2014 2:00:18 PM 06E4 PACKET  000000000F458210 UDP Rcv xx.yyy.zz.48    1234  R Q [0001   D   NOERROR] A      .server005.mycorp.com.&lt;/P&gt;

&lt;P&gt;I used the field extractor tool to put the R and Q values into the field, dns_type.&lt;/P&gt;

&lt;P&gt;How do I do a search which filters based on whether all records of a group do not contain specified field values?  Will we have to use streamstats or is there an easier way?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2014 20:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191697#M38165</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-17T20:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191698#M38166</link>
      <description>&lt;P&gt;What do you mean by "a group"?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191698#M38166</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-03-18T16:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191699#M38167</link>
      <description>&lt;P&gt;In the dns example, the group is the source ip.  So if a source ip generates dns reply traffic then all dns traffic from that ip should be discarded.  Records of ip addresses without any dns reply traffic would be kept.&lt;/P&gt;

&lt;P&gt;It would probably be more clear to use the word "field" instead of group, but I am grouping these records by source ip in my mind so I am thinking in terms of these source ip groups.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191699#M38167</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-18T16:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191700#M38168</link>
      <description>&lt;P&gt;Without more information about how to define "a group", this is sort of a shot in the dark but -&lt;BR /&gt;&lt;BR /&gt;
Also, I assume that &lt;CODE&gt;dns_type&lt;/CODE&gt; could have "R Q" as a value, and that there is a field named &lt;CODE&gt;ip&lt;/CODE&gt; containing the ip address.&lt;/P&gt;

&lt;P&gt;To simply eliminate events with of the dns_type, you could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere dns_type!="R Q"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But let's assume that you want to eliminate events from any ip that was associated with an event with a &lt;CODE&gt;dns_type&lt;/CODE&gt; of "R Q":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere NOT [ search dns_type="R Q" | dedup ip | fields ip ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should work as long as the number of ip's returned from the subsearch is relatively small. It will not be a particularly fast search, though, as both the subsearch and the use of &lt;CODE&gt;NOT&lt;/CODE&gt; will slow things down.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191700#M38168</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-03-18T16:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191701#M38169</link>
      <description>&lt;P&gt;What do you think about create a new field for each source ip called Query_only?  The search would filter out any Query_only=False, and then set it to False if the record contains more than a single "Q" and then filters it out.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| while dns_type_ip!=False | if(dns_type!="Q", eval dns_type_ip="False" by src_ip) | while dns_type_ip!=False
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;..or maybe streamstats.. I am not completely clear on how it is used and have only seen it used to evaluate the current record in light of evaluations on a previous record.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:10:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191701#M38169</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2020-09-28T16:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191702#M38170</link>
      <description>&lt;P&gt;I would avoid &lt;CODE&gt;streamstats&lt;/CODE&gt; - I don't think it will be particularly helpful here, and it will probably &lt;EM&gt;not&lt;/EM&gt; be faster than a subsearch.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 00:04:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191702#M38170</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-03-19T00:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191703#M38171</link>
      <description>&lt;P&gt;What happens if you do this?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;yoursearchhere NOT [ search dns_type="R Q" | dedup src_ip | fields src_ip ]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 00:06:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191703#M38171</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-03-19T00:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191704#M38172</link>
      <description>&lt;P&gt;I have the field extracted so that dns_type is either R or Q even when there is "R Q" in the text.  The search you suggested works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=dns | mysearch | search NOT [ search dns_type="R" | dedup src_ip | fields src_ip ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I never knew you could bracket a search string under a not.  Thank you.  Why do you have "fields src_ip"?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 13:20:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191704#M38172</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-19T13:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records based on whether any records of a group match a given criteria</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191705#M38173</link>
      <description>&lt;P&gt;The subsearch (which starts with &lt;CODE&gt;[&lt;/CODE&gt; and ends with &lt;CODE&gt;]&lt;/CODE&gt;) returns a set of results. The &lt;EM&gt;only&lt;/EM&gt; thing I want from those results is a list of the &lt;CODE&gt;src_ip&lt;/CODE&gt; values. The &lt;CODE&gt;fields src_ip&lt;/CODE&gt; causes the subsearch to return a list of the &lt;CODE&gt;src_ip&lt;/CODE&gt; values. &lt;/P&gt;

&lt;P&gt;You can actually see the sub-search results if you check out the search job inspector after the search is finished.&lt;/P&gt;

&lt;P&gt;Also, you can probably make your search go even faster if you don't put the pipes in it - they just add extra steps:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=dns mysearch NOT [search .... ]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;should work fine&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 22:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-based-on-whether-any-records-of-a-group-match-a/m-p/191705#M38173</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-03-19T22:59:39Z</dc:date>
    </item>
  </channel>
</rss>

