<?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 Status of a transaction using splunk transaction command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589971#M205410</link>
    <description>&lt;P&gt;i am using transaction command to check the start time and end time of a transaction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used:&lt;/P&gt;&lt;P&gt;| transaction TxnId startswith="NEW TXN" endswith= "statusY" keeporphans=true | eval starttime=_time | eval endtime=_time+duration | eval starttime=strftime('starttime', "%Y-%m-%d %H:%M:%S.%3N") | eval endtime=strftime('endtime', "%Y-%m-%d %H:%M:%S.%3N") | table TxnId&amp;nbsp;starttime&amp;nbsp;endtime&lt;/P&gt;&lt;P&gt;I want to check if all transactions have start time and end time for the success rate. Now even if the endswith="statusY" is not there, it is calculating its end time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What can i do to make sure there should be no end time if the condition endswith="statusY" is not there. And if the condition of both startswith and endswith is met table should show status as success or else blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 10:42:34 GMT</pubDate>
    <dc:creator>ayush-choudhary</dc:creator>
    <dc:date>2022-03-21T10:42:34Z</dc:date>
    <item>
      <title>Status of a transaction using splunk transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589971#M205410</link>
      <description>&lt;P&gt;i am using transaction command to check the start time and end time of a transaction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used:&lt;/P&gt;&lt;P&gt;| transaction TxnId startswith="NEW TXN" endswith= "statusY" keeporphans=true | eval starttime=_time | eval endtime=_time+duration | eval starttime=strftime('starttime', "%Y-%m-%d %H:%M:%S.%3N") | eval endtime=strftime('endtime', "%Y-%m-%d %H:%M:%S.%3N") | table TxnId&amp;nbsp;starttime&amp;nbsp;endtime&lt;/P&gt;&lt;P&gt;I want to check if all transactions have start time and end time for the success rate. Now even if the endswith="statusY" is not there, it is calculating its end time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What can i do to make sure there should be no end time if the condition endswith="statusY" is not there. And if the condition of both startswith and endswith is met table should show status as success or else blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 10:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589971#M205410</guid>
      <dc:creator>ayush-choudhary</dc:creator>
      <dc:date>2022-03-21T10:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Status of a transaction using splunk transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589974#M205413</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241793"&gt;@ayush-choudhary&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the transaction command is a very slow and expensive command, please try a different approach:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search ("NEW TXN" OR "statusY")
| stats earliest(_time) AS starttime latest(_time) AS endtime BY TxnId 
| eval starttime=strftime('starttime', "%Y-%m-%d %H:%M:%S.%3N"), endtime=strftime('endtime', "%Y-%m-%d %H:%M:%S.%3N") 
| table TxnId starttime endtime&lt;/LI-CODE&gt;&lt;P&gt;This approach is possible when you have an ID to use to group events.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 10:48:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589974#M205413</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-21T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Status of a transaction using splunk transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589977#M205415</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks, but with this query as well i am getting an endtime for a TxnId for with there is no "statusY"&lt;BR /&gt;i am finding something with can show me no value for endtime for a TxnId that do not have "statusY".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 10:57:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589977#M205415</guid>
      <dc:creator>ayush-choudhary</dc:creator>
      <dc:date>2022-03-21T10:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Status of a transaction using splunk transaction command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589981#M205416</link>
      <description>&lt;P&gt;Hi, ok, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search ("NEW TXN" OR "statusY")
| stats earliest(_time) AS starttime latest(_time) AS endtime count BY TxnId 
| eval 
     status=case(count=2,"Both present",searchmatch("NEW TXN"),"Only NEW TXN",searchmatch("statusY"),"Only statusY"), 
     starttime=strftime('starttime', "%Y-%m-%d %H:%M:%S.%3N"), 
     endtime=strftime('endtime', "%Y-%m-%d %H:%M:%S.%3N") 
| table TxnId starttime endtime status&lt;/LI-CODE&gt;&lt;P&gt;in this way you can identify all the conditions and take only the ones you want.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 11:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Status-of-a-transaction-using-splunk-transaction-command/m-p/589981#M205416</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-21T11:11:03Z</dc:date>
    </item>
  </channel>
</rss>

