<?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: How to change the order the transaction command process the opened txn? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-the-transaction-command-process-the/m-p/202883#M58900</link>
    <description>&lt;P&gt;How about something like this... you should be able to build on it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats count as c by action | sort c
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Dec 2015 17:36:03 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2015-12-30T17:36:03Z</dc:date>
    <item>
      <title>How to change the order the transaction command process the opened txn?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-the-transaction-command-process-the/m-p/202882#M58899</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;

&lt;P&gt;I'm trying to use a &lt;CODE&gt;transaction&lt;/CODE&gt; to group logs that match the following business-logic:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;all triggered actions are queued and processed following the &lt;EM&gt;FIFO&lt;/EM&gt; policy&lt;/LI&gt;
&lt;LI&gt;sometimes, many actions can be triggered before the first one is even completed&lt;/LI&gt;
&lt;LI&gt;my logs does not include a common &lt;EM&gt;transaction_id&lt;/EM&gt; that could be use to match the triggering and ACK events&lt;/LI&gt;
&lt;LI&gt;thereby, I must assume that my first ACK is for the first triggered action, and so on.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;My transaction command would looks like:&lt;BR /&gt;
&lt;CODE&gt;| transaction unit, option startswith="trigger" endswith="ack"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But it seems that Splunk is associating the first ACK event that match my transaction conditions with the last transaction it has opened. I would expect it to work the opposite way, or at least, I wish I could ask it to do so.&lt;/P&gt;

&lt;P&gt;Here is a short data sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2015-12-28 20:02:02 action=ack unit=foobar option=disabled id=13
2015-12-28 20:02:00 action=ack unit=foobar option=enabled id=7
2015-12-28 20:02:00 action=ack unit=foobar option=disabled id=3
2015-12-28 20:01:59 action=trigger unit=foobar option=disabled
2015-12-28 20:01:59 action=ack unit=foobar option=enabled id=1
2015-12-28 20:01:18 action=trigger unit=foobar option=enabled
2015-12-28 20:00:57 action=trigger unit=foobar option=disabled
2015-12-28 20:00:17 action=trigger unit=foobar option=enabled
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The command mentioned above is returning something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2015-12-28 20:01:59 action=trigger unit=foobar option=disabled
2015-12-28 20:02:00 action=ack unit=foobar option=disabled id=3
---
2015-12-28 20:01:18 action=trigger unit=foobar option=enabled
2015-12-28 20:01:59 action=ack unit=foobar option=enabled id=1
---
2015-12-28 20:00:57 action=trigger unit=foobar option=disabled
2015-12-28 20:02:02 action=ack unit=foobar option=disabled id=13
---
2015-12-28 20:00:17 action=trigger unit=foobar option=enabled
2015-12-28 20:02:00 action=ack unit=foobar option=enabled id=7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I would expect:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2015-12-28 20:01:59 action=trigger unit=foobar option=disabled
2015-12-28 20:02:02 action=ack unit=foobar option=disabled id=13
---
2015-12-28 20:01:18 action=trigger unit=foobar option=enabled
2015-12-28 20:02:00 action=ack unit=foobar option=enabled id=7
---
2015-12-28 20:00:57 action=trigger unit=foobar option=disabled
2015-12-28 20:02:00 action=ack unit=foobar option=disabled id=3
---
2015-12-28 20:00:17 action=trigger unit=foobar option=enabled
2015-12-28 20:01:59 action=ack unit=foobar option=enabled id=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope I was clear enough and thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-the-transaction-command-process-the/m-p/202882#M58899</guid>
      <dc:creator>sttang88</dc:creator>
      <dc:date>2020-09-29T08:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order the transaction command process the opened txn?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-the-transaction-command-process-the/m-p/202883#M58900</link>
      <description>&lt;P&gt;How about something like this... you should be able to build on it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats count as c by action | sort c
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Dec 2015 17:36:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-the-transaction-command-process-the/m-p/202883#M58900</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-12-30T17:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order the transaction command process the opened txn?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-the-transaction-command-process-the/m-p/202884#M58901</link>
      <description>&lt;P&gt;Thanks @sundareshr!&lt;/P&gt;

&lt;P&gt;I finally had to add all the fields used in my transaction to the &lt;CODE&gt;streamstats count&lt;/CODE&gt; to make it work.&lt;/P&gt;

&lt;P&gt;For futur record, here is my final query:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
| streamstats count AS c by unit, option, action&lt;BR /&gt;
| sort c&lt;BR /&gt;
| transaction unit, option, c&lt;BR /&gt;
startswith="trigger"&lt;BR /&gt;
endswith="ack"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 23:00:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-the-transaction-command-process-the/m-p/202884#M58901</guid>
      <dc:creator>sttang88</dc:creator>
      <dc:date>2015-12-30T23:00:19Z</dc:date>
    </item>
  </channel>
</rss>

