Splunk Search

How to filter the Userid to show once per minute?

moiezuddin
Explorer

In the index for siteminder called cams_prod, there are traced filed with the type smtrace. Using these trace files find the logs for the application using 'Center realm’. Then created a regular expression to mine the User id. You will notice that Userids are able to be found many times each minute. We need to fiter this so it only shows once per minute.

Tags (1)
0 Karma
1 Solution

NOUMSSI
Builder

Hi,
to show only one Userid per minute, in your query use this function dc by this way:

...|stats dc(Userid) by ...

Or

...|timechart dc(Userid) by ...

View solution in original post

NOUMSSI
Builder

Hi,
to show only one Userid per minute, in your query use this function dc by this way:

...|stats dc(Userid) by ...

Or

...|timechart dc(Userid) by ...

krishnacasso
Path Finder

Hi Moiezuddin,

Thanks For the question,
I new to splunk, Trying to develop some sample siteminder dashboards as a poc,
Hope you have some Idea on the smaccess log and smps log,

Using Smps log, We are trying to develop some alerts for the performance monitoring of siteminder.
Can you please explain if you have done any in your environment.

Was It possible to create a table like total number users have accessed a particular application in 24 hours time period using azaccept and uid in smaccess.log

Thanks,

0 Karma

moiezuddin
Explorer

index=casm_prod sourcetype=smtrace | bucket _time span=1m | stats count by _time, USER_id | sort - count

With the above query, I noticed that USER_id are able to be found many times each minute.

I need to fiter this in such a way that it only needs to shows once per minute.

Kindly help

0 Karma

NOUMSSI
Builder

Ok guy,

Try this with the commande dedup:

 ...|stats dc(User_id) by ... | dedup USER_id sortby +_time

Or this with commande uniq:

index=casm_prod sourcetype=smtrace | bucket _time span=1m | stats count by _time, USER_id | sort - count |uniq
0 Karma

moiezuddin
Explorer

Thanks a lot , its working fine.

0 Karma

NOUMSSI
Builder

No mention. I'm here to help you solve your problems

0 Karma

masonmorales
Influencer

Could you post some sample data, your current search, and a mock-up of your desired output please?

0 Karma

moiezuddin
Explorer

index=casm_prod sourcetype=smtrace | bucket _time span=1m | stats count by _time, USER_id | sort - count

With the above query, I noticed that USER_id are able to be found many times each minute.

I need to fiter this in such a way that it only needs to shows once per minute.

Kindly help

0 Karma
Get Updates on the Splunk Community!

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 ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...