<?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 calculate the average after calculating the total for the fields in a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434903#M168378</link>
    <description>&lt;P&gt;This Search query is giving me result of Total and Average in seperate column. but i want Total and Average should get calculated below the fields column. For Eg: Total Time and Average Time should get calculated in the same Entry Time in ms column and Total Time and Average Time should get calculated in the same Exit Time in ms column. &lt;/P&gt;

&lt;P&gt;Is it possible? bcoz i tried with the above query that i have added but that does not gives the expected result for average.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 12:23:17 GMT</pubDate>
    <dc:creator>rajeswarir</dc:creator>
    <dc:date>2018-07-12T12:23:17Z</dc:date>
    <item>
      <title>How can I calculate the average after calculating the total for the fields in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434900#M168375</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; IDS          Entry Time in ms   Exit Time in ms
   1                30                            40
   2                15                            10
   3                05                            11
   4                10                            05
   5                08                            09
Total Time  68                             75
Average Time13.6                     15 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want the result in the above way table data to be displayed i.e Total in one row to be calculated and average in one row to be calculated. But for me, it is displaying average by including total time as well so I am getting answer Average 27.2 for Entry Time and 30 for Exit time.&lt;/P&gt;

&lt;P&gt;Can anyone help me to get the average correctly by neglecting Total Time of Entry and Exit Time.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 11:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434900#M168375</guid>
      <dc:creator>rajeswarir</dc:creator>
      <dc:date>2018-07-11T11:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the average after calculating the total for the fields in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434901#M168376</link>
      <description>&lt;P&gt;This is the query i have used to get the result&lt;/P&gt;

&lt;P&gt;source="test.log" |table IDS,Entry Time in ms,Exit Time in ms|addcoltotals Entry Time in ms,Exit Time in ms,Total labelfield=IDS|addtotals Entry Time in ms Exit Time in ms|appendpipe[stats avg(*) as *|eval IDS="Average Time"]&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 12:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434901#M168376</guid>
      <dc:creator>rajeswarir</dc:creator>
      <dc:date>2018-07-11T12:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the average after calculating the total for the fields in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434902#M168377</link>
      <description>&lt;P&gt;Hi @rajeswarir,&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"your base search to list table" 
| appendpipe [stats sum("Entry Time in ms") as "Entry Time in ms",sum("Exit Time in ms") as "Exit Time in ms"|eval IDS="Total"]
| appendpipe [stats avg("Entry Time in ms") as "Entry Time in ms",avg("Exit Time in ms") as "Exit Time in ms"|eval IDS="Average"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 12:50:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434902#M168377</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-11T12:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the average after calculating the total for the fields in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434903#M168378</link>
      <description>&lt;P&gt;This Search query is giving me result of Total and Average in seperate column. but i want Total and Average should get calculated below the fields column. For Eg: Total Time and Average Time should get calculated in the same Entry Time in ms column and Total Time and Average Time should get calculated in the same Exit Time in ms column. &lt;/P&gt;

&lt;P&gt;Is it possible? bcoz i tried with the above query that i have added but that does not gives the expected result for average.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 12:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434903#M168378</guid>
      <dc:creator>rajeswarir</dc:creator>
      <dc:date>2018-07-12T12:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the average after calculating the total for the fields in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434904#M168379</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="test.log" |table IDS,Entry Time in ms,Exit Time in ms
|appendpipe[| stats sum(*) as *|eval IDS="Total Time"]
|appendpipe[where IDS!="Total Time" |stats avg(*) as *|eval IDS="Average Time" ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jul 2018 16:08:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434904#M168379</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-12T16:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the average after calculating the total for the fields in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434905#M168380</link>
      <description>&lt;P&gt;Thanks. This is what i expected as a result.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 04:27:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-average-after-calculating-the-total-for/m-p/434905#M168380</guid>
      <dc:creator>rajeswarir</dc:creator>
      <dc:date>2018-07-13T04:27:44Z</dc:date>
    </item>
  </channel>
</rss>

