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 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

 (view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...