Splunk Search

How to modify my search to add the count of a particular field next to its field?

pavanae
Builder

I have a search as follows

My search | bin span=1h _time | stats values(field_1) as Field_1 by _time Field_2

Which displays the result as follows

_time        Field_2        Field_1
123          jkl            gsad

Now I want my search to modify the result to add a field which displays the total event count of Field_1(Field_1_count) next to it like below. How can i do that?

_time        Field_2        Field_1         Field_1_count
123          jkl            gsad            23
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try this

My search | bin span=1h _time | stats values(field_1) as Field_1 count(field_1) as Field_1_count by _time Field_2
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this

My search | bin span=1h _time | stats values(field_1) as Field_1 count(field_1) as Field_1_count by _time Field_2
---
If this reply helps you, Karma would be appreciated.
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, ...