<?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 Getting average response after joining 2 sourcetypes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496989#M138450</link>
    <description>&lt;P&gt;Hello Splunk Community,&lt;/P&gt;

&lt;P&gt;I am trying to create dashboard with the following query but the query returns no results. I am using the query to: &lt;BR /&gt;
extract the batch size and duration (they are in different source types. duration is in sourcetype = "AAA"and batch size is in sourcetype = "BBB")  than extract the batch size =1, find the duration for that same request by joint both events using transaction ID and search for batch size = 1. But when I add the following line:&lt;/P&gt;

&lt;P&gt;| timechart span=5m eval(round(avg(duration),0)) as AVG_Response_Time(ms) | search "AVG_Response_Time(ms)" &amp;gt; 10 &lt;/P&gt;

&lt;P&gt;the query return noting. &lt;/P&gt;

&lt;P&gt;index =ose_index  source="&lt;EM&gt;ent-splunk-pyx&lt;/EM&gt;" (svc=/service/detokenize AND "duration") OR ("Batch Detokenization Operation, batch size:")&lt;BR /&gt;
| rex field=&lt;EM&gt;raw "Batch Detokenization Operation, batch size: (?\d+)" &lt;BR /&gt;
| rex field=_raw "txid=(?([a-z0-9&lt;/EM&gt;.-]+))"&lt;BR /&gt;
| eval duration = round(duration/1000, 3) &lt;BR /&gt;
| stats max(duration) as Duration values(Batch_Size) as Batch_Size by ID&lt;BR /&gt;
| search Duration=* Batch_Size=1&lt;BR /&gt;
| timechart span=5m eval(round(avg(duration),0)) as AVG_Response_Time(ms) | search "AVG_Response_Time(ms)" &amp;gt; 10&lt;/P&gt;

&lt;P&gt;If I remove the last line and use "| stats avg(Duration) " I am getting the avg  result but this is not the way I want it. I must use "| timechart span=5m eval(round(avg(duration),0)) as AVG_Response_Time(ms) | search "AVG_Response_Time(ms)" &amp;gt; 10" because it is a part of a template that the company is using and I can't change this part. &lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:39:15 GMT</pubDate>
    <dc:creator>dminev1</dc:creator>
    <dc:date>2020-09-30T04:39:15Z</dc:date>
    <item>
      <title>Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496989#M138450</link>
      <description>&lt;P&gt;Hello Splunk Community,&lt;/P&gt;

&lt;P&gt;I am trying to create dashboard with the following query but the query returns no results. I am using the query to: &lt;BR /&gt;
extract the batch size and duration (they are in different source types. duration is in sourcetype = "AAA"and batch size is in sourcetype = "BBB")  than extract the batch size =1, find the duration for that same request by joint both events using transaction ID and search for batch size = 1. But when I add the following line:&lt;/P&gt;

&lt;P&gt;| timechart span=5m eval(round(avg(duration),0)) as AVG_Response_Time(ms) | search "AVG_Response_Time(ms)" &amp;gt; 10 &lt;/P&gt;

&lt;P&gt;the query return noting. &lt;/P&gt;

&lt;P&gt;index =ose_index  source="&lt;EM&gt;ent-splunk-pyx&lt;/EM&gt;" (svc=/service/detokenize AND "duration") OR ("Batch Detokenization Operation, batch size:")&lt;BR /&gt;
| rex field=&lt;EM&gt;raw "Batch Detokenization Operation, batch size: (?\d+)" &lt;BR /&gt;
| rex field=_raw "txid=(?([a-z0-9&lt;/EM&gt;.-]+))"&lt;BR /&gt;
| eval duration = round(duration/1000, 3) &lt;BR /&gt;
| stats max(duration) as Duration values(Batch_Size) as Batch_Size by ID&lt;BR /&gt;
| search Duration=* Batch_Size=1&lt;BR /&gt;
| timechart span=5m eval(round(avg(duration),0)) as AVG_Response_Time(ms) | search "AVG_Response_Time(ms)" &amp;gt; 10&lt;/P&gt;

&lt;P&gt;If I remove the last line and use "| stats avg(Duration) " I am getting the avg  result but this is not the way I want it. I must use "| timechart span=5m eval(round(avg(duration),0)) as AVG_Response_Time(ms) | search "AVG_Response_Time(ms)" &amp;gt; 10" because it is a part of a template that the company is using and I can't change this part. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496989#M138450</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2020-09-30T04:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496990#M138451</link>
      <description>&lt;P&gt;Try rewriting your last line as follows:&lt;BR /&gt;
| eval(round(avg(duration),0)) as AVG_Response_Time(ms) | timechart span=5m | search "AVG_Response_Time(ms)" &amp;gt; 10,try rewriting your line as follows:&lt;/P&gt;

&lt;P&gt;| eval(round(avg(duration),0)) as AVG_Response_Time(ms) | timechart span=5m | search "AVG_Response_Time(ms)" &amp;gt; 10&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496990#M138451</guid>
      <dc:creator>ttilstra</dc:creator>
      <dc:date>2020-09-30T04:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496991#M138452</link>
      <description>&lt;P&gt;Try breaking the &lt;CODE&gt;timechart&lt;/CODE&gt; command apart.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=5m avg(Duration) as ART
| eval ART=round(ART,0)
| where ART &amp;gt; 10
| rename ART as "AVG_Response_Time(ms)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Mar 2020 16:57:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496991#M138452</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-17T16:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496992#M138453</link>
      <description>&lt;P&gt;I did try your suggestion and broke timechart. Still no result for average &lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 17:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496992#M138453</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2020-03-17T17:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496993#M138454</link>
      <description>&lt;P&gt;I missed it the first time.  "duration" should be "Duration".  Updated my answer.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 17:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496993#M138454</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-17T17:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496994#M138455</link>
      <description>&lt;P&gt;I noticed this and made the change. Still no result &lt;/P&gt;

&lt;P&gt;This is what I have now: &lt;/P&gt;

&lt;P&gt;index =ose_index source="ent-splunk-pyx" (svc=/service/detokenize AND "duration") OR ("Batch Detokenization Operation, batch size:")&lt;BR /&gt;
| rex field=&lt;EM&gt;raw "Batch Detokenization Operation, batch size: (?\d+)" &lt;BR /&gt;
| rex field=_raw "txid=(?([a-z0-9&lt;/EM&gt;.-]+))"&lt;BR /&gt;
| eval duration = round(duration/1000, 3) &lt;BR /&gt;
| stats max(duration) as Duration values(Batch_Size) as Batch_Size by ID&lt;BR /&gt;
| search Duration=* Batch_Size=1&lt;BR /&gt;
| timechart span=5m avg(Duration) as ART&lt;BR /&gt;
| eval ART=round(ART,0)&lt;BR /&gt;
| where ART &amp;gt; 10&lt;BR /&gt;
| rename ART as "AVG_Response_Time(ms)"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496994#M138455</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2020-09-30T04:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496995#M138456</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index =ose_index  source="*ent-splunk-pyx*" (svc=/service/detokenize AND "duration") OR ("Batch Detokenization Operation, batch size:")
| rex field=_raw "Batch Detokenization Operation, batch size: (?\d+)" 
| rex field=_raw "txid=(?([a-z0-9_\.-]+))"
| eventstats values(Batch_Size) AS Batch_Size BY ID
| search duration="*" AND Batch_Size="1"
| timechart span=5m eval(round(avg(duration/1000),0)) as AVG_Response_Time(ms) 
| search "AVG_Response_Time(ms)" &amp;gt; 10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Mar 2020 02:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496995#M138456</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-18T02:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting average response after joining 2 sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496996#M138457</link>
      <description>&lt;P&gt;When I run the query I am getting the following error:&lt;/P&gt;

&lt;P&gt;Error in 'timechart' command: The eval expression has no fields: 'round(avg(duration/1000),0)'.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 12:28:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-average-response-after-joining-2-sourcetypes/m-p/496996#M138457</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2020-03-18T12:28:51Z</dc:date>
    </item>
  </channel>
</rss>

