<?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 How can I filter by the first encountered combination of values? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175128#M35167</link>
    <description>&lt;P&gt;I have results in the following form and would like to filter for only those results matching a session_id=x and an object_id=y, or those first encountered in the results. Any ideas?&lt;/P&gt;

&lt;P&gt;Session_Id | Object_Id&lt;BR /&gt;
x | y&lt;BR /&gt;
x | y&lt;BR /&gt;
x | z&lt;BR /&gt;
x | z&lt;BR /&gt;
x | z&lt;BR /&gt;
a | b&lt;BR /&gt;
a | b&lt;BR /&gt;
a | c&lt;/P&gt;

&lt;P&gt;The expected output would be the events outlined in the following table, in which all events matching the first combination of session_id, object_id are allowed, when grouping by session_id.&lt;/P&gt;

&lt;P&gt;Session_Id | Object_Id&lt;BR /&gt;
x | y&lt;BR /&gt;
x | y&lt;BR /&gt;
a | b&lt;BR /&gt;
a | b&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:09:08 GMT</pubDate>
    <dc:creator>rposky</dc:creator>
    <dc:date>2020-09-28T19:09:08Z</dc:date>
    <item>
      <title>How can I filter by the first encountered combination of values?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175128#M35167</link>
      <description>&lt;P&gt;I have results in the following form and would like to filter for only those results matching a session_id=x and an object_id=y, or those first encountered in the results. Any ideas?&lt;/P&gt;

&lt;P&gt;Session_Id | Object_Id&lt;BR /&gt;
x | y&lt;BR /&gt;
x | y&lt;BR /&gt;
x | z&lt;BR /&gt;
x | z&lt;BR /&gt;
x | z&lt;BR /&gt;
a | b&lt;BR /&gt;
a | b&lt;BR /&gt;
a | c&lt;/P&gt;

&lt;P&gt;The expected output would be the events outlined in the following table, in which all events matching the first combination of session_id, object_id are allowed, when grouping by session_id.&lt;/P&gt;

&lt;P&gt;Session_Id | Object_Id&lt;BR /&gt;
x | y&lt;BR /&gt;
x | y&lt;BR /&gt;
a | b&lt;BR /&gt;
a | b&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175128#M35167</guid>
      <dc:creator>rposky</dc:creator>
      <dc:date>2020-09-28T19:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter by the first encountered combination of values?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175129#M35168</link>
      <description>&lt;P&gt;If these are the results, what is the expected output?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 19:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175129#M35168</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-03-11T19:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter by the first encountered combination of values?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175130#M35169</link>
      <description>&lt;P&gt;I have edited the post, hopefully addressing your question.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 19:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175130#M35169</guid>
      <dc:creator>rposky</dc:creator>
      <dc:date>2015-03-11T19:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter by the first encountered combination of values?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175131#M35170</link>
      <description>&lt;P&gt;I hope the last row in expected output is &lt;STRONG&gt;&lt;CODE&gt;a | c&lt;/CODE&gt;&lt;/STRONG&gt;. With that try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your current query giving current result with field Session_Id,  Object_Id | streamstats count as rank by Session_Id | where (Session_Id="x" AND Object_Id="y") OR rank=1 | fields - rank
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Mar 2015 20:30:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175131#M35170</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-03-11T20:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can I filter by the first encountered combination of values?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175132#M35171</link>
      <description>&lt;P&gt;Thank you very much. That has led me in the right direction. I do want to filter out the &lt;EM&gt;a | c&lt;/EM&gt; value, which I've been able to do now by applying stream stats to both fields, and then taking their difference. Any non-zero value would then indicate the items I would like to filter out.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;streamstats count as session_rank by session_id | streamstats count as object_rank by object_id | eval request_rank=(session_rank-object_rank)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Mar 2015 20:53:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-filter-by-the-first-encountered-combination-of-values/m-p/175132#M35171</guid>
      <dc:creator>rposky</dc:creator>
      <dc:date>2015-03-11T20:53:42Z</dc:date>
    </item>
  </channel>
</rss>

