Splunk Search

addcoltotals

nithys
Path Finder

Screenshot 2023-11-03 at 2.22.56 PM.png

 

I have used the below query to get the total from that column
Index="" source=""
| fields queryHits | table queryHits | addcoltotals labelfield=total label="queryHits"...
Now how do i get only the last row which is the total to display in my dashboard.I tried using stats count but its not fetching the correct vaue

 

 

 

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

You could just take the last line using tail

index="" source=""
| fields queryHits 
| table queryHits 
| addcoltotals labelfield=total label="queryHits"
| tail 1

but there's a better way to get just the total

Index="" source=""
| stats sum(queryHits) as queryHits

 

---
If this reply helps you, Karma would be appreciated.

nithys
Path Finder

thank you 

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

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 ...