<?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: Different Results From Similar Queries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259807#M77878</link>
    <description>&lt;P&gt;Hi thank you for coming back to me with this. If you look at both queries, they both contain the 'dedup' command which is why I'm a little confused as to why their is a difference in the results.&lt;/P&gt;

&lt;P&gt;Kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2016 13:43:07 GMT</pubDate>
    <dc:creator>IRHM73</dc:creator>
    <dc:date>2016-03-23T13:43:07Z</dc:date>
    <item>
      <title>Different Results From Similar Queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259805#M77876</link>
      <description>&lt;P&gt;Hi, I wonder whether someone may be able to help me please with something that I just don't understand.&lt;/P&gt;

&lt;P&gt;I'm using the query below with the date range of 'Yesterday' which returns the figure of &lt;STRONG&gt;2699&lt;/STRONG&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource=preferences auditType=TxSucceeded  | dedup detail.input-ur | search "detail.input-preference-tal"=true |stats count(detail.input-ur) AS "Number of unique URs that opted in"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I then have tried using the following with the same date range:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource=preferences auditType=TxSucceeded  | search "detail.input-preference-tal"=true  | dedup detail.input-ur|stats count(detail.input-ur) AS "Number of unique URs that opted in"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this returns a figure of &lt;STRONG&gt;2703&lt;/STRONG&gt; and I don't understand why.&lt;/P&gt;

&lt;P&gt;Could someone possibly look at this please and explain the logic behind the different values?&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 10:27:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259805#M77876</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-03-23T10:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Different Results From Similar Queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259806#M77877</link>
      <description>&lt;P&gt;it is &lt;CODE&gt;| dedup detail.input-ur&lt;/CODE&gt; command because it  Remove duplicates of results with the same detail.input-ur value.&lt;BR /&gt;
for more information see how to use the dedup command in doc &lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 13:37:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259806#M77877</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2016-03-23T13:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Different Results From Similar Queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259807#M77878</link>
      <description>&lt;P&gt;Hi thank you for coming back to me with this. If you look at both queries, they both contain the 'dedup' command which is why I'm a little confused as to why their is a difference in the results.&lt;/P&gt;

&lt;P&gt;Kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 13:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259807#M77878</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-03-23T13:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Different Results From Similar Queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259808#M77879</link>
      <description>&lt;P&gt;Consider following sample   data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;detail.input-preference-tal detail.input-ur 
FALSE   A   
TRUE    B   
FALSE   A   
FALSE   C   
TRUE    A   
TRUE    B   
FALSE   D   
FALSE   C   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Running query in following order (first dedup and then filter)  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dedup detail.input-ur | search detail.input-preference-tal=true       
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output - 1 row (the dedup will give 4 rows with latest value for each detail.input-ur then only keep detail.input-preference-tal=true)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;detail.input-preference-tal detail.input-ur 
FALSE   A   ***will be removed by search filter
TRUE    B   
FALSE   C   ***will be removed by search filter
FALSE   D   ***will be removed by search filter
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Running query in following order (first filster and then dedup)     &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | search detail.input-preference-tal=true | dedup detail.input-ur  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output - 2 rows (the search will just keep the events with detail.input-preference-tal=true and then keep the latest for each detail.input-ur) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;detail.input-preference-tal detail.input-ur 
TRUE    B   
TRUE    A   
TRUE    B   will be removed by dedup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can see based on data, order of dedup and filter can change the count of rows and possibly that's what's happening here.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 16:41:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259808#M77879</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-23T16:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Different Results From Similar Queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259809#M77880</link>
      <description>&lt;P&gt;Hi @somesoni2 thank you very much for taking the time to reply to my post and for putting the answer together it's greatly appreciated.&lt;/P&gt;

&lt;P&gt;I also understand your logic and seems a very reasonable explanation.&lt;/P&gt;

&lt;P&gt;Once many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 07:12:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-Results-From-Similar-Queries/m-p/259809#M77880</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-03-24T07:12:02Z</dc:date>
    </item>
  </channel>
</rss>

