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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...