Splunk Search

Input on how to perform a search, field extraction and calculation ?

sjringo
Contributor

Here is what I am attempting to do:

I am trying to calculate the distinct count of the 'type' of users that are active.

In my log files all of my users have a user name that follows this pattern:  ABCD.aUserName

I am trying to calculate how many distinct users there are that are active for each 'type' where in the above example ABCD is the type.

First looking for high level approach ideas and want to dig into it myself to see what I can get to work but I just am not able to wrap my noodle around how to even approach it ?

I can extract the 'type' and the 'username' but if I have two extracted fields how do I correlate the two to be able to perform a count of dc(usernames) by type ?

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Is this what you mean?

| stats dc(username) by type

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

When the type field is extracted it becomes part of the event from which it was extracted and, therefore, associated with the user name.  Then it's just a matter of using stats dc(username) by type to get the results.

---
If this reply helps you, Karma would be appreciated.

sjringo
Contributor

I guess I was trying to overcomplicate things.  Its starting to make more sense now working through all of these different scenarios.

 

Thanks for the explination...

ITWhisperer
SplunkTrust
SplunkTrust

Is this what you mean?

| stats dc(username) by type
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...