<?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 Calculate a number from each entry and present the average of all entries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265056#M79662</link>
    <description>&lt;P&gt;I have the entries below from different sessions:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sessionId="001" data="[{message=timing_stats, data=[{beginF=1550652.855, endF=1550719.130001}, {beginF=1565741, endF=1565787}, {beginF=1574747, endF=1574782}]}]" 

sessionId="002" data="[{message=timing_stats, data=[{beginF=1510652.855, endF=1550719.1001}, {beginF=1865741.4500000002, endF=1565787.645}, {beginF=1974747.655, endF=1974782.6050000002}]}]" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I want to do is to calculate &lt;CODE&gt;endF-beginF&lt;/CODE&gt; for each object in the data array. In this case I would have &lt;CODE&gt;3&lt;/CODE&gt; from the &lt;CODE&gt;session 001&lt;/CODE&gt; and &lt;CODE&gt;3&lt;/CODE&gt; from &lt;CODE&gt;session 002&lt;/CODE&gt;. Then I would like to show the average of the six numbers in a graph. How would I accomplish this? -Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2016 01:07:29 GMT</pubDate>
    <dc:creator>thewho123</dc:creator>
    <dc:date>2016-05-20T01:07:29Z</dc:date>
    <item>
      <title>Calculate a number from each entry and present the average of all entries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265056#M79662</link>
      <description>&lt;P&gt;I have the entries below from different sessions:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sessionId="001" data="[{message=timing_stats, data=[{beginF=1550652.855, endF=1550719.130001}, {beginF=1565741, endF=1565787}, {beginF=1574747, endF=1574782}]}]" 

sessionId="002" data="[{message=timing_stats, data=[{beginF=1510652.855, endF=1550719.1001}, {beginF=1865741.4500000002, endF=1565787.645}, {beginF=1974747.655, endF=1974782.6050000002}]}]" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I want to do is to calculate &lt;CODE&gt;endF-beginF&lt;/CODE&gt; for each object in the data array. In this case I would have &lt;CODE&gt;3&lt;/CODE&gt; from the &lt;CODE&gt;session 001&lt;/CODE&gt; and &lt;CODE&gt;3&lt;/CODE&gt; from &lt;CODE&gt;session 002&lt;/CODE&gt;. Then I would like to show the average of the six numbers in a graph. How would I accomplish this? -Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 01:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265056#M79662</guid>
      <dc:creator>thewho123</dc:creator>
      <dc:date>2016-05-20T01:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a number from each entry and present the average of all entries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265057#M79663</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex max_match=0 "beginF=(?&amp;lt;begin&amp;gt;\d+\.?\d*),\sendF=(?&amp;lt;end&amp;gt;\d+\.?\d*)" | eval z=mvzip(begin, end) | mvexpand z | rex field=z "^(?&amp;lt;begin&amp;gt;[^,]+),(?&amp;lt;end&amp;gt;.*)$" | stats count avg(begin) AS begin avg(end) AS end by sessionId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 May 2016 02:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265057#M79663</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-20T02:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a number from each entry and present the average of all entries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265058#M79664</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
This creates a table with sessionId, count, begin, end columns. I needed the average of endF (minus) beginF from each object and calculate their average.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 17:52:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265058#M79664</guid>
      <dc:creator>thewho123</dc:creator>
      <dc:date>2016-05-20T17:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a number from each entry and present the average of all entries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265059#M79665</link>
      <description>&lt;P&gt;This should give you that...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex max_match=0 "beginF=(?&amp;lt;begin&amp;gt;\d+\.?\d*),\sendF=(?&amp;lt;end&amp;gt;\d+\.?\d*)" | eval z=mvzip(begin, end) | mvexpand z | rex field=z "^(?&amp;lt;begin&amp;gt;[^,]+),(?&amp;lt;end&amp;gt;.*)$" | eval diff=end-begin | stats count avg(begin) AS begin avg(end) AS end avg(diff) as diff by sessionId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 May 2016 18:06:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265059#M79665</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-20T18:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a number from each entry and present the average of all entries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265060#M79666</link>
      <description>&lt;P&gt;I am trying to calculate each pair separately. {beginF=1550652.855, endF=1550719.130001} and then get average of each calculated value&lt;BR /&gt;
These will be timing values so (total beginF - total endF) will not work..&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 01:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-a-number-from-each-entry-and-present-the-average-of/m-p/265060#M79666</guid>
      <dc:creator>thewho123</dc:creator>
      <dc:date>2016-05-26T01:22:30Z</dc:date>
    </item>
  </channel>
</rss>

