Splunk Search

addTotals not including a column

LauraBre
Communicator

Hello,

this is my search:

source=tcp:5544 STAT_VE="YES" OR STAT_VE="NO" |eval Transac=case(D_LAB_ERR="TIMEOUT_REACHED" OR D_LAB_ERR="TIMEOUT_REACHED_RECORD","PA Pb fin de session 3D Secure", SD_STAT_PA="NO" AND  (NOT D_LAB_ERR="TIMEOUT_REACHED" OR NOT D_LAB_ERR="TIMEOUT_REACHED_RECORD"),"PA Pb Autres",STAT_VE="NO","VE No",STAT_VE="YES" AND SD_STAT_PA="YES","PA Yes",STAT_VE="YES" AND SD_STAT_PA="ATTEMPT","PA Attempt",STAT_VE="YES" AND SD_STAT_PA="NO", "PA No",STAT_VE="YES","VE sans PA") |chart count by PURCH_DATE,Transac|addTotals

My problem is that I want to do the sum of all case within the field PURCH_DATE(an integer) but when I use addTotals, the sum is the sum of all values column. How can I do to have the sum of the Transac within the field PURCH_DATE.

Thx by advance

Laura

Tags (2)
0 Karma

woodcock
Esteemed Legend

If I understand you correctly, like this:

source=tcp:5544 STAT_VE="YES" OR STAT_VE="NO" |eval Transac=case(D_LAB_ERR="TIMEOUT_REACHED" OR D_LAB_ERR="TIMEOUT_REACHED_RECORD","PA Pb fin de session 3D Secure", SD_STAT_PA="NO" AND  (NOT D_LAB_ERR="TIMEOUT_REACHED" OR NOT D_LAB_ERR="TIMEOUT_REACHED_RECORD"),"PA Pb Autres",STAT_VE="NO","VE No",STAT_VE="YES" AND SD_STAT_PA="YES","PA Yes",STAT_VE="YES" AND SD_STAT_PA="ATTEMPT","PA Attempt",STAT_VE="YES" AND SD_STAT_PA="NO", "PA No",STAT_VE="YES","VE sans PA") |stats count by PURCH_DATE Transac | eventstats sum(count) AS TransacSum BY PURCH_DATE
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...