<?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: 1: Need to find Average number of  vpn users in weekday and weekend in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477127#M7548</link>
    <description>&lt;P&gt;many ways to accomplish, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sec_vpn sourcetype="cisco:acs" action=success 
 | stats dc(UserName) as unique_users by date_wday
 | eval weekend_or_not = if(date_wday="Saturday" OR date_wday="Sunday","weekend","work day")
 | stats avg(unique_users) as avg_count by weekend_or_not 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try this search anywhere to understand the idea:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-7 
| eval random_user_count = random()%5000 + 4000
| eval date_wday = strftime(starttime, "%A")
| eval _time = starttime
| rename COMMENT as "above generates fake data, below is your solution"
| table _time date_wday random_user_count
| eval weekend_or_not = if(date_wday="Saturday" OR date_wday="Sunday","weekend","work day")
| stats avg(random_user_count) as avg_count by weekend_or_not
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
    <pubDate>Sat, 14 Sep 2019 01:34:29 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2019-09-14T01:34:29Z</dc:date>
    <item>
      <title>1: Need to find Average number of  vpn users in weekday and weekend</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477126#M7547</link>
      <description>&lt;P&gt;Curerntly using the search :&lt;BR /&gt;
1:: index=sec_vpn  sourcetype="cisco:acs" action=success date_wday!=sunday OR date_wday!=saturday | dedup UserName&lt;BR /&gt;
    | stats dc(UserName) by date_wday&lt;/P&gt;

&lt;P&gt;which is giving me number of users on per day basis .&lt;BR /&gt;
output being :&lt;BR /&gt;
date_wday   dc(UserName)&lt;/P&gt;

&lt;P&gt;friday          43996&lt;BR /&gt;
monday           3055&lt;BR /&gt;
thursday    19615&lt;BR /&gt;
tuesday          8865&lt;BR /&gt;
wednesday   12808&lt;/P&gt;

&lt;P&gt;Need to find the average number of user on weekday.&lt;/P&gt;

&lt;P&gt;2:: index=sec_vpn  sourcetype="cisco:acs" action=success date_wday=sunday OR date_wday=saturday | dedup UserName&lt;BR /&gt;
    | stats dc(UserName) by date_wday&lt;BR /&gt;
Need to find the average number of user on weekend.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:08:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477126#M7547</guid>
      <dc:creator>vigneshit</dc:creator>
      <dc:date>2020-09-30T02:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: 1: Need to find Average number of  vpn users in weekday and weekend</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477127#M7548</link>
      <description>&lt;P&gt;many ways to accomplish, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sec_vpn sourcetype="cisco:acs" action=success 
 | stats dc(UserName) as unique_users by date_wday
 | eval weekend_or_not = if(date_wday="Saturday" OR date_wday="Sunday","weekend","work day")
 | stats avg(unique_users) as avg_count by weekend_or_not 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try this search anywhere to understand the idea:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-7 
| eval random_user_count = random()%5000 + 4000
| eval date_wday = strftime(starttime, "%A")
| eval _time = starttime
| rename COMMENT as "above generates fake data, below is your solution"
| table _time date_wday random_user_count
| eval weekend_or_not = if(date_wday="Saturday" OR date_wday="Sunday","weekend","work day")
| stats avg(random_user_count) as avg_count by weekend_or_not
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Sat, 14 Sep 2019 01:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477127#M7548</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-09-14T01:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: 1: Need to find Average number of  vpn users in weekday and weekend</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477128#M7549</link>
      <description>&lt;P&gt;Thanks it worked..&lt;BR /&gt;
But I could not understand the 2nd search query how you got the random function and how you decided the number 5000 and 4000 if any explanation would be there it would be great:)&lt;BR /&gt;
| gentimes start=-7 &lt;BR /&gt;
 | eval random_user_count = random()%5000 + 4000&lt;BR /&gt;
 | eval date_wday = strftime(starttime, "%A")&lt;BR /&gt;
 | eval _time = starttime&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477128#M7549</guid>
      <dc:creator>vigneshit</dc:creator>
      <dc:date>2020-09-30T02:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: 1: Need to find Average number of  vpn users in weekday and weekend</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477129#M7550</link>
      <description>&lt;P&gt;Thanks alot it worked.&lt;BR /&gt;
But I could not understand the working of 2nd search query &lt;BR /&gt;
 | gentimes start=-7 &lt;BR /&gt;
 | eval random_user_count = random()%5000 + 4000&lt;BR /&gt;
 | eval date_wday = strftime(starttime, "%A")&lt;BR /&gt;
 | eval _time = starttime&lt;/P&gt;

&lt;P&gt;How you selected the random function and the number 5000/4000? So if there is an explanation it would be great for my Understanding Thank YOU.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477129#M7550</guid>
      <dc:creator>vigneshit</dc:creator>
      <dc:date>2020-09-30T02:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: 1: Need to find Average number of  vpn users in weekday and weekend</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477130#M7551</link>
      <description>&lt;P&gt;the random function crates an integer between 0 and the number you specify after the &lt;CODE&gt;%&lt;/CODE&gt; sign.&lt;BR /&gt;
here i created a random number between 0 and 4999 and added 4000 to it&lt;BR /&gt;
so in other words, a number between 4000 and 8999&lt;BR /&gt;
read more here:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/StatisticalFunctions#random.28.29"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/StatisticalFunctions#random.28.29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Sep 2019 19:56:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477130#M7551</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-09-14T19:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: 1: Need to find Average number of  vpn users in weekday and weekend</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477131#M7552</link>
      <description>&lt;P&gt;Hi I just was cross verifying the 2 search's found that the results are not same its different for a same time duration. Do you have any insight on why is there a mismatch since both of them run the same query but in different manner?&lt;BR /&gt;
1: Query output&lt;BR /&gt;
weekend_or_not  avg_count&lt;BR /&gt;
weekend 13399.5&lt;BR /&gt;
work day    40337.2&lt;/P&gt;

&lt;P&gt;2:query&lt;BR /&gt;
weekend_or_not  avg_count&lt;BR /&gt;
weekend 6130.5&lt;BR /&gt;
workday 6662&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:12:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477131#M7552</guid>
      <dc:creator>vigneshit</dc:creator>
      <dc:date>2020-09-30T02:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: 1: Need to find Average number of  vpn users in weekday and weekend</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477132#M7553</link>
      <description>&lt;P&gt;yes ... the second search is generating random data to show the idea ... obviously it will be different form real data&lt;/P&gt;</description>
      <pubDate>Sat, 14 Sep 2019 21:16:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/1-Need-to-find-Average-number-of-vpn-users-in-weekday-and/m-p/477132#M7553</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-09-14T21:16:46Z</dc:date>
    </item>
  </channel>
</rss>

