Security

Monthly active users query

dadi
Path Finder

Hi guys,
I've a need to have a monthly active unique users chart. The catch is that I need to present each day the total of the active users from the previous 30 days(each day will have different value).
I do have log with userId as which is enough to indicate that the user is active. The thing is that I need to supply for each day a number that represent the monthly active users calculated especially for that day (going 30 days back for each day and doing distinct count for that 30 day period).
Can you suggest a way of doing that? Example maybe?

[for example if I have 3 users that have been active:
user 1 on the 1st, and 4th
user 2 on the 2nd
user 3 on the 3rd

The graph of the next month if breakdown by day will show:
1st - 3 users
2nd - 3 users
3rd - 2 users
4th - 1 user
5th - 0 users
]

Tags (2)
0 Karma
1 Solution

dadi
Path Finder

The solution eventually was to run an index summary query every day in order to get the monthly active users for this day, and in the dashboard to visualize the indexed data in a time chart.

View solution in original post

0 Karma

dadi
Path Finder

The solution eventually was to run an index summary query every day in order to get the monthly active users for this day, and in the dashboard to visualize the indexed data in a time chart.

0 Karma

kristian_kolb
Ultra Champion

Well, it's hard to give you a good answer, since you do not give any information about your logs, the system generating said logs, what statistics your boss wants, what is considered to be an active user, count or distinct count etc etc etc.

Anyway, assuming you have a log file which contains events with timestamp userid=blaha action=someaction, and this is considered to be an "active" user, and that you want the distinct number of users, i.e. if the user jdoe logs on 23 times in a single day, it still counts as one user. A possible solution could look like;

sourcetype=your_sourcetype earliest=-30d@d latest=@d| timechart span=1d dc(userid) | addcoltotals

Hope this helps you somewhat. And please remember - the more information you give, the better help you get.

/Kristian

dadi
Path Finder

Thanks Kristian.
I do have log with userId as you noted which is enough to get my user to be "active". The thing is that I need to supply for each day a number that represent the monthly active users calculated especially for that day (going 30 days back for each day and doing distinct count for that 30 day period). Currently I have no leads on how to do it

0 Karma

kristian_kolb
Ultra Champion

edited the answer so that the search goes through the previous 30 days, not including 'today'.

/k

0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...