<?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: Getting averages from 2 columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Getting-averages-from-2-columns/m-p/324891#M96905</link>
    <description>&lt;P&gt;Hey Somesoni2!&lt;/P&gt;

&lt;P&gt;Very nice solution!  Thank you!  (Again)&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2018 18:44:58 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2018-01-23T18:44:58Z</dc:date>
    <item>
      <title>Getting averages from 2 columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-averages-from-2-columns/m-p/324889#M96903</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a query that looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app counter buildTarget=* product=* Properties.index=0 buildTarget=* product=*|convert num(Properties.args{}) as loginms|eval dura=loginms/1000|eval duration=ceil(dura)|where duration&amp;lt;=60|stats count as statscount by duration|sort duration|rename duration as "Login Duration in Seconds" statscount as "Number of times the Login Duration Occurred"| appendpipe [stats count | where count=0]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It makes a table that shows this&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4204iD243BDEBC6F783F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;What I'd like to to is get an average number of seconds for login duration but using both columns.  Example&lt;/P&gt;

&lt;P&gt;1 second occurred 16 times so 1 second would have to be counted 16 times in the average.&lt;/P&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 18:25:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-averages-from-2-columns/m-p/324889#M96903</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-23T18:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Getting averages from 2 columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-averages-from-2-columns/m-p/324890#M96904</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=wholesale_app counter buildTarget=* product=* Properties.index=0 buildTarget=* product=*|convert num(Properties.args{}) as loginms|eval dura=loginms/1000|eval duration=ceil(dura)|where duration&amp;lt;=60|stats count as statscount by duration|sort duration| appendpipe [stats count | where count=0]
| eval noofsecs=statscount*duration | stats sum(noofsecs) as noofsecs sum(statscount) as totaloccurances | eval "Average number of secs per login"=round(noofsecs/totaloccurances,2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Jan 2018 18:39:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-averages-from-2-columns/m-p/324890#M96904</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-01-23T18:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting averages from 2 columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-averages-from-2-columns/m-p/324891#M96905</link>
      <description>&lt;P&gt;Hey Somesoni2!&lt;/P&gt;

&lt;P&gt;Very nice solution!  Thank you!  (Again)&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 18:44:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-averages-from-2-columns/m-p/324891#M96905</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-23T18:44:58Z</dc:date>
    </item>
  </channel>
</rss>

