<?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 not returning all results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549234#M155829</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216708"&gt;@splunkuser1948&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're encountering undefined (or at least undocumented) behavior.&lt;/P&gt;&lt;P&gt;The transaction command should include at least one field. If it doesn't, I suspect Splunk evicts every event it encounters, which is implied in your experiment with the keepevicted option.&lt;/P&gt;&lt;P&gt;The behavior of closed_txn in this case&amp;nbsp;&lt;EM&gt;is&lt;/EM&gt; documented (emphasis mine) [1]:&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;The 'closed_txn' field is set to '1' if one of the following conditions is met: maxevents, maxpause, maxspan, &lt;EM&gt;startswith&lt;/EM&gt;."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.3/SearchReference/Transaction#Memory_control_options" target="_self"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.3/SearchReference/Transaction#Memory_control_options&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Apr 2021 00:25:58 GMT</pubDate>
    <dc:creator>tscroggins</dc:creator>
    <dc:date>2021-04-25T00:25:58Z</dc:date>
    <item>
      <title>Transaction Command not returning all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549221#M155822</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a splunk query as below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=platform env=sandbox  http_method="GET" &lt;/LI-CODE&gt;&lt;P&gt;This gave me 1 result back.&lt;/P&gt;&lt;P&gt;Now, when I am applying transaction command to it&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=platform env=sandbox  http_method="GET" | transaction  startswith="GET"&lt;/LI-CODE&gt;&lt;P&gt;It is returning 0 results.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, if I do like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=platform env=sandbox  http_method="GET" | transaction  startswith="GET" keepevicted=true&lt;/LI-CODE&gt;&lt;P&gt;It returns my 1 result back. Value of `closed_txn`&amp;nbsp; is 1.&lt;/P&gt;&lt;P&gt;Also, if I do like below, still it returns my 1 result back. What is going on ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=platform env=sandbox  http_method="GET" | transaction CorrelationId startswith="GET"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"GET" is present in my event `_raw` otherwise&amp;nbsp; first search command would not have returned me 1 result.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 17:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549221#M155822</guid>
      <dc:creator>splunkuser1948</dc:creator>
      <dc:date>2021-04-24T17:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Command not returning all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549234#M155829</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216708"&gt;@splunkuser1948&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're encountering undefined (or at least undocumented) behavior.&lt;/P&gt;&lt;P&gt;The transaction command should include at least one field. If it doesn't, I suspect Splunk evicts every event it encounters, which is implied in your experiment with the keepevicted option.&lt;/P&gt;&lt;P&gt;The behavior of closed_txn in this case&amp;nbsp;&lt;EM&gt;is&lt;/EM&gt; documented (emphasis mine) [1]:&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;The 'closed_txn' field is set to '1' if one of the following conditions is met: maxevents, maxpause, maxspan, &lt;EM&gt;startswith&lt;/EM&gt;."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.3/SearchReference/Transaction#Memory_control_options" target="_self"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.3/SearchReference/Transaction#Memory_control_options&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 00:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549234#M155829</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-04-25T00:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Command not returning all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549270#M155844</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493" target="_blank" rel="noopener"&gt;@tscroggins&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not mandatory for transaction command to have a field.&lt;/P&gt;&lt;P&gt;Also, what I am observing is that if I have&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;index=platform env=sandbox  http_method="GET" &lt;/PRE&gt;&lt;P&gt;returning `n` events (This time I increased/changed my time limit) , then&lt;/P&gt;&lt;PRE&gt;index=platform env=sandbox  http_method="GET" | transaction  startswith="GET"&lt;/PRE&gt;&lt;P&gt;returns me `n-1` events always.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But below 2 commands still gives me `n` events.&amp;nbsp;&lt;SPAN class="lia-unicode-emoji"&gt;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;index=platform env=sandbox  http_method="GET" | transaction  startswith="GET" keepevicted=true&lt;/PRE&gt;&lt;PRE&gt;index=platform env=sandbox  http_method="GET" | transaction CorrelationId startswith="GET"&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Apr 2021 11:37:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549270#M155844</guid>
      <dc:creator>splunkuser1948</dc:creator>
      <dc:date>2021-04-25T11:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Command not returning all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549281#M155845</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216708"&gt;@splunkuser1948&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Indeed, but the command is behaving as designed. Without a correlating field, every event is eligible to be added to an open transaction, and each match against startswith will close the current transaction and open a new one. The final transaction will remain open because no subsequent event forced Splunk to close it.&lt;/P&gt;&lt;P&gt;In single-threaded log streams, this is probably fine, but most applications--web servers in particular--are multi-threaded. Events from different transactions will be interleaved together. (This is heavily dependent on application architecture, of course.)&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 19:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/549281#M155845</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-04-25T19:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Command not returning all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/553417#M157131</link>
      <description>But even the last event satisfies the startswith. So, splunk should close it too as its the end and no further events are there to process. Don't you think that's a bug in splunk ?</description>
      <pubDate>Thu, 27 May 2021 22:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/553417#M157131</guid>
      <dc:creator>splunkuser1948</dc:creator>
      <dc:date>2021-05-27T22:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Command not returning all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/553645#M157193</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216708"&gt;@splunkuser1948&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see your point. Here's a lightly obfuscated example using splunkweb access logs:&lt;/P&gt;&lt;P&gt;192.0.2.1 - admin [29/May/2021:17:25:59.501 -0400] "GET /en-US/splunkd/__raw/servicesNS/nobody/search/search/jobs/1622323559.762/events?output_mode=json&amp;amp;offset=0&amp;amp;count=20&amp;amp;segmentation=full&amp;amp;max_lines=5&amp;amp;field_list=host%2Csource%2Csourcetype%2Ctag%2Ctest2%2Cclientip%2Ctest1%2C_raw%2C_time%2C_audit%2C_decoration%2Ceventtype%2C_eventtype_color%2Clinecount%2C_fulllinecount%2C_icon%2Ctag*&amp;amp;truncation_mode=abstract&amp;amp;_=1622323362071 HTTP/1.1" 200 419 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - 2b9d0a154f394576ba8d947bd5ac1019 2ms&lt;BR /&gt;192.0.2.1 - admin [29/May/2021:17:25:59.538 -0400] "GET /en-US/splunkd/__raw/services/server/health/splunkd?output_mode=json&amp;amp;_=1622323362072 HTTP/1.1" 200 408 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - 2b9d0a154f394576ba8d947bd5ac1019 0ms&lt;BR /&gt;192.0.2.1 - admin [29/May/2021:17:25:59.723 -0400] "GET /en-US/splunkd/__raw/servicesNS/nobody/search/search/jobs/1622323559.762?output_mode=json&amp;amp;_=1622323362073 HTTP/1.1" 200 1591 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - 2b9d0a154f394576ba8d947bd5ac1019 1ms&lt;/P&gt;&lt;P&gt;index=_internal sourcetype=splunkd_ui_access method=GET&lt;BR /&gt;| head 1&lt;BR /&gt;| transaction startswith="GET"&lt;BR /&gt;| table _time closed_txn eventcount _raw&lt;/P&gt;&lt;P&gt;returns nothing, but&lt;/P&gt;&lt;P&gt;index=_internal sourcetype=splunkd_ui_access method=GET&lt;BR /&gt;| head 1&lt;BR /&gt;| transaction startswith="GET" keepevicted=t&lt;BR /&gt;| table _time closed_txn eventcount _raw&lt;/P&gt;&lt;P&gt;returns&lt;/P&gt;&lt;P&gt;_time closed_txn eventcount _raw&lt;BR /&gt;2021-05-29 22:25:59.723 1 1 192.0.2.1 - admin [29/May/2021:17:25:59.723 -0400] "GET /en-US/splunkd/__raw/servicesNS/nobody/search/search/jobs/1622323559.762?output_mode=json&amp;amp;_=1622323362073 HTTP/1.1" 200 1591 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - 2b9d0a154f394576ba8d947bd5ac1019 1ms&lt;/P&gt;&lt;P&gt;I expect closed_txn to equal 0, but it's equal to 1.&lt;/P&gt;&lt;P&gt;If, however, we extract a transaction field, no transaction is evicted:&lt;/P&gt;&lt;P&gt;index=_internal sourcetype=splunkd_ui_access method=GET&lt;BR /&gt;| head 1&lt;BR /&gt;| rex field=other "-\\s(?&amp;lt;session_id&amp;gt;[^\\s]+)"&lt;BR /&gt;| transaction session_id startswith="GET"&lt;BR /&gt;| table _time closed_txn eventcount _raw&lt;/P&gt;&lt;P&gt;_time closed_txn eventcount _raw&lt;BR /&gt;2021-05-29 22:25:59.723 1 1 192.0.2.1 - admin [29/May/2021:17:25:59.723 -0400] "GET /en-US/splunkd/__raw/servicesNS/nobody/search/search/jobs/1622323559.762?output_mode=json&amp;amp;_=1622323362073 HTTP/1.1" 200 1591 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" - 2b9d0a154f394576ba8d947bd5ac1019 1ms&lt;/P&gt;&lt;P&gt;There could be an internal difference in the behavior of transaction eviction depending on the presence of transaction fields.&lt;/P&gt;&lt;P&gt;Inferring the behavior of the transaction command through experimentation is useful, but if keepevicted alters the behavior of the command beyond the documented explanation, I don't know if I'd consider it a defect in the code or an oversight in the documentation. Splunk support is likely to argue the command is working as documented whether the value of closed_txn is consistent or not.&lt;/P&gt;&lt;P&gt;If you have the time, you could test across various earlier versions of Splunk looking for a version when keepevicted and closed_txn behaved consistently. In my experience, Splunk support doesn't provide that level of service, particularly for versions of Splunk that are no longer supported. If you have one, your account manager or sales engineer may be able to assist.&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 03:37:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Command-not-returning-all-results/m-p/553645#M157193</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-05-30T03:37:42Z</dc:date>
    </item>
  </channel>
</rss>

