<?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 query for transactions or grouping events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/query-for-transactions-or-grouping-events/m-p/543472#M153936</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have the below logs in splunk and i'm looking for query to get the time taken to compete the run by each bot for each scheduled run(Run bot deployed is the start of the bot and Run bot finished is the end of the bot).A bot can run more than once in a day and need average run time as well.I tried using transaction command but not getting desired results.&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;P&gt;11/03/2021 22:22:20.600 STATUS=Successful,ACTIVITY AT=2021-03-11T22:22:19Z,ACTION TYPE=Run bot finished,ITEM NAME=fin_bot&lt;BR /&gt;11/03/2021 22:00:27.000 STATUS=Successful,ACTIVITY AT=2021-03-11T22:00:26Z,ACTION TYPE=Run bot Deployed,ITEM NAME=fin_bot&lt;BR /&gt;11/03/2021 15:20:04.400 STATUS=Successful,ACTIVITY AT=2021-03-11T15:20:04Z,ACTION TYPE=Run bot finished,ITEM NAME=fin_bot&lt;BR /&gt;11/03/2021 15:00:23.000 STATUS=Successful,ACTIVITY AT=2021-03-11T15:00:22Z,ACTION TYPE=Run bot Deployed,ITEM NAME=fin_bot&lt;BR /&gt;12/03/2021 04:02:15.800 STATUS=Successful,ACTIVITY AT=2021-03-12T04:02:14Z,ACTION TYPE=Run bot finished,ITEM NAME=tax_bot&lt;BR /&gt;12/03/2021 04:00:23.780 STATUS=Successful,ACTIVITY AT=2021-03-12T04:00:23Z,ACTION TYPE=Run bot Deployed,ITEM NAME=tax_bot&lt;/P&gt;</description>
    <pubDate>Fri, 12 Mar 2021 04:50:30 GMT</pubDate>
    <dc:creator>splunk_ier</dc:creator>
    <dc:date>2021-03-12T04:50:30Z</dc:date>
    <item>
      <title>query for transactions or grouping events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-transactions-or-grouping-events/m-p/543472#M153936</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have the below logs in splunk and i'm looking for query to get the time taken to compete the run by each bot for each scheduled run(Run bot deployed is the start of the bot and Run bot finished is the end of the bot).A bot can run more than once in a day and need average run time as well.I tried using transaction command but not getting desired results.&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;P&gt;11/03/2021 22:22:20.600 STATUS=Successful,ACTIVITY AT=2021-03-11T22:22:19Z,ACTION TYPE=Run bot finished,ITEM NAME=fin_bot&lt;BR /&gt;11/03/2021 22:00:27.000 STATUS=Successful,ACTIVITY AT=2021-03-11T22:00:26Z,ACTION TYPE=Run bot Deployed,ITEM NAME=fin_bot&lt;BR /&gt;11/03/2021 15:20:04.400 STATUS=Successful,ACTIVITY AT=2021-03-11T15:20:04Z,ACTION TYPE=Run bot finished,ITEM NAME=fin_bot&lt;BR /&gt;11/03/2021 15:00:23.000 STATUS=Successful,ACTIVITY AT=2021-03-11T15:00:22Z,ACTION TYPE=Run bot Deployed,ITEM NAME=fin_bot&lt;BR /&gt;12/03/2021 04:02:15.800 STATUS=Successful,ACTIVITY AT=2021-03-12T04:02:14Z,ACTION TYPE=Run bot finished,ITEM NAME=tax_bot&lt;BR /&gt;12/03/2021 04:00:23.780 STATUS=Successful,ACTIVITY AT=2021-03-12T04:00:23Z,ACTION TYPE=Run bot Deployed,ITEM NAME=tax_bot&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 04:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-transactions-or-grouping-events/m-p/543472#M153936</guid>
      <dc:creator>splunk_ier</dc:creator>
      <dc:date>2021-03-12T04:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: query for transactions or grouping events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-transactions-or-grouping-events/m-p/543477#M153939</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232412"&gt;@splunk_ier&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Use transaction command with satrtwith and endswith options like below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=INDEX sourcetype=sourcetype
| transaction startswith="Run bot Deployed" endswith="Run bot finished" 
| table _raw, duration, eventcount&lt;/LI-CODE&gt;&lt;P&gt;For calculating average of duration extract field "ITEM NAME" if it does not exist and use stats.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=INDEX sourcetype=sourcetype
| rex "ITEM NAME=(?&amp;lt;ITEM_NAME&amp;gt;[^,]+)$" 
| transaction startswith="Run bot Deployed" endswith="Run bot finished" 
| stats avg(duration) as avg_duration_sec by ITEM_NAME&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, an upvote/like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 06:31:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-transactions-or-grouping-events/m-p/543477#M153939</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-03-12T06:31:18Z</dc:date>
    </item>
  </channel>
</rss>

