Splunk Search

Adding results, fields from two different queries

pradeepkumarg
Influencer

I have two completely different queries which of them output fields like below

The output of the fields will be just one value

Query 1 -        ...|table total1
Query 2 -        ...|table total2

Now I want to add these two fields total1 and total2 and display it.

How can I achieve this in a single query?

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

Try appendcols

query1 
| appendcols [ search query2]
| eval grandTotal = total1 + total2

View solution in original post

lguinn2
Legend

Try appendcols

query1 
| appendcols [ search query2]
| eval grandTotal = total1 + total2

pradeepkumarg
Influencer

It did.. Thanks!

0 Karma

pradeepkumarg
Influencer

Perfect. Thanks much!

Will it work the same way for 3 queries? My actual requirement was for 3 queries. I'm yet to try that. Hope it works 🙂

0 Karma
Get Updates on the Splunk Community!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...