Splunk Search

How to get values count to display in table?

NizanCohen
Explorer

Hi all.

I wish to display in a table format the value's count.

For example;

Computer A has 100 sessions.

Computer B has 50 sessions.

I want to display the 100 and and the 50 values alongside "Computer A" and "Computer B".

 

Thanks!

Labels (1)
0 Karma
1 Solution

FrankVl
Ultra Champion

Sounds like all you need is to add the following to your query:

| stats count by fieldname

Where "fieldname" should be whatever field you want to see the counts of.

Alternatively, if you only want the top ten for example, you can also take a look at the top command

View solution in original post

0 Karma

NizanCohen
Explorer

No, those are general example that express my search.

Let me explain more: 

1. I have the fields inside "Interesting fields"

2. I select one - for example: "Username" - and click on it.

3.  I get top 10 values with the used usernames and their count.

4. I wish to display in a table (or any other way) the count of the used usernames.

 

Hope this explains it better.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| stats count by username
0 Karma

FrankVl
Ultra Champion

Sounds like all you need is to add the following to your query:

| stats count by fieldname

Where "fieldname" should be whatever field you want to see the counts of.

Alternatively, if you only want the top ten for example, you can also take a look at the top command

0 Karma

NizanCohen
Explorer

YES.

Thank you!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Are those examples of your events?

Do you have any fields already extracted?

0 Karma
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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...