topic How to divide a sum based values/count ? in Splunk Search
https://community.splunk.com/t5/Splunk-Search/How-to-divide-a-sum-based-values-count/m-p/483280#M145965
<LI-CODE lang="markup">| stats sum("Sum of consumption") as Total_Consumption count as Session</LI-CODE>
<P>I got as a result in splunk / statistics chart:</P>
<UL>
<LI>Total_Consumption 750.580</LI>
<LI>Session 25</LI>
</UL>
<P>Now I want to divide them to get the average of consumption per session,<BR />to show it on my dashboard.</P>Thu, 17 Sep 2020 22:35:46 GMTaryamehr3602020-09-17T22:35:46ZHow to divide a sum based values/count ?
https://community.splunk.com/t5/Splunk-Search/How-to-divide-a-sum-based-values-count/m-p/483280#M145965
<LI-CODE lang="markup">| stats sum("Sum of consumption") as Total_Consumption count as Session</LI-CODE>
<P>I got as a result in splunk / statistics chart:</P>
<UL>
<LI>Total_Consumption 750.580</LI>
<LI>Session 25</LI>
</UL>
<P>Now I want to divide them to get the average of consumption per session,<BR />to show it on my dashboard.</P>Thu, 17 Sep 2020 22:35:46 GMThttps://community.splunk.com/t5/Splunk-Search/How-to-divide-a-sum-based-values-count/m-p/483280#M145965aryamehr3602020-09-17T22:35:46ZRe: How to divide a sum based values/count ?
https://community.splunk.com/t5/Splunk-Search/How-to-divide-a-sum-based-values-count/m-p/483281#M145966
<PRE><CODE>....
|eval divide=Total_Consumption / Session
</CODE></PRE>
<BLOCKQUOTE>
<P>Now I want to divide them to get the avrage of consumption per session,</P>
</BLOCKQUOTE>
<P>Sorry, I don't understand that <CODE>divide them</CODE> = <CODE>get the avrage of consumption per session,</CODE><BR />
Only divide, this query is. but I think <CODE>per session</CODE> is another way.</P>Wed, 15 Jan 2020 12:42:43 GMThttps://community.splunk.com/t5/Splunk-Search/How-to-divide-a-sum-based-values-count/m-p/483281#M145966to4kawa2020-01-15T12:42:43Z