Splunk Search

Search to Consolidate similar messages into one?

Vani_26
Path Finder

Query:
index=xxx  application_code=mobile  NOT   feature 
|stats count by code message
|sort -count
|eval message-substr(message, 1, 40)

output:

code message count
mobile-job-115 application error occured 100
mobile-app-180 application is stable 240
app-job-800 information good 34
project-job-100 system error occured 10
project-job-100    system error occured 20
project-job-100    system error occured 34
project-job-100    system error occured 23
project-job-100    system error occured 50


 expected output:

code message count
mobile-job-115 application error occured 100
mobile-app-180 application is stable 240
app-job-800 information good 34
project-job-100 system error occured 137


 i want to get my table display count as one value for similar messages like for example(system error occured) as shown above.

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

And who says you can't do

| stats sum(count) ...

after what you already have?

But on the other hand - why not just do the substr() earlier in the pipeline?

0 Karma

Vani_26
Path Finder

Hi  @PickleRick 

i tried sum(count) but its not coming.
no values are displaying under count

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Unless you rename the resulting column, it will be called sum(count), not count anymore.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...