Splunk Search

How to summarize these search results?

ctsurumaki
Explorer

Hello fellow splunkers!

I'm getting these results from my splunk search but struggling to find a way to summarize the last numbers from the results.  In the example below (31 + 3 + 98 + 7 + 35) and get a total count of 174 which I could display as a new field?

Just started using splunk and will take some training but thought one of the experts out there might have be able to help.

Best regards and thanks!

index="logs" sourcetype="_json"

| extract pairdelim="{,}" kvdelim=":" |fields message,robotName,timeStamp,Level,processName| search message="G3*Total Claims count is - *" processName="GroupClaimsDispatcher_GroupClaimsDispatcher" robotName="Unattended_Robot73"| table  timeStamp,Level,processName,robotName,message| dedup message | sort -timeStamp

 

2023-04-17T16:45:41.1960125Z

Info

GroupClaimsDispatcher_GroupClaimsDispatcher

Unattended_Robot73

G3 --- Total Claims count is - 31

2023-04-17T16:44:16.8150041Z

Info

GroupClaimsDispatcher_GroupClaimsDispatcher

Unattended_Robot73

G3 --- Total Claims count is - 3

2023-04-17T10:00:44.2792246Z

Info

GroupClaimsDispatcher_GroupClaimsDispatcher

Unattended_Robot73

G3 --- Total Claims count is - 98

2023-04-17T10:00:21.3532608Z

Info

GroupClaimsDispatcher_GroupClaimsDispatcher

Unattended_Robot73

G3 --- Total Claims count is - 7

2023-04-17T09:59:20.2110636Z

Info

GroupClaimsDispatcher_GroupClaimsDispatcher

Unattended_Robot73

G3 --- Total Claims count is - 35

 

Labels (4)
0 Karma
1 Solution

woodcock
Esteemed Legend

|makeresults
| eval _raw="
timeStamp Level processName robotName message
2023-04-17T16:45:41.1960125Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 31
2023-04-17T16:44:16.8150041Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 3
2023-04-17T10:00:44.2792246Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 98
2023-04-17T10:00:21.3532608Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 7
2023-04-17T09:59:20.2110636Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 35"
| multikv forceheader=1
| table timeStamp Level processName robotName message
| rex field=message "--- Total Claims count is - (?<claimsCount>\d+)"
| eventstats sum(claimsCount) AS claimsCountTotal

View solution in original post

woodcock
Esteemed Legend

|makeresults
| eval _raw="
timeStamp Level processName robotName message
2023-04-17T16:45:41.1960125Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 31
2023-04-17T16:44:16.8150041Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 3
2023-04-17T10:00:44.2792246Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 98
2023-04-17T10:00:21.3532608Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 7
2023-04-17T09:59:20.2110636Z Info GroupClaimsDispatcher_GroupClaimsDispatcher Unattended_Robot73 G3 --- Total Claims count is - 35"
| multikv forceheader=1
| table timeStamp Level processName robotName message
| rex field=message "--- Total Claims count is - (?<claimsCount>\d+)"
| eventstats sum(claimsCount) AS claimsCountTotal

ctsurumaki
Explorer

Thanks!  This worked perfectly 🙂

0 Karma

ctsurumaki
Explorer

Thanks ITWhisperer - will give it a try 🙂  Much appreciated!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

 

| rex field=message "Total Claims count is - (?<claims>\d+)"
| eventstats sum(claims) as total

 

Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...