<?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 do I get Unique users per day and per month in one query and then divide them in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205229#M187709</link>
    <description>&lt;P&gt;Can't view any of my posts or your posts past the suggestion with eval Month=mvindex outside of my email. &lt;/P&gt;

&lt;P&gt;I get this error when trying your regex. &lt;BR /&gt;
"Error in 'rex' command: Encountered the following error while compiling the regex '(?&amp;amp;lt\d+)\s(?&amp;lt;\w+)': Regex: syntax error in subpattern name (missing terminator)"&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2016 20:13:25 GMT</pubDate>
    <dc:creator>pzhou07920</dc:creator>
    <dc:date>2016-08-05T20:13:25Z</dc:date>
    <item>
      <title>How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205212#M187692</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a field called "UserID" and a DateActive field. I'm looking to make a bar chart where each bar has a value equal to the average # of unique users per day in a month divided by the total # of active users of that month, for every month in the year (Lets call this value Stickiness). For example, if the month of Jan averages 3,000 unique active users per day and has 10,000 unique active users in the entire month of Jan, then I want the Stickiness for Jan to be 3,000/10,000 or .3. &lt;/P&gt;

&lt;P&gt;I'm able to get both unique active users per day and unique active users per month in separate queries but am having trouble doing it together to do the division since I am using &lt;/P&gt;

&lt;P&gt;timechart span=1(day or month) dc(UserID) and using eval _time=DateModified&lt;/P&gt;

&lt;P&gt;So how can I obtain both the unique daily active user and unique monthly active user counts in a single query so that I can perform division on them? I also want to display the data using a bar graph that has one bar for the Stickiness of each month in a 12 month window? I'd normally use timechart but i'm not sure how for a more complex situation like this. &lt;/P&gt;

&lt;P&gt;Might have worded it poorly, let me know so I can clarify.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 00:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205212#M187692</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-04T00:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205213#M187693</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | bucket span=1d _time | stats dc(UserID) as dailyUniq count(UserID) as DailyActive by _time | timechart span=1mon avg(dailyUniq) as DailyAvgUniqUsers sum(DailyActive) as TotalActive | eval Month=strftime(_time,"%B") | eval Stickiness=round(DailyAvgUniqUsers/TotalActive,2) | table Month Stickiness
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update#1&lt;/STRONG&gt;&lt;BR /&gt;
This should givev stickiness as ratio of Daily Average Uniq Users and Unique users for the month. Will be little slower than previous one.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | bucket span=1d _time | eventstats dc(UserID) as dailyUniq by _time
| timechart span=1mon avg(dailyUniq) as DailyAvgUniqUsers dc(UserID) as MonthlyUniq | eval Month=strftime(_time,"%B") | eval Stickiness=round(DailyAvgUniqUsers/MonthlyUniq,2) | table Month Stickiness
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Aug 2016 03:18:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205213#M187693</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-04T03:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205214#M187694</link>
      <description>&lt;P&gt;Thanks, there is one thing. Instead of TotalActive I actually wanted Monthy Unique Users, essentailly the same thing as the dailyUniq you calculated except for each month. Not sure how to do that in addition to getting the dailyUniq as you described&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 14:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205214#M187694</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-04T14:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205215#M187695</link>
      <description>&lt;P&gt;Try the updated answer&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 15:40:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205215#M187695</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-04T15:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205216#M187696</link>
      <description>&lt;P&gt;It's really close, for some reason the average unique daily users is off by a couple hundred though. I removed your search and replaced eventstats with stats to look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | bucket span=1d _time | stats dc(UserID) as dailyUniq by _time | eval Month=strftime(_time,"%b") | where Month="May"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and got the correct unique daily users for each day in the month of May. Somehow though the average isnt calculated correctly which is confusing me, for instance in May I'm getting avg=~2100 when it should be ~1800. &lt;/P&gt;

&lt;P&gt;Full code below - PARTICIPANT_AOID is UserID&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval _time = strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N") | bucket span=1d _time | eventstats dc(PARTICIPANT_AOID) as DAU by _time | timechart span=1month avg(DAU) as avg_DAU, dc(PARTICIPANT_AOID) as MAU  | eval Month=strftime(_time,"%m") | eval Month_Name = strftime(_time,"%b") | eval Year=strftime(_time,"%Y") | eval CurrDate = now() | eval CurrMonth=strftime(CurrDate,"%m") | eval CurrYear=strftime(CurrDate,"%Y") | where (Year=CurrYear) OR (Year=(CurrYear-1) AND (Month &amp;gt; CurrMonth)) | eval DAU/MAU=round(avg_DAU/MAU,2) | Table Month_Name DAU/MAU avg_DAU MAU
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;most of the time stuff is just to get the correct time windows because of how we indexed the data&lt;/P&gt;

&lt;P&gt;edit: just realized i could have used earliest and made it a lot easier but that shouldn't be the issue&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 16:37:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205216#M187696</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-04T16:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205217#M187697</link>
      <description>&lt;P&gt;What is the time range for the search? The time-range works on the _time which splunk assigned during indexing. Here you're overriding the _time from field LastModifiedDate, so it could be possible that some of the events are not included in the base search itself. Can you try this and see if the average is correct?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval _time = strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N") | timechart span=1d dc(PARTICIPANT_AOID) as DAU | timechart span=1mon avg(DAU) as avg_DAU
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Aug 2016 18:08:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205217#M187697</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-04T18:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205218#M187698</link>
      <description>&lt;P&gt;hmm yup, the average is now correct when I run the query you just gave me. Does this mean I'm excluding events by writing the _time field incorrectly?&lt;/P&gt;

&lt;P&gt;We have to override the _time field because we have a database that stores timestamps of certain events, going back to December of 2015 when it was built. We just started using Splunk and indexed the entire database (from a flat file due to limitations) so the _time field for all events is the same. Going on the new database entries will be indexed each night but we want these charts to go on and only show the last 12 months worth of data.&lt;/P&gt;

&lt;P&gt;I used a similar _time field override when doing the simple timecharts on the separate unique monthly and unique daily counts and those were fine.&lt;/P&gt;

&lt;P&gt;thanks a ton for your help by the way, its much appreciated&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 19:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205218#M187698</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-04T19:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205219#M187699</link>
      <description>&lt;P&gt;Do you know what is wrong? I plaeyd around some more and it seems to have to do with the bucket/event stats part. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval _time = strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N") | bucket span=1d _time | eventstats dc(PARTICIPANT_AOID) as DAU by _time | timechart span=1mon avg(DAU) as avg_DAU | eval Month_Name=strftime(_time,"%b") | table Month_Name avg_DAU
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gives the wrong average. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval _time = strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N") | timechart span=1d dc(PARTICIPANT_AOID) as DAU | timechart span=1month avg(DAU) as avg_DAU, dc(PARTICIPANT_AOID) as MAU | eval Month_Name=strftime(_time,"%b") | Table Month_Name avg_DAU MAU DAU/MAU
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gives the correct average, 0 for all MAU though&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 16:48:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205219#M187699</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T16:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205220#M187700</link>
      <description>&lt;P&gt;Give this a try. If bucket is the issue, this should work fine&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval _time = relative_time(strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N"),"@d") | eventstats dc(UserID) as dailyUniq by _time | timechart span=1mon avg(dailyUniq) as DailyAvgUniqUsers dc(UserID) as MonthlyUniq | eval Month=strftime(_time,"%B") | eval Stickiness=round(DailyAvgUniqUsers/MonthlyUniq,2) | table Month Stickiness
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Else, give this a try as well&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval _time = relative_time(strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N"),"@d") | stats count by _time UserID 
| eventstats dc(UserID) as dailyUniq by _time | timechart span=1mon avg(dailyUniq) as DailyAvgUniqUsers dc(UserID) as MonthlyUniq | eval Month=strftime(_time,"%B") | eval Stickiness=round(DailyAvgUniqUsers/MonthlyUniq,2) | table Month Stickiness
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2016 17:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205220#M187700</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-05T17:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205221#M187701</link>
      <description>&lt;P&gt;still nothing, both return the same avg dailyUniq similar to the previous queries, although interestingly enough they are different from each other by varying values between 1-10 where where the value is equal to ~2000&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval _time = strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N") | timechart span=1d dc(PARTICIPANT_AOID) as DAU | timechart span=1mon avg(DAU) as avg_DAU | eval Month = strftime(_time,"%b") | table Month avg_DAU
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is the only query that returns the correct avg_DAU so far, is there some way to do it using 2 timecharts that will also get me the Unique monthly users?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205221#M187701</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T19:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205222#M187702</link>
      <description>&lt;P&gt;It seems like the eventstats is the one causing problem. It could be due to too many rows for processing? Was the 2nd query closer to the actual average?&lt;/P&gt;

&lt;P&gt;Give this last one a try else, we'll have two timechart method&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; base search | eval _time = relative_time(strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N"),"@d") | stats count by _time UserID 
| eval Month=strftime(_time,"%B") | stats count(_time) as numerator dc(_time) as denom dc(UserID) as UniqMonth by Month
| eval Stickiness=round(numerator/denom/MonthlyUniq,2) | table Month Stickiness
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205222#M187702</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-05T19:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205223#M187703</link>
      <description>&lt;P&gt;That worked! I dont remember which query was closer btw but they were only different by say 5 so one query returned avg dailyUser=2100 and other would return 2105 while the real value was 1800. &lt;/P&gt;

&lt;P&gt;Do you by any chance know how I can organize it by months rather than alphabetically or should I manually sort it with something like case? So if I ran it now in August it would give me in order &lt;BR /&gt;
July, June, May, April, March,Feb, Jan,Dec 2015...&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:36:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205223#M187703</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T19:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205224#M187704</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; base search | eval _time = relative_time(strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N"),"@d") | stats count by _time UserID 
 | eval Month=strftime(_time,"%m %B %Y") | stats count(_time) as numerator dc(_time) as denom dc(UserID) as UniqMonth by Month
 | eval Stickiness=round(numerator/denom/MonthlyUniq,2) | table Month Stickiness| eval Month=mvindex(split(Month," "),1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205224#M187704</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-05T19:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205225#M187705</link>
      <description>&lt;P&gt;didn't seem to work, order is alphabetical still&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205225#M187705</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T19:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205226#M187706</link>
      <description>&lt;P&gt;Seems like it is still in alphabetical order&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:56:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205226#M187706</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T19:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205227#M187707</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; base search | eval _time = relative_time(strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N"),"@d") | stats count by _time UserID 
  | eval Month=strftime(_time,"%Y%m %B") | stats count(_time) as numerator dc(_time) as denom dc(UserID) as UniqMonth by Month
  | eval Stickiness=round(numerator/denom/MonthlyUniq,2) | table Month Stickiness | rex field=Month "(?&amp;lt;sortfield&amp;gt;\d+)\s(?&amp;lt;Month&amp;gt;\w+)" | sort num(sortfield) | field - sortfield
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205227#M187707</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-05T19:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205228#M187708</link>
      <description>&lt;P&gt;This actually removed all of the Months, the MOnth column is now blank&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205228#M187708</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T19:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205229#M187709</link>
      <description>&lt;P&gt;Can't view any of my posts or your posts past the suggestion with eval Month=mvindex outside of my email. &lt;/P&gt;

&lt;P&gt;I get this error when trying your regex. &lt;BR /&gt;
"Error in 'rex' command: Encountered the following error while compiling the regex '(?&amp;amp;lt\d+)\s(?&amp;lt;\w+)': Regex: syntax error in subpattern name (missing terminator)"&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 20:13:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205229#M187709</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T20:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205230#M187710</link>
      <description>&lt;P&gt;Not sure where the other posts/comments are gone from both you and me. Could've reached the limit on number of comments under one answer, so starting a new answer.&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; base search | eval _time = relative_time(strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N"),"@d") | stats count by _time UserID 
  | eval Month=strftime(_time,"%Y%m %B") | stats count(_time) as numerator dc(_time) as denom dc(UserID) as UniqMonth by Month
  | eval Stickiness=round(numerator/denom/MonthlyUniq,2) | table Month Stickiness| eval Month=mvindex(split(Month," "),-1)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; base search | eval _time = relative_time(strptime(LastModifiedDate, "%Y-%m-%d %H:%M:%S.%3N"),"@d") | stats count by _time UserID 
      | eval Month=strftime(_time,"%Y%m %B") | stats count(_time) as numerator dc(_time) as denom dc(UserID) as UniqMonth by Month
      | eval Stickiness=round(numerator/denom/MonthlyUniq,2) | table Month Stickiness | rex field=Month "(?&amp;lt;sortfield&amp;gt;\d+)\s(?&amp;lt;Month&amp;gt;\w+)" | sort num(sortfield) | fields - sortfield
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2016 20:18:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205230#M187710</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-05T20:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get Unique users per day and per month in one query and then divide them</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205231#M187711</link>
      <description>&lt;P&gt;They both order it the same- alphabetically. Perhaps a 2 timechart method would be better since it would automatically order it? I"m looking for the data from the last 12 months, aka from now (August) to Sept of 2015 sorted chronologically&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 20:22:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-Unique-users-per-day-and-per-month-in-one-query-and/m-p/205231#M187711</guid>
      <dc:creator>pzhou07920</dc:creator>
      <dc:date>2016-08-05T20:22:41Z</dc:date>
    </item>
  </channel>
</rss>

