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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...