<?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 command is not closing transactions and is hitting the max open transaction limit (maxopentxn). in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/522295#M147279</link>
    <description>&lt;P&gt;I totally forgot to follow up on this issue, thank you for commenting on this issue.&amp;nbsp; Using `stats` was the recommendation from the Splunk support.&amp;nbsp; Not only does using `stats` result in all the entries being reflected in the results, it is so much faster.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 15:36:51 GMT</pubDate>
    <dc:creator>andrewcg</dc:creator>
    <dc:date>2020-09-30T15:36:51Z</dc:date>
    <item>
      <title>Transaction command is not closing transactions and is hitting the max open transaction limit (maxopentxn).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465378#M131101</link>
      <description>&lt;P&gt;We recently upgraded to from 7.1.2 to 8.0.3 on on-prem Splunk Enterprise.  A previously working saved search is no longer returning the correct results.  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| transaction session_id maxspan=30s&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Looking into it looks like the  &lt;CODE&gt;transaction&lt;/CODE&gt; command is no longer closing connections when the  &lt;CODE&gt;maxspan&lt;/CODE&gt; (30s) value is hit.  This leaves all transactions open and then the search ends when it hits the default of 5000.  &lt;/P&gt;

&lt;P&gt;I need to create transactions out of 650000 entries (two or three lines each), so needless to say this search no longer functions.  I can confirm this behavior, by:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;| stats count by closed_txn&lt;/CODE&gt; shows all the transactions returned as  &lt;CODE&gt;closed_txn=0&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;adding  &lt;CODE&gt;maxopentxn=5500&lt;/CODE&gt; to the  &lt;CODE&gt;transaction&lt;/CODE&gt; command causes the number of returned results to go from 5000 to 5500&lt;/LI&gt;
&lt;LI&gt;adding  &lt;CODE&gt;maxevents=2&lt;/CODE&gt; only closes some of the events&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;closed_txn&lt;/CODE&gt;,  &lt;CODE&gt;eventcount&lt;/CODE&gt;,  &lt;CODE&gt;count&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;0          1           1041
0          2           4458
1          2           1654
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transactions are supposed to close when:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;The '&lt;CODE&gt;closed_txn&lt;/CODE&gt;' field is set to '&lt;CODE&gt;1&lt;/CODE&gt;' if one of the following conditions is met:  &lt;CODE&gt;maxevents&lt;/CODE&gt;, &lt;CODE&gt;maxpause&lt;/CODE&gt;, &lt;CODE&gt;maxspan&lt;/CODE&gt;, &lt;CODE&gt;startswith&lt;/CODE&gt;.&lt;/EM&gt; &lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.3/SearchReference/Transaction"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.3/SearchReference/Transaction&lt;/A&gt; -&amp;gt; Memory control options -&amp;gt; keepevicted&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 17:00:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465378#M131101</guid>
      <dc:creator>andrewcg</dc:creator>
      <dc:date>2020-05-26T17:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction command is not closing transactions and is hitting the max open transaction limit (maxopentxn).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465379#M131102</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/26456"&gt;@andrewcg&lt;/a&gt; which are the fields you want to stitch together after transaction command?&lt;/P&gt;

&lt;P&gt;You should ideally try &lt;CODE&gt;stats&lt;/CODE&gt; for your correlation instead of &lt;CODE&gt;transaction&lt;/CODE&gt;. There are several examples of stats for transaction on Splunk Answers.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourCurrentSearch&amp;gt;
| fields _time, session_id, field1, field2, field3
| eval Time=_time
| bin _time span=30s
| stats count as eventcount list(*) as list_* by _time session_id
| eval maxTime=mvindex(list_Time,0),minTime=mvindex(list_Time,eventcount-1), duration=maxTime-minTime
| fields - minTime maxTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a runanywhere example based on Splunk's _internal index just to generate some data and correlate using &lt;CODE&gt;component&lt;/CODE&gt; (similar to &lt;CODE&gt;session_id&lt;/CODE&gt;)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd 
| fields _time, component, log_level, date_hour, date_minute, date_second
| eval Time=_time
| bin _time span=30s 
| stats count as eventcount list(*) as list_* by component _time
| eval maxTime=mvindex(list_Time,0),minTime=mvindex(list_Time,eventcount-1), duration=maxTime-minTime
| fields - minTime maxTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465379#M131102</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-30T05:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction command is not closing transactions and is hitting the max open transaction limit (maxopentxn).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465380#M131103</link>
      <description>&lt;P&gt;Worked perfectly for me.  I could not picture in my mind how the transaction command could be duplicated with a stats command based on the Splunk documentation, your example illustrated it for me.  I now have a faster and more importantly functional search.  Thank you.&lt;/P&gt;

&lt;P&gt;I was able to drop the _time bin part as the session_id is unique enough to not be duplicated in a day and I was only using the  maxspan to close open transactions.  My search went from:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;transaction session_id maxspan=30s&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;to&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats count as eventcount list(mac) AS mac, list(hostname) AS hostname, list(nas_ip) AS nas_ip, list(nas_port) AS nas_port, list(nas_id) AS nas_id, list(attr_value) AS attr_value, list(profiles) AS profiles by session_id&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;That allowed me to keep all the rest of the search on either side the same.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465380#M131103</guid>
      <dc:creator>andrewcg</dc:creator>
      <dc:date>2020-09-30T05:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction command is not closing transactions and is hitting the max open transaction limit (maxopentxn).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465381#M131104</link>
      <description>&lt;P&gt;I prefer &lt;CODE&gt;transaction&lt;/CODE&gt; when for scenarios where I need to drilldown with a particular &lt;CODE&gt;session_id&lt;/CODE&gt; or for more complex scenarios where things like &lt;CODE&gt;maxpause&lt;/CODE&gt; and other conditions are in place. A good guide to Event Grouping and Correlation is this Splunk Documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/Abouteventcorrelation"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/Abouteventcorrelation&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, there is more to correlation and commands like union, multisearch also needs to be considered under specific circumstances.&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 15:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/465381#M131104</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-05-27T15:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction command is not closing transactions and is hitting the max open transaction limit (maxopentxn).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/522295#M147279</link>
      <description>&lt;P&gt;I totally forgot to follow up on this issue, thank you for commenting on this issue.&amp;nbsp; Using `stats` was the recommendation from the Splunk support.&amp;nbsp; Not only does using `stats` result in all the entries being reflected in the results, it is so much faster.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 15:36:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-command-is-not-closing-transactions-and-is-hitting/m-p/522295#M147279</guid>
      <dc:creator>andrewcg</dc:creator>
      <dc:date>2020-09-30T15:36:51Z</dc:date>
    </item>
  </channel>
</rss>

