<?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 Why is the result number not matching? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394890#M114696</link>
    <description>&lt;P&gt;Hi -  I have a query where it results in total number of results of number of people logged into an application and I am displaying results for the last 24 hours. Below is the query: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="pfad" AND success AND NOT AUTHN_ATTEMPT AND NOT SLO AND NOT OIDC AND adapterid= * | dedup subject | search connectionid=PartnerPortal | stats count(subject) ------------&amp;gt; resulted total count of 1400+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here the "PartnerPortal" is the application name which is tied to the field "connectionid". But if I change the above query to something like following: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="pfad" **PartnerPortal** AND success AND NOT AUTHN_ATTEMPT AND NOT SLO AND NOT OIDC AND adapterid=* | dedup subject  | stats count(subject) ------------&amp;gt; resulted total count of 2300+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried the following query as well but resulting 2300+ results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="pfaduit" connectionid = PartnerPortal tid success NOT AUTHN_ATTEMPT NOT SLO NOT OIDC adapterid= * | dedup subject | stats count(subject)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Shouldn't all the above queries result the same number?&lt;/P&gt;

&lt;P&gt;Please advice.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 09 May 2018 20:15:22 GMT</pubDate>
    <dc:creator>rakeshyv0807</dc:creator>
    <dc:date>2018-05-09T20:15:22Z</dc:date>
    <item>
      <title>Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394890#M114696</link>
      <description>&lt;P&gt;Hi -  I have a query where it results in total number of results of number of people logged into an application and I am displaying results for the last 24 hours. Below is the query: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="pfad" AND success AND NOT AUTHN_ATTEMPT AND NOT SLO AND NOT OIDC AND adapterid= * | dedup subject | search connectionid=PartnerPortal | stats count(subject) ------------&amp;gt; resulted total count of 1400+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here the "PartnerPortal" is the application name which is tied to the field "connectionid". But if I change the above query to something like following: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="pfad" **PartnerPortal** AND success AND NOT AUTHN_ATTEMPT AND NOT SLO AND NOT OIDC AND adapterid=* | dedup subject  | stats count(subject) ------------&amp;gt; resulted total count of 2300+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried the following query as well but resulting 2300+ results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="pfaduit" connectionid = PartnerPortal tid success NOT AUTHN_ATTEMPT NOT SLO NOT OIDC adapterid= * | dedup subject | stats count(subject)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Shouldn't all the above queries result the same number?&lt;/P&gt;

&lt;P&gt;Please advice.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 20:15:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394890#M114696</guid>
      <dc:creator>rakeshyv0807</dc:creator>
      <dc:date>2018-05-09T20:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394891#M114697</link>
      <description>&lt;P&gt;First thing I'll say is that running &lt;CODE&gt;PartnerPortal&lt;/CODE&gt; is very different from running &lt;CODE&gt;connectionid = PartnerPortal&lt;/CODE&gt;, which in turn is different from running &lt;CODE&gt;connectionid = PartnerPortal*&lt;/CODE&gt; in your base search.&lt;/P&gt;

&lt;P&gt;For example if you have these three events:&lt;BR /&gt;
event 1 = time1 there was an error in PartnerPortal. adapterid=value1.a subject=value2.a&lt;BR /&gt;
event 2 = time2 connectionid=PartnerPortal adapterid=value1.b subject=value2.b&lt;BR /&gt;
event 3 = time3 connectionid=PartnerPortalConfig adapterid=value1.c subject=value2.c&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Running just a string search for "PartnerPortal" in your base search, you'll get all three events above returned.&lt;/LI&gt;
&lt;LI&gt;Running &lt;CODE&gt;connectionid = PartnerPortal*&lt;/CODE&gt; in your base search will return event 2 and event 3 but not event 1, since event 1 doesn't even have the field connectionid in it&lt;/LI&gt;
&lt;LI&gt;Running &lt;CODE&gt;connectionid = PartnerPortal&lt;/CODE&gt; in your base search will return only event 2, since the value of connectionid in event 3 is actually PartnerPortalConfig&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 20:46:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394891#M114697</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2018-05-09T20:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394892#M114698</link>
      <description>&lt;P&gt;Also, in the first search adapterid= is missing the *&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 20:50:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394892#M114698</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-09T20:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394893#M114699</link>
      <description>&lt;P&gt;Thanks, for the reply. &lt;/P&gt;

&lt;P&gt;sourcetype="pfad" AND success AND NOT AUTHN_ATTEMPT AND NOT SLO AND NOT OIDC AND adapterid= * | dedup subject | search connectionid=PartnerPortal | stats count(subject) ------------&amp;gt; resulted total count of 1400+&lt;/P&gt;

&lt;P&gt;sourcetype="pfad" connectionid = PartnerPortal AND success AND NOT AUTHN_ATTEMPT AND NOT SLO AND NOT OIDC AND adapterid= * | dedup subject | stats count(subject) -----&amp;gt; resulted total count of 2300+&lt;/P&gt;

&lt;P&gt;Doesn't the above two queries return the same number of results?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 21:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394893#M114699</guid>
      <dc:creator>rakeshyv0807</dc:creator>
      <dc:date>2018-05-09T21:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394894#M114700</link>
      <description>&lt;P&gt;Those are two different sourcetypes? &lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 21:22:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394894#M114700</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-09T21:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394895#M114701</link>
      <description>&lt;P&gt;Just updated my reply. Please check and let me know. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 21:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394895#M114701</guid>
      <dc:creator>rakeshyv0807</dc:creator>
      <dc:date>2018-05-09T21:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394896#M114702</link>
      <description>&lt;P&gt;Instead of &lt;CODE&gt;| dedup subject | stats count(subject)&lt;/CODE&gt; can you try &lt;CODE&gt;| stats dc(subject)&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;Also you must understand that &lt;CODE&gt;NOT&lt;/CODE&gt; is not same as &lt;CODE&gt;!=&lt;/CODE&gt;, trying to find NOT will also return events where keywords after NOT are not present. Refer to documentation: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Search#6._Using_the_NOT_or_.21.3D_comparisons"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Search#6._Using_the_NOT_or_.21.3D_comparisons&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also try turning off Search Optimization to test the results of the two queries as per answer: &lt;A href="https://answers.splunk.com/answers/589037/search-results-are-different.html"&gt;https://answers.splunk.com/answers/589037/search-results-are-different.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 21:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394896#M114702</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-09T21:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394897#M114703</link>
      <description>&lt;P&gt;If you dedup and filter on Partnerportal afterwards, you might have already thrown away events that might have fit the Partnerportal criteria. In the second search, you're doing it before dedup, therefore resulting in more events. &lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 21:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394897#M114703</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-09T21:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the result number not matching?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394898#M114704</link>
      <description>&lt;P&gt;This makes sense to me.  Imagine that you have 2 events like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;subject=foo connectionid=poo
subject=foo connectionid=PartnerPortal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you do &lt;CODE&gt;| dedup subject | search connectionid=PartnerPortal | stats count(subject)&lt;/CODE&gt; you will get &lt;CODE&gt;0&lt;/CODE&gt;.&lt;BR /&gt;
If you do &lt;CODE&gt;| search connectionid=PartnerPortal | dedup subject | stats count(subject)&lt;/CODE&gt; you will get &lt;CODE&gt;1&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 04:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-result-number-not-matching/m-p/394898#M114704</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-05-10T04:49:01Z</dc:date>
    </item>
  </channel>
</rss>

