Reporting

Monthly Occupancy Report with Daily Events

spodda01da
Path Finder

Hello All,

I am trying to generate a Monthly Occupancy Report of users with Daily events.

The issue is the Daily events consists of Multiple entries of a user, so I have to use "dedup user" command to get single entries every day

As running dedup command on Monthly report will give single entry of a user in a month, I am extracting reports per day and then consolidate it to get a monthly report which is time consuming.

Looking for suggestions/commands which will help to run a monthly report with Single event of a user (per day).

| lookup AD-lookup sAMAccountName as user output displayName,givenName,sn,mail,telephoneNumber,mobile,manager,department
| eval Date=strftime(_time, "%d-%m-%Y"), Time=strftime(_time, "%H:%M") | table Date,Time, user, displayName, title, department, host, Address, Subnet, Site, mail, mobile
| dedup user
| sort 0 -Date,-Time |

Thanks,

0 Karma
1 Solution

DalJeanis
Legend

Really, you don't have to go to all that trouble.

dedup is a little more flexible than you are thinking.

  your search that gets one or more records for each user per day for the whole month
 | table _time User
 | bin _time span=1d as Day
 | dedup User Day 

The above gets you one record per User per Day.

View solution in original post

0 Karma

DalJeanis
Legend

Really, you don't have to go to all that trouble.

dedup is a little more flexible than you are thinking.

  your search that gets one or more records for each user per day for the whole month
 | table _time User
 | bin _time span=1d as Day
 | dedup User Day 

The above gets you one record per User per Day.

0 Karma

spodda01da
Path Finder

Thank you, it worked

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...