<?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 can I find delta between events using transaction command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578828#M201728</link>
    <description>&lt;P&gt;You can combine transaction with streamstats. &amp;nbsp;I'll illustrate two slightly different tweaks.&lt;/P&gt;&lt;P&gt;The first is perhaps closest to the described end result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;agent&amp;gt;\w+)\s-\s(?&amp;lt;event&amp;gt;.+)"
| rex field=event "Account: (?&amp;lt;account&amp;gt;[^\,]*), SiteID: (?&amp;lt;siteID&amp;gt;[^\s]*) - (?&amp;lt;duration_in_ms&amp;gt;[^\s]*) milliseconds on Requestor: (?&amp;lt;requestor&amp;gt;[^\,]*)"
| reverse
| streamstats current=f last(_time) as last_time2 by agent
| eval current_time2 = _time
| eval delta= if(isnull(last_time2), "n/a", current_time2 - last_time2)
| eval event = strftime(_time, "%Y-%m-%d %H:%M:%S,%3Q") . " &amp;lt;" . delta . "&amp;gt; " . event
| eval last_time =if(isnull(last_time2), "n/a", strftime(last_time2, "%m/%d, %H:%M:%S.%6N"))
| reverse
| transaction agent endswith="Total Dashboard Load Time" startswith="Clicked on New"
| eval duration_in_sec=round(avg(duration_in_ms)/1000,2)
| rename event as flow
| table _time agent account siteID flow duration duration_in_sec last_time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first note is that the two reverse's will be very expensive for large volumes. &amp;nbsp;I removed delta as a column because transaction takes away its ordering; instead, "current time" and "delta" are both embedded into flow. &amp;nbsp;If desired, you can extract them out as columns for display purposes. (Note that delta "n/a" in the first event will be replaced by the delta between that event and the preceding last event.) &amp;nbsp;Additionally, "duration_in_sec" is actually the dashboard load time; duration of the transaction is provided by the transaction command, which I included for illustration. &amp;nbsp; Sample output as follows:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="106.71875px" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="50.59375px" height="25px"&gt;agent&lt;/TD&gt;&lt;TD width="97.40625px" height="25px"&gt;account&lt;/TD&gt;&lt;TD width="40px" height="25px"&gt;siteID&lt;/TD&gt;&lt;TD width="274.953125px" height="25px"&gt;&lt;DIV class=""&gt;flow&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="42.90625px" height="25px"&gt;duration&lt;/TD&gt;&lt;TD width="42.90625px" height="25px"&gt;duration_in_sec&lt;/TD&gt;&lt;TD width="135.515625px" height="25px"&gt;&lt;DIV class=""&gt;last_time&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="106.71875px" height="399px"&gt;2021-12-16 05:30:43.834&lt;/TD&gt;&lt;TD width="50.59375px" height="399px"&gt;alpha&lt;/TD&gt;&lt;TD width="97.40625px" height="399px"&gt;000111222&lt;/TD&gt;&lt;TD width="40px" height="399px"&gt;123&lt;/TD&gt;&lt;TD width="274.953125px" height="399px"&gt;&lt;DIV class=""&gt;2021-12-16 05:30:43,834 &amp;lt;n/a&amp;gt; Dashboard Load: User Clicked on New&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:30:46,498 &amp;lt;2.664000&amp;gt; Dashboard Load: User Clicked on AccountSearch&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:05,420 &amp;lt;18.922000&amp;gt; Dashboard Load: User Clicked on Search with String abcdef&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:08,557 &amp;lt;3.137000&amp;gt; Dashboard Load: User clicked on Searched Result 123456&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:12,234 &amp;lt;3.677000&amp;gt; Total Dashboard Load Time for Account: 000111222, SiteID: 123 - 3438.0 milliseconds on Requestor: xoxoxo&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="42.90625px" height="399px"&gt;28.4&lt;/TD&gt;&lt;TD width="42.90625px" height="399px"&gt;3.44&lt;/TD&gt;&lt;TD width="135.515625px" height="399px"&gt;&lt;DIV class=""&gt;12/16, 05:30:43.834000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:30:46.498000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:05.420000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:08.557000&lt;/DIV&gt;&lt;DIV class=""&gt;n/a&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second tweak is more economic because there is no reverse, but you have to tolerate some odd artifacts, or correct them in some way after you get the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;agent&amp;gt;\w+)\s-\s(?&amp;lt;event&amp;gt;.+)"
| rex field=event "Account: (?&amp;lt;account&amp;gt;[^\,]*), SiteID: (?&amp;lt;siteID&amp;gt;[^\s]*) - (?&amp;lt;duration_in_ms&amp;gt;[^\s]*) milliseconds on Requestor: (?&amp;lt;requestor&amp;gt;[^\,]*)"
| streamstats current=f last(_time) as last_time2 by agent
| eval current_time2 = _time
| eval delta= if(isnull(last_time2), "n/a", last_time2 - current_time2)
| eval event = strftime(_time, "%Y-%m-%d %H:%M:%S,%3Q") . " &amp;lt;" . delta . "&amp;gt; " . event
| eval last_time =if(isnull(last_time2), "n/a", strftime(last_time2, "%m/%d, %H:%M:%S.%6N"))
| transaction agent endswith="Total Dashboard Load Time" startswith="Clicked on New"
| eval duration_in_sec=round(avg(duration_in_ms)/1000,2)
| rename event as flow
| table _time agent account siteID flow duration duration_in_sec last_time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample result follows:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;agent&lt;/TD&gt;&lt;TD&gt;account&lt;/TD&gt;&lt;TD&gt;siteID&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;flow&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;duration&lt;/TD&gt;&lt;TD&gt;duration_in_sec&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;last_time&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-12-16 05:30:43.834&lt;/TD&gt;&lt;TD&gt;alpha&lt;/TD&gt;&lt;TD&gt;000111222&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;2021-12-16 05:30:43,834 &amp;lt;2.664000&amp;gt; Dashboard Load: User Clicked on New&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:30:46,498 &amp;lt;18.922000&amp;gt; Dashboard Load: User Clicked on AccountSearch&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:05,420 &amp;lt;3.137000&amp;gt; Dashboard Load: User Clicked on Search with String abcdef&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:08,557 &amp;lt;3.677000&amp;gt; Dashboard Load: User clicked on Searched Result 123456&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:12,234 &amp;lt;n/a&amp;gt; Total Dashboard Load Time for Account: 000111222, SiteID: 123 - 3438.0 milliseconds on Requestor: xoxoxo&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;28.4&lt;/TD&gt;&lt;TD&gt;3.44&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;12/16, 05:30:46.498000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:05.420000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:08.557000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:12.234000&lt;/DIV&gt;&lt;DIV class=""&gt;n/a&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;You can see that the delta and "last_time" are misaligned by one event.&lt;/P&gt;&lt;P&gt;Hope these help.&lt;/P&gt;</description>
    <pubDate>Sat, 18 Dec 2021 21:20:16 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2021-12-18T21:20:16Z</dc:date>
    <item>
      <title>How can I find delta between events using transaction command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578787#M201711</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could retrieve the list of the transactions as a single event below. Transactions start with "Dashboard Load:" and end with "Total Dashboard Load Time"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Account: (?&amp;lt;account&amp;gt;[^\,]*), SiteID: (?&amp;lt;siteID&amp;gt;[^\s]*) - (?&amp;lt;duration_in_ms&amp;gt;[^\s]*) milliseconds on Requestor: (?&amp;lt;requestor&amp;gt;[^\,]*)"
| transaction agent endswith="Total Dashboard Load Time"
| eval duration_in_sec=round(avg(duration_in_ms)/1000,2)
| table agent account siteID flow duration_in_sec&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could find the delta between each event as multiple events with below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Account: (?&amp;lt;account&amp;gt;[^\,]*), SiteID: (?&amp;lt;siteID&amp;gt;[^\s]*) - (?&amp;lt;duration_in_ms&amp;gt;[^\s]*) milliseconds on Requestor: (?&amp;lt;requestor&amp;gt;[^\,]*)"
| streamstats current=f last(_time) as last_time2 by agent
| rename _time as current_time2
| eval delta= last_time2 - current_time2
| eval last_time =strftime(last_time2, "%m/%d, %H:%M:%S.%6N")
| eval current_time =strftime(current_time2, "%m/%d, %H:%M:%S.%6N")
| table agent account siteID flow duration_in_sec last_time current_time delta&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to see if I can find a delta between events in a single transaction. The transaction starts with "Dashboard Load" and ends with "Total Dashboard Load Time"&lt;/P&gt;&lt;P&gt;Expected Result Format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;agent, account, siteID, list of flow (all 5 Dashboard Load actions), duration_in_sec, list of event times, list of delta between event time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;agent - the name of the agent&lt;/LI&gt;&lt;LI&gt;account - account #&lt;/LI&gt;&lt;LI&gt;siteID - site#&lt;/LI&gt;&lt;LI&gt;list of flow - all action flows&lt;/LI&gt;&lt;LI&gt;durations_in_sec - Total Dashboard Load Time&lt;/LI&gt;&lt;LI&gt;list of event times - List showing all event time&lt;/LI&gt;&lt;LI&gt;list of the delta between event time - List showing 4 delta times between each flow&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are a sample of 2 data of 5 events&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2021-12-16 05:30:43,834 alpha - Dashboard Load: User Clicked on New
2021-12-16 05:30:46,498 alpha - Dashboard Load: User Clicked on AccountSearch
2021-12-16 05:31:05,420 alpha - Dashboard Load: User Clicked on Search with String abcdef
2021-12-16 05:31:08,557 alpha - Dashboard Load: User clicked on Searched Result 123456
2021-12-16 05:31:12,234 alpha - Total Dashboard Load Time for Account: 000111222, SiteID: 123- 3438.0 milliseconds on Requestor: xoxoxo&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 16:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578787#M201711</guid>
      <dc:creator>limalbert</dc:creator>
      <dc:date>2021-12-18T16:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I find delta between events using transaction command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578818#M201726</link>
      <description>&lt;P&gt;Based on your sample code and data, I am guessing that &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multivaluefunctions#values.28X.29" target="_self"&gt;values(X)&lt;/A&gt;&amp;nbsp;and &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multivaluefunctions#list.28X.29" target="_blank" rel="noopener"&gt;list(X)&lt;/A&gt; are what you are looking for, not transaction, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;agent&amp;gt;\w+)\s-\s(?&amp;lt;event&amp;gt;.+)" ```I have to guess that "alpha" is agent```
| rex field=event "Account: (?&amp;lt;account&amp;gt;[^\,]*), SiteID: (?&amp;lt;siteID&amp;gt;[^\s]*) - (?&amp;lt;duration_in_ms&amp;gt;[^\s]*) milliseconds on Requestor: (?&amp;lt;requestor&amp;gt;[^\,]*)"
| streamstats current=f last(_time) as last_time2 by agent
| rename _time as current_time2
| eval delta= if(isnull(last_time2), "n/a", last_time2 - current_time2)
| eval last_time =if(isnull(last_time2), "n/a", strftime(last_time2, "%m/%d, %H:%M:%S.%6N"))
| eval current_time =strftime(current_time2, "%m/%d, %H:%M:%S.%6N")
| eval duration_in_sec=round(avg(duration_in_ms)/1000,2)

| stats values(account) as account values(siteID) as siteID values(duration_in_sec) as duration_in_sec list(event) as flow list(current_time) as current_time list(last_time) as last_time list(delta) as delta by agent
| table agent account siteID flow duration_in_sec last_time current_time delta&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 08:40:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578818#M201726</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-18T08:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I find delta between events using transaction command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578824#M201727</link>
      <description>&lt;P&gt;I would need transaction because each transaction starts with the event of "Total Dashboard Load Time" and ends with "Total Dashboard Load Time for Account:". I would need to group these events together and find the delta for each event in a transaction (in this case 5 events)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 16:56:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578824#M201727</guid>
      <dc:creator>limalbert</dc:creator>
      <dc:date>2021-12-18T16:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I find delta between events using transaction command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578828#M201728</link>
      <description>&lt;P&gt;You can combine transaction with streamstats. &amp;nbsp;I'll illustrate two slightly different tweaks.&lt;/P&gt;&lt;P&gt;The first is perhaps closest to the described end result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;agent&amp;gt;\w+)\s-\s(?&amp;lt;event&amp;gt;.+)"
| rex field=event "Account: (?&amp;lt;account&amp;gt;[^\,]*), SiteID: (?&amp;lt;siteID&amp;gt;[^\s]*) - (?&amp;lt;duration_in_ms&amp;gt;[^\s]*) milliseconds on Requestor: (?&amp;lt;requestor&amp;gt;[^\,]*)"
| reverse
| streamstats current=f last(_time) as last_time2 by agent
| eval current_time2 = _time
| eval delta= if(isnull(last_time2), "n/a", current_time2 - last_time2)
| eval event = strftime(_time, "%Y-%m-%d %H:%M:%S,%3Q") . " &amp;lt;" . delta . "&amp;gt; " . event
| eval last_time =if(isnull(last_time2), "n/a", strftime(last_time2, "%m/%d, %H:%M:%S.%6N"))
| reverse
| transaction agent endswith="Total Dashboard Load Time" startswith="Clicked on New"
| eval duration_in_sec=round(avg(duration_in_ms)/1000,2)
| rename event as flow
| table _time agent account siteID flow duration duration_in_sec last_time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first note is that the two reverse's will be very expensive for large volumes. &amp;nbsp;I removed delta as a column because transaction takes away its ordering; instead, "current time" and "delta" are both embedded into flow. &amp;nbsp;If desired, you can extract them out as columns for display purposes. (Note that delta "n/a" in the first event will be replaced by the delta between that event and the preceding last event.) &amp;nbsp;Additionally, "duration_in_sec" is actually the dashboard load time; duration of the transaction is provided by the transaction command, which I included for illustration. &amp;nbsp; Sample output as follows:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="106.71875px" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="50.59375px" height="25px"&gt;agent&lt;/TD&gt;&lt;TD width="97.40625px" height="25px"&gt;account&lt;/TD&gt;&lt;TD width="40px" height="25px"&gt;siteID&lt;/TD&gt;&lt;TD width="274.953125px" height="25px"&gt;&lt;DIV class=""&gt;flow&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="42.90625px" height="25px"&gt;duration&lt;/TD&gt;&lt;TD width="42.90625px" height="25px"&gt;duration_in_sec&lt;/TD&gt;&lt;TD width="135.515625px" height="25px"&gt;&lt;DIV class=""&gt;last_time&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="106.71875px" height="399px"&gt;2021-12-16 05:30:43.834&lt;/TD&gt;&lt;TD width="50.59375px" height="399px"&gt;alpha&lt;/TD&gt;&lt;TD width="97.40625px" height="399px"&gt;000111222&lt;/TD&gt;&lt;TD width="40px" height="399px"&gt;123&lt;/TD&gt;&lt;TD width="274.953125px" height="399px"&gt;&lt;DIV class=""&gt;2021-12-16 05:30:43,834 &amp;lt;n/a&amp;gt; Dashboard Load: User Clicked on New&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:30:46,498 &amp;lt;2.664000&amp;gt; Dashboard Load: User Clicked on AccountSearch&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:05,420 &amp;lt;18.922000&amp;gt; Dashboard Load: User Clicked on Search with String abcdef&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:08,557 &amp;lt;3.137000&amp;gt; Dashboard Load: User clicked on Searched Result 123456&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:12,234 &amp;lt;3.677000&amp;gt; Total Dashboard Load Time for Account: 000111222, SiteID: 123 - 3438.0 milliseconds on Requestor: xoxoxo&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="42.90625px" height="399px"&gt;28.4&lt;/TD&gt;&lt;TD width="42.90625px" height="399px"&gt;3.44&lt;/TD&gt;&lt;TD width="135.515625px" height="399px"&gt;&lt;DIV class=""&gt;12/16, 05:30:43.834000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:30:46.498000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:05.420000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:08.557000&lt;/DIV&gt;&lt;DIV class=""&gt;n/a&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second tweak is more economic because there is no reverse, but you have to tolerate some odd artifacts, or correct them in some way after you get the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;agent&amp;gt;\w+)\s-\s(?&amp;lt;event&amp;gt;.+)"
| rex field=event "Account: (?&amp;lt;account&amp;gt;[^\,]*), SiteID: (?&amp;lt;siteID&amp;gt;[^\s]*) - (?&amp;lt;duration_in_ms&amp;gt;[^\s]*) milliseconds on Requestor: (?&amp;lt;requestor&amp;gt;[^\,]*)"
| streamstats current=f last(_time) as last_time2 by agent
| eval current_time2 = _time
| eval delta= if(isnull(last_time2), "n/a", last_time2 - current_time2)
| eval event = strftime(_time, "%Y-%m-%d %H:%M:%S,%3Q") . " &amp;lt;" . delta . "&amp;gt; " . event
| eval last_time =if(isnull(last_time2), "n/a", strftime(last_time2, "%m/%d, %H:%M:%S.%6N"))
| transaction agent endswith="Total Dashboard Load Time" startswith="Clicked on New"
| eval duration_in_sec=round(avg(duration_in_ms)/1000,2)
| rename event as flow
| table _time agent account siteID flow duration duration_in_sec last_time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample result follows:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;agent&lt;/TD&gt;&lt;TD&gt;account&lt;/TD&gt;&lt;TD&gt;siteID&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;flow&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;duration&lt;/TD&gt;&lt;TD&gt;duration_in_sec&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;last_time&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-12-16 05:30:43.834&lt;/TD&gt;&lt;TD&gt;alpha&lt;/TD&gt;&lt;TD&gt;000111222&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;2021-12-16 05:30:43,834 &amp;lt;2.664000&amp;gt; Dashboard Load: User Clicked on New&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:30:46,498 &amp;lt;18.922000&amp;gt; Dashboard Load: User Clicked on AccountSearch&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:05,420 &amp;lt;3.137000&amp;gt; Dashboard Load: User Clicked on Search with String abcdef&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:08,557 &amp;lt;3.677000&amp;gt; Dashboard Load: User clicked on Searched Result 123456&lt;/DIV&gt;&lt;DIV class=""&gt;2021-12-16 05:31:12,234 &amp;lt;n/a&amp;gt; Total Dashboard Load Time for Account: 000111222, SiteID: 123 - 3438.0 milliseconds on Requestor: xoxoxo&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;28.4&lt;/TD&gt;&lt;TD&gt;3.44&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;12/16, 05:30:46.498000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:05.420000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:08.557000&lt;/DIV&gt;&lt;DIV class=""&gt;12/16, 05:31:12.234000&lt;/DIV&gt;&lt;DIV class=""&gt;n/a&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;You can see that the delta and "last_time" are misaligned by one event.&lt;/P&gt;&lt;P&gt;Hope these help.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 21:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-find-delta-between-events-using-transaction-command/m-p/578828#M201728</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-18T21:20:16Z</dc:date>
    </item>
  </channel>
</rss>

