<?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 to calculate the average from the result of the range function? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193174#M55576</link>
    <description>&lt;P&gt;thanks for the replay, the function EventStats shows the total of each line, but I have to expose it to a single service&lt;/P&gt;

&lt;P&gt;index="nbdrest-performance" sourcetype="PerfNBDCustomTSV"| chart count min(ETms) max(ETms) range(ETms) by Service | eventstats avg(range(ETms)) | sort count | reverse&lt;/P&gt;

&lt;P&gt;Service1    122286  1   1113    1112    5120.341137&lt;BR /&gt;
Service2    63534   4   11109   11105   5120.341137&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jan 2015 15:18:39 GMT</pubDate>
    <dc:creator>carlpier</dc:creator>
    <dc:date>2015-01-14T15:18:39Z</dc:date>
    <item>
      <title>How to calculate the average from the result of the range function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193172#M55574</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I am looking for a way to calculate the avg from the result of the range function.&lt;BR /&gt;
Here is the simple base search which finds all values for exit_status:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="nbdrest-performance" sourcetype="PerfNBDCustomTSV"| chart count min(ETms) max(ETms) avg(ETms) stdev(ETms) median(ETms) mode(ETms) range(ETms) perc99(ETms) by Service | sort count | reverse
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have to calculate the avg from the result of  “range(ETms)”&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 11:35:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193172#M55574</guid>
      <dc:creator>carlpier</dc:creator>
      <dc:date>2015-01-14T11:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average from the result of the range function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193173#M55575</link>
      <description>&lt;P&gt;Easiest way to do this is use &lt;CODE&gt;eventstats&lt;/CODE&gt; to add it to your table:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...your search... | eventstats avg(range(ETms))&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 14:47:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193173#M55575</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-01-14T14:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average from the result of the range function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193174#M55576</link>
      <description>&lt;P&gt;thanks for the replay, the function EventStats shows the total of each line, but I have to expose it to a single service&lt;/P&gt;

&lt;P&gt;index="nbdrest-performance" sourcetype="PerfNBDCustomTSV"| chart count min(ETms) max(ETms) range(ETms) by Service | eventstats avg(range(ETms)) | sort count | reverse&lt;/P&gt;

&lt;P&gt;Service1    122286  1   1113    1112    5120.341137&lt;BR /&gt;
Service2    63534   4   11109   11105   5120.341137&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:18:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193174#M55576</guid>
      <dc:creator>carlpier</dc:creator>
      <dc:date>2015-01-14T15:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average from the result of the range function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193175#M55577</link>
      <description>&lt;P&gt;&lt;CODE&gt;eventstats&lt;/CODE&gt; &lt;STRONG&gt;is&lt;/STRONG&gt; computing the average of every entry in &lt;CODE&gt;range(ETms)&lt;/CODE&gt;,  and adding that result in a new column to each entry. If that isn't what you want, can you please show what you want your result to look like?&lt;/P&gt;

&lt;P&gt;Also, when you do, please use the "code sample" button in the editor so that it looks like this, it will make it much easier to read:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Service1 122286 1  1113  1112 5120.341137
Service2  63534 4 11109 11105 5120.341137
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:24:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193175#M55577</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-01-14T15:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average from the result of the range function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193176#M55578</link>
      <description>&lt;P&gt;I want to see the average of a single service, your solution is exposed in the grand total ( 5120.341137) for each service&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:41:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193176#M55578</guid>
      <dc:creator>carlpier</dc:creator>
      <dc:date>2015-01-14T15:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average from the result of the range function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193177#M55579</link>
      <description>&lt;P&gt;You already have the "average of a single service" in your initial post: &lt;CODE&gt;....avg(ETms)... by Service&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What do you believe you are missing?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:45:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193177#M55579</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-01-14T15:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average from the result of the range function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193178#M55580</link>
      <description>&lt;P&gt;Please show a table of what your results are now, and another table of what you want them to be. Please include column headers.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:50:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-average-from-the-result-of-the-range/m-p/193178#M55580</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-01-14T15:50:00Z</dc:date>
    </item>
  </channel>
</rss>

