<?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: Can anyone explain how this transaction search for average request execution works? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258676#M77483</link>
    <description>&lt;P&gt;Let's break up this search into its parts&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main sourcetype=access_combined OR sourcetype=log4j
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;pretty straight forward: take the events from the main index, sourcetypes access_combined or log4j&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval action=substr(uri_path,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;create a new field &lt;CODE&gt;action&lt;/CODE&gt; by extracting a substring out of the field &lt;CODE&gt;uri_path&lt;/CODE&gt; from the second char&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval action=lower(if(isnull(action),requestType,action))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;checks if the field &lt;CODE&gt;action&lt;/CODE&gt; is empty (isnull). If so, &lt;CODE&gt;action&lt;/CODE&gt; takes the value of the field &lt;CODE&gt;requestType&lt;/CODE&gt;, otherwise the value of action remains the same. The field value is converted to lower case.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval JSESSIONID=if(isnull(JSESSIONID),sessionId,JSESSIONID)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;checks if the field &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; is null. If so, &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; takes the value of the field &lt;CODE&gt;sessionID&lt;/CODE&gt;, otherwise the value of action remains the same. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | transaction threadId, JSESSIONID, action maxspan=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;creates a transaction with the fields &lt;CODE&gt;threadId&lt;/CODE&gt; and &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; with a maximum duration of 1 minute - that is, checking all events within one minute, where the values of threadId and JSESSIONID are identical, and combining them to one transaction. Check &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/Transaction&lt;/A&gt; for more details.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats avg(duration) AS Avg_Request_Execution_Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;create a stats table for the average value of &lt;CODE&gt;duration&lt;/CODE&gt; - which is a field created by the &lt;CODE&gt;transaction&lt;/CODE&gt; command - and naming this field &lt;CODE&gt;Avg_Request_Execution_Time&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Any further details needed? Feel free to comment!&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2015 09:06:50 GMT</pubDate>
    <dc:creator>DMohn</dc:creator>
    <dc:date>2015-12-01T09:06:50Z</dc:date>
    <item>
      <title>Can anyone explain how this transaction search for average request execution works?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258675#M77482</link>
      <description>&lt;P&gt;Can anyone please explain this search? It's for average request execution:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=access_combined OR sourcetype=log4j 
| eval action=substr(uri_path,2) 
| eval action=lower(if(isnull(action),requestType,action)) 
| eval JSESSIONID=if(isnull(JSESSIONID),sessionId,JSESSIONID) 
| transaction threadId, JSESSIONID, action maxspan=1m 
| stats avg(duration) AS Avg_Request_Execution_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Dec 2015 04:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258675#M77482</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2015-12-01T04:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone explain how this transaction search for average request execution works?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258676#M77483</link>
      <description>&lt;P&gt;Let's break up this search into its parts&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main sourcetype=access_combined OR sourcetype=log4j
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;pretty straight forward: take the events from the main index, sourcetypes access_combined or log4j&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval action=substr(uri_path,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;create a new field &lt;CODE&gt;action&lt;/CODE&gt; by extracting a substring out of the field &lt;CODE&gt;uri_path&lt;/CODE&gt; from the second char&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval action=lower(if(isnull(action),requestType,action))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;checks if the field &lt;CODE&gt;action&lt;/CODE&gt; is empty (isnull). If so, &lt;CODE&gt;action&lt;/CODE&gt; takes the value of the field &lt;CODE&gt;requestType&lt;/CODE&gt;, otherwise the value of action remains the same. The field value is converted to lower case.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval JSESSIONID=if(isnull(JSESSIONID),sessionId,JSESSIONID)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;checks if the field &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; is null. If so, &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; takes the value of the field &lt;CODE&gt;sessionID&lt;/CODE&gt;, otherwise the value of action remains the same. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | transaction threadId, JSESSIONID, action maxspan=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;creates a transaction with the fields &lt;CODE&gt;threadId&lt;/CODE&gt; and &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; with a maximum duration of 1 minute - that is, checking all events within one minute, where the values of threadId and JSESSIONID are identical, and combining them to one transaction. Check &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/Transaction&lt;/A&gt; for more details.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats avg(duration) AS Avg_Request_Execution_Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;create a stats table for the average value of &lt;CODE&gt;duration&lt;/CODE&gt; - which is a field created by the &lt;CODE&gt;transaction&lt;/CODE&gt; command - and naming this field &lt;CODE&gt;Avg_Request_Execution_Time&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Any further details needed? Feel free to comment!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 09:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258676#M77483</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2015-12-01T09:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone explain how this transaction search for average request execution works?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258677#M77484</link>
      <description>&lt;P&gt;It is gathering up all events for a web session or jsession by using the &lt;CODE&gt;transaction&lt;/CODE&gt; command which also calculates a &lt;CODE&gt;duration&lt;/CODE&gt; field for each session from which an average can be calculated.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 09:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258677#M77484</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-12-01T09:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone explain how this transaction search for average request execution works?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258678#M77485</link>
      <description>&lt;P&gt;Thanks for the explanation...i still have a question..&lt;/P&gt;

&lt;P&gt;for the search below,  you said it's extracting substring out of uri_path..here're the field values for uri_path.&lt;BR /&gt;
/viewcart , /updatecart, /updateitem...etc&lt;/P&gt;

&lt;P&gt;Is it necessary to extract a substring, if it's how does it work...can you please explain..&lt;/P&gt;

&lt;P&gt;| eval action=substr(uri_path,2)&lt;BR /&gt;
create a new field action by extracting a substring out of the field uri_path from the second char&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:03:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258678#M77485</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2020-09-29T08:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone explain how this transaction search for average request execution works?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258679#M77486</link>
      <description>&lt;P&gt;Sorry for the delay ...&lt;/P&gt;

&lt;P&gt;As you stated, the values for uri_path all start with a slash char '/' - the substr command just removes the leading slash from the value, so this is (more or less) just a 'cosmetic correction'. Now you are able to search for &lt;CODE&gt;action=viewcart&lt;/CODE&gt; - which is much nicer than having to search for &lt;CODE&gt;action="/viewcart"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 10:01:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258679#M77486</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2016-01-05T10:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone explain how this transaction search for average request execution works?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258680#M77487</link>
      <description>&lt;P&gt;Got it.. Thanks much..!!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 19:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-anyone-explain-how-this-transaction-search-for-average/m-p/258680#M77487</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2016-01-05T19:17:49Z</dc:date>
    </item>
  </channel>
</rss>

