Splunk Search

How to convert tabular data to distinct count

VijaySrrie
Builder

How to convert tabular data to distinct count

Hi,

I have a splunk query

| stats count by operation (under field operation we have activate and deactivate count)

vijaysri_0-1614849271363.png

How to convert it to distinct count (instead of tabular format I want only the count to be displayed)

 

Labels (2)
0 Karma

VijaySrrie
Builder

vijaysri_0-1614850598529.png

 

It is not working, I should get the result as 2

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| stats dc(operation) as count

Is that what you mean?

0 Karma

VijaySrrie
Builder

yes, this query gave me count as 1, I want the count of activate to be displayed. Better I will create the field extraction for activate and use the below query

| stats dc(activate) as count

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| where operation="activate"
| stats count by operation
0 Karma

VijaySrrie
Builder

vijaysri_0-1614851467811.png

User wanted only the numerical value to be displayed, so I used above query

| search operation="activate"
| stats count by operation
| table count

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...