<?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 Using Transaction Command more than once in the query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-Transaction-Command-more-than-once-in-the-query/m-p/481500#M134949</link>
    <description>&lt;P&gt;My Query - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abcd sourcetype=applog  OR (sourcetype=nginx AND uri=/v1/abcd)
| transaction startswith="status=201" endswith="className=SYSTEM resourceName=/event/v1/util" |  rename duration as stageTime1
| transaction startswith="className=SYSTEM resourceName=/event/v1/util" endswith="className=secondClass (start MyEventProducer)" |  rename duration as stageTime2
| timechart span=1h avg(stageTime1), avg(stageTime2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query gives result if i run single transaction command at a time. But when I run it together (Like How i mentioned above) its giving emptuy result. Is it not possible to calculate duration for separate stages in a single query ?&lt;/P&gt;</description>
    <pubDate>Sun, 10 Nov 2019 17:58:13 GMT</pubDate>
    <dc:creator>vickyvishwa</dc:creator>
    <dc:date>2019-11-10T17:58:13Z</dc:date>
    <item>
      <title>Using Transaction Command more than once in the query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Transaction-Command-more-than-once-in-the-query/m-p/481500#M134949</link>
      <description>&lt;P&gt;My Query - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abcd sourcetype=applog  OR (sourcetype=nginx AND uri=/v1/abcd)
| transaction startswith="status=201" endswith="className=SYSTEM resourceName=/event/v1/util" |  rename duration as stageTime1
| transaction startswith="className=SYSTEM resourceName=/event/v1/util" endswith="className=secondClass (start MyEventProducer)" |  rename duration as stageTime2
| timechart span=1h avg(stageTime1), avg(stageTime2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query gives result if i run single transaction command at a time. But when I run it together (Like How i mentioned above) its giving emptuy result. Is it not possible to calculate duration for separate stages in a single query ?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 17:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Transaction-Command-more-than-once-in-the-query/m-p/481500#M134949</guid>
      <dc:creator>vickyvishwa</dc:creator>
      <dc:date>2019-11-10T17:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Transaction Command more than once in the query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Transaction-Command-more-than-once-in-the-query/m-p/481501#M134950</link>
      <description>&lt;P&gt;Is n’t it zero?&lt;BR /&gt;
I think the second transaction doesn't return a value because there is no keyword in _raw.&lt;/P&gt;

&lt;P&gt;Is it all right to be grouped like this in the first place? stageTime1 is multi-field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;KEY,stageTime1
A1,10
A2,20
A3,10
B1,10
B2,20
B3,30

KEY,stageTime1,stageTime2
A,10,100
  20
  10
B,10,500
  20
  30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If there is no parent-child relationship between two transactions, how about calculating and merging them separately?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(your search transaction1)|  rename duration as stageTime1
|timechart span=1h avg(stageTime1) as stageTime1
|append [search (your search transaction2)|  rename duration as stageTime2
|timechart span=1h avg(stageTime2) as stageTime2]
|stats latest(*) as * by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 07:04:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Transaction-Command-more-than-once-in-the-query/m-p/481501#M134950</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-11-11T07:04:51Z</dc:date>
    </item>
  </channel>
</rss>

