<?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 use transaction to break down the sub processes of a duration? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-transaction-to-break-down-the-sub-processes-of-a/m-p/339285#M100606</link>
    <description>&lt;P&gt;Give this a try (field extraction needs to be adjusted per your need)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search 
| rex "^(\S+\s+){4}Process (?&amp;lt;ProcessName&amp;gt;\S+)\s+(?&amp;lt;event_type&amp;gt;(start|end))"
| where isnotnull(event_type)
| chart values(_time) over ProcessName by event_type | eval duration=end-start
| table ProcessName duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Dec 2017 20:45:32 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-12-13T20:45:32Z</dc:date>
    <item>
      <title>How can I use transaction to break down the sub processes of a duration?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-transaction-to-break-down-the-sub-processes-of-a/m-p/339283#M100604</link>
      <description>&lt;P&gt;I have numerous exposures captured in the log with minimaly structured data like the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.
.
2017/12/11 13:06:33.156 S_LOG VIDEO Exposure(): entered
.
.
2017/12/11 13:06:33.234 S_LOG VIDEO Process A start
.
.
2017/12/11 13:06:34.796 S_LOG VIDEO Process A end
.
.
.
2017/12/11 13:06:35.210 S_LOG VIDEO Process B start
.
2017/12/11 13:06:35.952 S_LOG VIDEO Process B end
.
.
2017/12/11 13:06:37.077 S_LOG VIDEO Exposure(): exit
.
.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can get a nice chart of the overall exposure durations with something like the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt; | transaction VIDEO startswith="Exposure(): entered" endswith="Exposure(): exit" | chart count by duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But what I would really like to get is a more detailed chart showing on average how much of the duration is composed by each of the sub process A,B,C,...&lt;BR /&gt;
A Pie chart maybe...&lt;/P&gt;

&lt;P&gt;I've been reading through the Transaction documentation, but I'm getting lost in the details...  All help appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 18:42:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-transaction-to-break-down-the-sub-processes-of-a/m-p/339283#M100604</guid>
      <dc:creator>tucker28</dc:creator>
      <dc:date>2017-12-13T18:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use transaction to break down the sub processes of a duration?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-transaction-to-break-down-the-sub-processes-of-a/m-p/339284#M100605</link>
      <description>&lt;P&gt;I think streamstats is right up your alley. this is just a rough draft, you'll have to mess with it depending on your variables and whatnot.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval data="date=1512983193,type=VIDEO,session=Exposure_Entered date=1512983196,type=VIDEO,session=Process_A_Start date=1512983206,type=VIDEO,session=Process_A_End date=1512983300,type=VIDEO,session=Process_B_Start date=1512983345,type=VIDEO,session=Process_B_End date=1512983450,type=VIDEO,session=Exposure_Exit"|makemv data|mvexpand data|rename data as _raw|kv|rename date as _time|table _time type session|sort 0 _time|streamstats window=1 current=f values(session) as prev_session values(_time) as prev_time by type|eval duration=if(like(session,"%End"),_time-prev_time,null())
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Streamstats"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Streamstats&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 19:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-transaction-to-break-down-the-sub-processes-of-a/m-p/339284#M100605</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-12-13T19:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use transaction to break down the sub processes of a duration?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-transaction-to-break-down-the-sub-processes-of-a/m-p/339285#M100606</link>
      <description>&lt;P&gt;Give this a try (field extraction needs to be adjusted per your need)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search 
| rex "^(\S+\s+){4}Process (?&amp;lt;ProcessName&amp;gt;\S+)\s+(?&amp;lt;event_type&amp;gt;(start|end))"
| where isnotnull(event_type)
| chart values(_time) over ProcessName by event_type | eval duration=end-start
| table ProcessName duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Dec 2017 20:45:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-transaction-to-break-down-the-sub-processes-of-a/m-p/339285#M100606</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-13T20:45:32Z</dc:date>
    </item>
  </channel>
</rss>

