Splunk Search

Can I add two table values in a single table

rkishoreqa
Communicator

Hi team,

 

How can I add the below two queries into one single query and present in a single table.

query 1 : index="dev_envi" | chart count(ApplicationName) over ApplicationName by Status |addtotals
Result :   app1 5
                  app2 8

query 2 : index="dev_envi" | chart count(event.ApplicationName) over event.ApplicationName by event.Status |addtotals
Result :  app1  3
                 app2  6

 

Now I need a single query to add above both values and display in Dashboard like below (adding above both table data):
app1   8
app2  14

Labels (1)
0 Karma
1 Solution

rkishoreqa
Communicator

Hi rich,

Thanks for the quick response

For this single query I am getting results as same as below query results. 
- index="dev_envi" | chart count(ApplicationName) over ApplicationName by Status |addtotals

and missing the results of the query -  index="dev_envi" | chart count(event.ApplicationName) over event.ApplicationName by event.Status |addtotals

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Can you share some sample events of both types. please?

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

richgalloway
SplunkTrust
SplunkTrust

See if this helps.

index="dev_envi" 
| eval ApplicationName = coalesce(event.ApplicationName, ApplicationName),  Status = coalesce(event.Status, Status)
| chart count(ApplicationName) as count over ApplicationName by Status 
| addtotals
---
If this reply helps you, Karma would be appreciated.

rkishoreqa
Communicator

Hi rich,

Thanks for the quick response

For this single query I am getting results as same as below query results. 
- index="dev_envi" | chart count(ApplicationName) over ApplicationName by Status |addtotals

and missing the results of the query -  index="dev_envi" | chart count(event.ApplicationName) over event.ApplicationName by event.Status |addtotals

0 Karma
Get Updates on the Splunk Community!

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened Audit Trail v2 wasn’t written in isolation—it was shaped by your voices. In ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...