<?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 to display Avg of Users per Time Picker? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666052#M228497</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Sorry for the late reply.&amp;nbsp; I tried your command and it's receiving an error.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Madmax_0-1698171302645.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27759i8511BA1E3E9BD788/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Madmax_0-1698171302645.png" alt="Madmax_0-1698171302645.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2023 18:15:12 GMT</pubDate>
    <dc:creator>Madmax</dc:creator>
    <dc:date>2023-10-24T18:15:12Z</dc:date>
    <item>
      <title>How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659483#M227705</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to figure out a way to display a single value that calculates users who have disconnected divided by the time range based on the time picker.&amp;nbsp; &amp;nbsp;The original number comes from the avg of total disconnects divided by the distinct user count.&amp;nbsp; I need to divide that number by the number of days which is based on the time picker.&amp;nbsp; The goal is to get the avg user disconnects per day based on time frame selected in time picker.&amp;nbsp; For example if there are 100 disconnects and 10 distinct users =10, then divided by the number of days selected in picker(7) should equal 1.42 disconnects per day.&amp;nbsp; I hope that makes sense.&amp;nbsp; Here is my search:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Index=... Host=HostName&amp;nbsp;&lt;BR /&gt;earliest=$time_tok.earliest$ latest=$time_tok.latest$&lt;BR /&gt;| stats count by "User ID"&lt;BR /&gt;|search "User ID"=*&lt;BR /&gt;|stats avg(count)&lt;/P&gt;
&lt;P&gt;That will only give me the Total disconnects divided by Distinct users, but I need that number divided by the time picker number of days and I can't get it to work.&amp;nbsp; Thank you!!!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 21:23:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659483#M227705</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-10-03T21:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659552#M227716</link>
      <description>&lt;P&gt;Are you looking for something like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=... Host=HostName "User ID"=*
  earliest=$time_tok.earliest$ latest=$time_tok.latest$
| stats count by "User ID"
|stats avg(eval(count*86400/($time_tok.latest$ - $time_tok.earliest$))&lt;/LI-CODE&gt;&lt;P&gt;This is really just translating what you described into math formula. &amp;nbsp;If you need to truncate number of decimals, &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MathematicalFunctions#round.28.26lt.3Bnum.26gt.3B.2C.26lt.3Bprecision.26gt.3B.29" target="_blank" rel="noopener"&gt;round&lt;/A&gt; is your friend. &amp;nbsp;Note: "User ID"=* is not needed after group by "User ID". &amp;nbsp;Any null value will disappear from groupby. &amp;nbsp;Meanwhile, if you have events that miss "User ID", it is beneficial to remove them before hand.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 03:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659552#M227716</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-10-04T03:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659660#M227745</link>
      <description>&lt;P&gt;Hello Thank you for the reply!&amp;nbsp; I tried it but I'm getting an error stating " Error in "search processor" Mismatched quotes and/or parentheses."&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 14:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659660#M227745</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-10-04T14:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659708#M227758</link>
      <description>&lt;P&gt;Add another paren at the end of the stats line.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|stats avg(eval(count*86400/($time_tok.latest$ - $time_tok.earliest$)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 19:13:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659708#M227758</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-10-04T19:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659709#M227759</link>
      <description>&lt;P&gt;Also, if you want to do this in an ad hoc search you can use &lt;STRONG&gt;| addinfo&lt;/STRONG&gt; to&amp;nbsp; add the info_max_time, and info_min_time fields to your data to get the ad hoc search time range from the time picker. Editing the above answer would look like this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=... Host=HostName "User ID"=*
| addinfo
| stats count by "User ID"
| stats avg(eval(count*86400/(info_max_time - info_min_time)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 19:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659709#M227759</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-10-04T19:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659836#M227800</link>
      <description>&lt;P&gt;That fixed the Parenthesis error but now I'm receiving this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Madmax_0-1696529317364.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27463i5A1D795C8C295344/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Madmax_0-1696529317364.png" alt="Madmax_0-1696529317364.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for your time!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 18:09:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659836#M227800</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-10-05T18:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659853#M227802</link>
      <description>&lt;P&gt;I see that the time tokens are symbolic, not actual time values. &amp;nbsp;In that case, use addinfo as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/146503"&gt;@fredclown&lt;/a&gt;&amp;nbsp;suggested. &amp;nbsp;Just a couple tweaks, one to make search faster if there are lots of events, the other is syntactic.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=... Host=HostName "User ID"=*
| stats count by "User ID"
| addinfo ``` magical command goes anywhere, but less work in fewer rows ```
| stats avg(eval(count*86400/(info_max_time - info_min_time))) as average&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 19:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/659853#M227802</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-10-05T19:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666050#M228496</link>
      <description>&lt;P&gt;Sorry for the late reply.&amp;nbsp; I tried your command and it's receiving an error.&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Splunk Error.png" style="width: 615px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27758i31AB1A85728C6D06/image-size/large?v=v2&amp;amp;px=999" role="button" title="Splunk Error.png" alt="Splunk Error.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 18:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666050#M228496</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-10-24T18:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666052#M228497</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry for the late reply.&amp;nbsp; I tried your command and it's receiving an error.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Madmax_0-1698171302645.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27759i8511BA1E3E9BD788/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Madmax_0-1698171302645.png" alt="Madmax_0-1698171302645.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 18:15:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666052#M228497</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-10-24T18:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666071#M228503</link>
      <description>&lt;P&gt;Your second stats will not work because after the first stats you only have the User ID and count fields. The info_max_time and info_min_time fields no longer exist.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 20:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666071#M228503</guid>
      <dc:creator>fredclown</dc:creator>
      <dc:date>2023-10-24T20:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666080#M228508</link>
      <description>&lt;P&gt;You didn't run addinfo in the chain search as suggested. &amp;nbsp;Of course that will cause error because that's the same as &amp;nbsp;division by zero.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 22:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666080#M228508</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-10-24T22:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666159#M228531</link>
      <description>&lt;P&gt;I see what you mean about missing the | addinfo, my mistake.&amp;nbsp; I tried 3 different ways.&amp;nbsp; With time picker token and without. I also tried with No token and with | addinfo but I'm still getting an error.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Splunk4.png" style="width: 681px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27784i51CDE128FA23AD1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Splunk4.png" alt="Splunk4.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Splunk3.png" style="width: 673px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27786iBE908C7E98321D96/image-size/large?v=v2&amp;amp;px=999" role="button" title="Splunk3.png" alt="Splunk3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Splunk1.png" style="width: 674px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27787i4C7E527E32A2F228/image-size/large?v=v2&amp;amp;px=999" role="button" title="Splunk1.png" alt="Splunk1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 14:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666159#M228531</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-10-25T14:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Avg of Users per Time Picker?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666183#M228536</link>
      <description>&lt;P&gt;Wow finally got this to work.&amp;nbsp; I'm not sure why but I had to refresh and it started working.&amp;nbsp; All the other numbers populated.&amp;nbsp; Thank you so much for your help!!!!&amp;nbsp; Here is a screen shot that could help someone else with the final code that was successful.&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Disconnects per day.png" style="width: 591px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27796i58B418E1C158E542/image-size/large?v=v2&amp;amp;px=999" role="button" title="Disconnects per day.png" alt="Disconnects per day.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 15:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-Avg-of-Users-per-Time-Picker/m-p/666183#M228536</guid>
      <dc:creator>Madmax</dc:creator>
      <dc:date>2023-10-25T15:36:33Z</dc:date>
    </item>
  </channel>
</rss>

