<?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: transaction: inconsistent results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494832#M137906</link>
    <description>&lt;P&gt;Nick, I'd be the first to admit that &lt;CODE&gt;transaction&lt;/CODE&gt;'s behavior is not something I fully - or even remotely - understand, nor that I fully understand its documentation - i.e. how it's &lt;EM&gt;supposed&lt;/EM&gt; to behave. That said, please take a look at "Specifying multiple fields" section in &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Transaction"&gt;Transaction Search Reference&lt;/A&gt; to see that the logical event defined by &lt;CODE&gt;transaction&lt;/CODE&gt;'s output is &lt;STRONG&gt;not&lt;/STRONG&gt; supposed to comprise of events that &lt;STRONG&gt;each&lt;/STRONG&gt; has &lt;STRONG&gt;all&lt;/STRONG&gt; of the fields. It's not the case in my testing, and it's &lt;STRONG&gt;not&lt;/STRONG&gt; how it's supposed to behave, per that article.&lt;/P&gt;

&lt;P&gt;On a side note, when I run the &lt;STRONG&gt;same exact&lt;/STRONG&gt; &lt;CODE&gt;transaction&lt;/CODE&gt; command on the same group of events I did when I posted my question, it now correctly groups those events.&lt;/P&gt;

&lt;P&gt;And no, I have no clue what's happening but one of the possibilities is that &lt;CODE&gt;transaction&lt;/CODE&gt; is in "alpha" version - i.e. unpredictable behavior that is only partially documented. That in a way makes sense given how many people are suggesting not to use it, and use &lt;CODE&gt;stats&lt;/CODE&gt; instead.&lt;/P&gt;

&lt;P&gt;And yes, you're right, &lt;CODE&gt;client=&lt;/CODE&gt; happens only once per group - that's the way Postfix logs events.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2020 17:53:55 GMT</pubDate>
    <dc:creator>mitag</dc:creator>
    <dc:date>2020-01-27T17:53:55Z</dc:date>
    <item>
      <title>transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494820#M137894</link>
      <description>&lt;P&gt;The following two logical events are supposed to be one as they share the same &lt;CODE&gt;threadId&lt;/CODE&gt; - but instead they are split into two by my transaction command below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 22 10:33:56 smtp1 postfix/smtpd[23895]: 3AB561005181: client=[REDACTED]
host = smtp1 source = /var/log/maillog sourcetype = postfix_syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 22 10:33:56 smtp1 postfix/cleanup[24020]: 3AB561005181: message-id=&amp;lt;521185171.8189.**********.JavaMail.levels.[REDACTED]
Jan 22 10:33:56 smtp1 postfix/qmgr[1517]: 3AB561005181: from=[REDACTED], size=2600, nrcpt=1 (queue active)
Jan 22 10:33:56 smtp1 postfix/smtp[24023]: 3AB561005181: to=[REDACTED], relay=[REDACTED], delay=0.03, delays=0/0/0.01/0.02, dsn=2.0.0, status=sent (250 ok:  Message 58706800 accepted)
Jan 22 10:33:56 smtp1 postfix/qmgr[1517]: 3AB561005181: removed
host = smtp1 source = /var/log/maillog sourcetype = postfix_syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Most other events are correctly grouped but a number aren't.)&lt;/P&gt;

&lt;P&gt;How would you modify the following command to correctly group events?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="postfix_syslog" threadId=*
| transaction "threadId", "host", "client" maxspan=24h maxpause=4h keepevicted=true startswith="client\="
| search threadId=3AB561005181
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: if I add &lt;CODE&gt;message-id&lt;/CODE&gt; to the list of fields in &lt;CODE&gt;transaction&lt;/CODE&gt;, the events are grouped properly - but some others break. Why?&lt;/P&gt;

&lt;P&gt;Generally, please share the logic of how transactions should be crafted for correct behavior.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;(Splunk Enterprise 7.1.2)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 01:59:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494820#M137894</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-23T01:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494821#M137895</link>
      <description>&lt;P&gt;Hi @mitag &lt;BR /&gt;
&lt;CODE&gt;transaction&lt;/CODE&gt; is necessary?&lt;BR /&gt;
&lt;CODE&gt;threadId&lt;/CODE&gt; is extracted. what's problem?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 09:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494821#M137895</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T09:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494822#M137896</link>
      <description>&lt;P&gt;The goal is to extract a set of additional fields that are only available in &lt;CODE&gt;transaction&lt;/CODE&gt; output. E.g.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time host threadId size client from to status duration eventcount relay message_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(One could probably do something similar - and faster - via &lt;CODE&gt;stats&lt;/CODE&gt; - yet my goal is to group events related to a single Postfix transaction together for subsequent analysis - which only &lt;CODE&gt;transaction&lt;/CODE&gt; can do.)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 15:01:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494822#M137896</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-23T15:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494823#M137897</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype="postfix_syslog" threadId=*
| stats values(_time) as _time values(host) as host values(size) as size values(client) as client values(from) as from values(to) as to values(status) as status range(_time) as duration count as eventcount values(relay) as relay values(message_id) as message_id by threadId
| table _time host threadId size client from to status duration eventcount relay message_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hi, @mitag&lt;BR /&gt;
This may be same results. try this. &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 17:59:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494823#M137897</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T17:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494824#M137898</link>
      <description>&lt;P&gt;Not the same results, with some errors and generally I'd like to learn to use &lt;CODE&gt;transaction&lt;/CODE&gt; correctly vs. using &lt;CODE&gt;stats&lt;/CODE&gt;. Is there a reason I consistently get advice to use &lt;CODE&gt;stats&lt;/CODE&gt; when I ask questions about &lt;CODE&gt;transaction&lt;/CODE&gt; (performance aside)?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494824#M137898</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-23T21:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494825#M137899</link>
      <description>&lt;P&gt;yes. &lt;CODE&gt;transaction&lt;/CODE&gt; is slow?&lt;BR /&gt;
if it is not, I'm sorry.&lt;BR /&gt;
&lt;CODE&gt;with some errors&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;
two days values are appeared?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494825#M137899</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T21:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494826#M137900</link>
      <description>&lt;P&gt;&lt;CODE&gt;some others break. Why?&lt;/CODE&gt;&lt;BR /&gt;
maybe,the order of events with same time stamp is problem, &lt;CODE&gt;startswith="client\="&lt;/CODE&gt;will not work.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:50:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494826#M137900</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T21:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494827#M137901</link>
      <description>&lt;P&gt;deferred email threads can last several days and have something like this in the &lt;CODE&gt;_time&lt;/CODE&gt; field:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;1579731986,1579736186,1579740387,1579744587,1579748788,1579752988,1579757188,1579761388,1579765588,1579769789,1579773989,1579778189,1579782389,1579786589,1579790789,1579794989,1579799189,1579799190,1579803390,1579807590,1579811790,1579815991&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;startswith="client\="&lt;/CODE&gt; will not work.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Any idea why? Seems to be working in &lt;EM&gt;most&lt;/EM&gt; cases and it seems all postfix smtp threads start that way...&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 22:23:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494827#M137901</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-23T22:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494828#M137902</link>
      <description>&lt;P&gt;Logs are processed in the order they come in, so the order may be mixed.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 10:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494828#M137902</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-24T10:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494829#M137903</link>
      <description>&lt;P&gt;Except:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;if I add message-id to the list of fields in transaction, the events are grouped properly&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;So it's still a mystery to me why it works the way it does.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 14:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494829#M137903</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-24T14:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494830#M137904</link>
      <description>&lt;P&gt;Isn't that because it's an appropriate field to link away time?&lt;BR /&gt;
By the way, why put it together?&lt;BR /&gt;
If you just search, you don't have to.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 21:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494830#M137904</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-24T21:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494831#M137905</link>
      <description>&lt;P&gt;Its not totally clear from your example, but the second group of logs above do not appear to contain any fields for 'client'&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;transaction "threadId", "host", "client"&lt;/CODE&gt; will group all events which share &lt;STRONG&gt;ALL 3&lt;/STRONG&gt; of those common values.&lt;BR /&gt;
In your example, I can see that thread and host would match in all cases, but client may not.&lt;/P&gt;

&lt;P&gt;If only some of your events contained a client id and some did not, you would naturually expect transaction to group them into two seperate transactions.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 11:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494831#M137905</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-01-26T11:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494832#M137906</link>
      <description>&lt;P&gt;Nick, I'd be the first to admit that &lt;CODE&gt;transaction&lt;/CODE&gt;'s behavior is not something I fully - or even remotely - understand, nor that I fully understand its documentation - i.e. how it's &lt;EM&gt;supposed&lt;/EM&gt; to behave. That said, please take a look at "Specifying multiple fields" section in &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Transaction"&gt;Transaction Search Reference&lt;/A&gt; to see that the logical event defined by &lt;CODE&gt;transaction&lt;/CODE&gt;'s output is &lt;STRONG&gt;not&lt;/STRONG&gt; supposed to comprise of events that &lt;STRONG&gt;each&lt;/STRONG&gt; has &lt;STRONG&gt;all&lt;/STRONG&gt; of the fields. It's not the case in my testing, and it's &lt;STRONG&gt;not&lt;/STRONG&gt; how it's supposed to behave, per that article.&lt;/P&gt;

&lt;P&gt;On a side note, when I run the &lt;STRONG&gt;same exact&lt;/STRONG&gt; &lt;CODE&gt;transaction&lt;/CODE&gt; command on the same group of events I did when I posted my question, it now correctly groups those events.&lt;/P&gt;

&lt;P&gt;And no, I have no clue what's happening but one of the possibilities is that &lt;CODE&gt;transaction&lt;/CODE&gt; is in "alpha" version - i.e. unpredictable behavior that is only partially documented. That in a way makes sense given how many people are suggesting not to use it, and use &lt;CODE&gt;stats&lt;/CODE&gt; instead.&lt;/P&gt;

&lt;P&gt;And yes, you're right, &lt;CODE&gt;client=&lt;/CODE&gt; happens only once per group - that's the way Postfix logs events.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 17:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494832#M137906</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-27T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494833#M137907</link>
      <description>&lt;P&gt;Yes, its not immediately obvious from the docs - specifying 3 fields does not mean all 3 fields must exist, but IF they do, then the transaction will group based on them: (emphasis added)&lt;/P&gt;

&lt;P&gt;"&lt;STRONG&gt;IF&lt;/STRONG&gt; there is a transitive relationship between the fields in the fields list &lt;STRONG&gt;AND&lt;/STRONG&gt; if the related events appear in the &lt;STRONG&gt;CORRECT&lt;/STRONG&gt; sequence..."&lt;/P&gt;

&lt;P&gt;In your case, host and trace appear in each event, but client is sporadic. maxspan could therefore become critical in satisfying a match.&lt;/P&gt;

&lt;P&gt;Do you have satisfactory results by ommiting client?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 18:10:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494833#M137907</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-01-27T18:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494834#M137908</link>
      <description>&lt;P&gt;I can't even reproduce the unexpected behavior in my original search - so all bets are off... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Like I said simply re-running my original search produces expected (correct) results today - I'll have to find another anomaly where the results are unexpected and can be reliably reproduced. But even before that I'll likely have to upgrade our instance to the latest version (from 7.1.2 to 8.0.1) just in case my issue is the result of a bug that's been squashed in subsequent releases.&lt;/P&gt;

&lt;P&gt;Oh and the kicker is that some of the Postfix threads can run for weeks... Non-deliverable emails are deferred, then retried, then deferred for longer and so on... So &lt;CODE&gt;maxspan&lt;/CODE&gt; and &lt;CODE&gt;maxpause&lt;/CODE&gt; are of limited use here despite relative simplicity of the events.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 19:21:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494834#M137908</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-27T19:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494835#M137909</link>
      <description>&lt;P&gt;If you have lots of long running open transactions (ie your search window is large), you could be hitting memory limits causing evictions - your example above is all the same timeframe, but it could be contributing.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 19:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494835#M137909</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-01-27T19:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: transaction: inconsistent results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494836#M137910</link>
      <description>&lt;P&gt;I hear you - in that case Splunk normally produces a warning that I am on the lookout for - but I have yet to see it running out of memory - and I did try to run it into the ground... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 19:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-inconsistent-results/m-p/494836#M137910</guid>
      <dc:creator>mitag</dc:creator>
      <dc:date>2020-01-27T19:41:24Z</dc:date>
    </item>
  </channel>
</rss>

