Getting Data In

Identifying user activity by day and rolling that up to a month?

sf-mike
Splunk Employee
Splunk Employee

I need to create a report showing activity over over the entire month. I need a histogram showing distribution of unique users who used the product on 1 day within that period, 2 days, 3 days, etc. , up to 30 days. There's a field for each user called 'u' which I can/need to use.

Here's what I was given as an example of what I need to create:

Session_days unique_users
1 2300323
2 233555
3 1255
4 304
5 233
6
:
:
30 1

Tags (2)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

This depends a little bit on the format of your data. I'm assuming that you have some sort of log where you have multiple entries per user per day, but you only want to count that as a single visit or session.

... | stats dc(date_mday) as Session_days by u | top 30 Session_days | rename count as unique_users | fields - percent

That should get you what you want i believe.

Hope this helps,

Kristian

View solution in original post

kristian_kolb
Ultra Champion

This depends a little bit on the format of your data. I'm assuming that you have some sort of log where you have multiple entries per user per day, but you only want to count that as a single visit or session.

... | stats dc(date_mday) as Session_days by u | top 30 Session_days | rename count as unique_users | fields - percent

That should get you what you want i believe.

Hope this helps,

Kristian

kristian_kolb
Ultra Champion

Glad to hear that - just make sure to verify that the answers are correct, I haven't had my morning coffee yet, so I'm not really responsible for my actions. 🙂

0 Karma

sf-mike
Splunk Employee
Splunk Employee

perfect! you've saved me hours!!!

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...