Splunk Search

How to get the sum of total number of failed items count after excluding Item Not Recognized and Loading for both fields?

monipinni
Explorer

I have two fields body.response.failedItemsCount , body.failedItemsCount , In this I have to filter with two unwanted fields :

"body.response.failedItemsHistory{}.itemName"!="Item Not Recognized" AND "body.response.failedItemsHistory{}.itemName"!="Loading..."

""body.failedItemsHistory{}.itemName"!="Item Not Recognized" AND "body.failedItemsHistory{}.itemName"!="Loading..."

I tried base search:

| spath "body.response.failedItemsHistory{}.itemName" | search "body.response.failedItemsHistory{}.itemName"!="Item Not Recognized" AND "body.response.failedItemsHistory{}.itemName"!="Loading..." OR  "body.failedItemsHistory{}.itemName"!="Item Not Recognized" AND "body.failedItemsHistory{}.itemName"!="Loading..." | stats sum(body.response.failedItemsCount) as sum1 , sum("body.failedItemsCount") as sum2 | eval totalsum = sum1 + sum2

How can I get sum of total sum of failed items count after excluding Item Not Recognized and Loading for both fields?

0 Karma
1 Solution

vnravikumar
Champion

Hi @monipinni

Try with

yourquery...| search "body.response.failedItemsHistory.itemName"!="Item Not Recognized" AND "body.response.failedItemsHistory.itemName"!="Loading..." OR "body.failedItemsHistory.itemName"!="Item Not Recognized" AND "body.failedItemsHistory.itemName"!="Loading..." 

View solution in original post

0 Karma

vnravikumar
Champion

Hi @monipinni

Try with

yourquery...| search "body.response.failedItemsHistory.itemName"!="Item Not Recognized" AND "body.response.failedItemsHistory.itemName"!="Loading..." OR "body.failedItemsHistory.itemName"!="Item Not Recognized" AND "body.failedItemsHistory.itemName"!="Loading..." 
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 ...