<?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: Why am I getting different results for the same search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397226#M115297</link>
    <description>&lt;P&gt;Adding to what Woodcock said above, I've found &lt;CODE&gt;transaction&lt;/CODE&gt; can be replaced by &lt;CODE&gt;stats&lt;/CODE&gt; in most situations with a little extra effort. Obviously it depends on what you're trying to report on, but something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=linux sourcetype=syslog 
  | stats last(somefield) as last_something first(somefield) as first_something range(_time) as span by queue_id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Jul 2019 13:47:18 GMT</pubDate>
    <dc:creator>twinspop</dc:creator>
    <dc:date>2019-07-17T13:47:18Z</dc:date>
    <item>
      <title>Why am I getting different results for the same search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397222#M115293</link>
      <description>&lt;P&gt;If I run the same search using two different time windows I consistently get different results.&lt;BR /&gt;
I'm looking to count the number of email messages sent. The search query is simple:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="linux" sourcetype="syslog" | transaction queue_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When i search for a time range of 19:00:00 to 19:30:00 I get the following results (note from 19:21 on there are zero results):&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7364i1D15E5CAC67DFD02/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If I then search for 19:21:00 to 19:22:00 I get the following results (note: now where are 245 events):&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7365i9459604DB12BD575/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 19:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397222#M115293</guid>
      <dc:creator>eckdale</dc:creator>
      <dc:date>2019-07-15T19:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting different results for the same search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397223#M115294</link>
      <description>&lt;P&gt;Because &lt;CODE&gt;transaction&lt;/CODE&gt; is a command that consumes a HUGE amount of RAM and when scaled to any practical time-window will exhaust all RAM available to you and your search and WILL SILENTLY ABORT yielding partial results and NO INDICATION THAT HAPPENED (unless you &lt;CODE&gt;Inspect&lt;/CODE&gt; your &lt;CODE&gt;job&lt;/CODE&gt; and check the &lt;CODE&gt;search.log&lt;/CODE&gt;).  This is the main reason that I am constantly harping: &lt;CODE&gt;DO NOT USE transaction!&lt;/CODE&gt;  So don't use it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 20:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397223#M115294</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-15T20:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting different results for the same search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397224#M115295</link>
      <description>&lt;P&gt;So that's good to know. I'll inspect the job and look into search.log for more details.&lt;/P&gt;

&lt;P&gt;Two questions then:&lt;BR /&gt;
If I can't use &lt;CODE&gt;transaction&lt;/CODE&gt; to group multiple events then what do I use?&lt;BR /&gt;
My single-instance Splunk Enterprise server has 256GB of memory and appears to use &lt;STRONG&gt;very little&lt;/STRONG&gt; of that memory. Am I really exhausting resources?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 20:27:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397224#M115295</guid>
      <dc:creator>eckdale</dc:creator>
      <dc:date>2019-07-15T20:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting different results for the same search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397225#M115296</link>
      <description>&lt;P&gt;Per your instruction I took a look at &lt;CODE&gt;Inspector&lt;/CODE&gt; (should have done this originally) and it does indicate: "Some transactions have been discarded. To include them, add keepevicted=true.&lt;/P&gt;

&lt;P&gt;Adding that to the query does in fact resolve the issue.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 20:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397225#M115296</guid>
      <dc:creator>eckdale</dc:creator>
      <dc:date>2019-07-15T20:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting different results for the same search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397226#M115297</link>
      <description>&lt;P&gt;Adding to what Woodcock said above, I've found &lt;CODE&gt;transaction&lt;/CODE&gt; can be replaced by &lt;CODE&gt;stats&lt;/CODE&gt; in most situations with a little extra effort. Obviously it depends on what you're trying to report on, but something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=linux sourcetype=syslog 
  | stats last(somefield) as last_something first(somefield) as first_something range(_time) as span by queue_id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2019 13:47:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397226#M115297</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2019-07-17T13:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting different results for the same search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397227#M115298</link>
      <description>&lt;P&gt;Even so, do not use &lt;CODE&gt;transaction&lt;/CODE&gt;; take the time and effort to use &lt;CODE&gt;*stats&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 21:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-different-results-for-the-same-search/m-p/397227#M115298</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-17T21:20:47Z</dc:date>
    </item>
  </channel>
</rss>

