topic Re: How do I add an extra row to calculate the average of the rows above? in Splunk Search
https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119039#M31897
<P>This works for me.</P>
<PRE><CODE>..| timechart span=1d count|appendpipe [stats avg(count) as Average]
</CODE></PRE>
<P>Thanks to @echalex </P>Tue, 12 Mar 2019 01:34:58 GMTjawaharas2019-03-12T01:34:58ZHow do I add an extra row to calculate the average of the rows above?
https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119036#M31894
<P>I have connected to my database using Splunk DBConnect and using a simple sql query I have managed to get some data from the table. However I would like to have just one entry displayed that contains the average of the data above. How do I go about that? I am new to splunk.</P>Tue, 31 Mar 2015 00:38:13 GMThttps://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119036#M31894BobKimata2015-03-31T00:38:13ZRe: How do I add an extra row to calculate the average of the rows above?
https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119037#M31895
<P>Hi,</P>
<P>You can try using search command <STRONG>addcoltotals</STRONG>.</P>
<P>Thanks!!</P>Tue, 31 Mar 2015 06:08:16 GMThttps://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119037#M31895vganjare2015-03-31T06:08:16ZRe: How do I add an extra row to calculate the average of the rows above?
https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119038#M31896
<P>The correct command for this would be <CODE>appendpipe</CODE>.</P>
<P>Say you have something like: <CODE>...|stats sum(score) AS totalscore by item</CODE>. Then you can do this: <CODE>...|appendpipe [stats avg(totalscore) AS totalscore |eval item="AVERAGE"]</CODE>. (You need to use <CODE>AS</CODE> in <CODE>appendpipe</CODE> in order to put the average in the same column. You can leave item empt, if you want.)</P>Fri, 03 Aug 2018 11:15:14 GMThttps://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119038#M31896echalex2018-08-03T11:15:14ZRe: How do I add an extra row to calculate the average of the rows above?
https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119039#M31897
<P>This works for me.</P>
<PRE><CODE>..| timechart span=1d count|appendpipe [stats avg(count) as Average]
</CODE></PRE>
<P>Thanks to @echalex </P>Tue, 12 Mar 2019 01:34:58 GMThttps://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-extra-row-to-calculate-the-average-of-the-rows/m-p/119039#M31897jawaharas2019-03-12T01:34:58Z