All Apps and Add-ons

Return results from ALL sub-searches into a table

griffinpair
Path Finder

Each search below gathers data via SQL Queries from 3 different databases on 3 different servers. I have combined them into one with the hope to return the "totalerrors" and "ClientID" associated with those errors in one final table at the bottom. So it would look like:

totalerrors | ClientID
0 | abc
3 | def
5 | ghi

As of right now, the search below only returns the first searches data. So, I am only retrieving:

totalerrors | ClientID
0 | abc

Any suggestions on how to return the data from each sub-search query into one final table, all together?

| dbxquery query="SELECT count(*) as totalerrors, 'abc' as ClientID FROM \"CM126abc\".\"dbo\".\"table1\" (NOLOCK) WHERE PROCESSEDFLAG = 'N' and ADDEDDT>DATEADD(hour, -24, GETDATE())" connection="126" | fields totalerrors, ClientID
| appendcols [dbxquery query="SELECT count(*) as totalerrors, 'def' as ClientID FROM \"CM126def\".\"dbo\".\"table2\" WHERE PROCESSEDFLAG = 'N' and ADDEDDT >DATEADD(hour, -24, GETDATE())" connection="126" | fields totalerrors, ClientID ]
| appendcols [dbxquery query="SELECT count(*) as totalerrors, 'ghi' as ClientID FROM \"CM126ghi\".\"dbo\".\"table3\" WHERE PROCESSEDFLAG = 'N' and ADDEDDT >DATEADD(hour, -24, GETDATE())" connection="126" | fields totalerrors, ClientID]
| table UnprocessedVendorCAs, ClientID
0 Karma

sowings
Splunk Employee
Splunk Employee

Try | append instead of | appendcols.

0 Karma
Get Updates on the Splunk Community!

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...

Detecting Cross-Channel Fraud with Splunk

This article is the final installment in our three-part series exploring fraud detection techniques using ...

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...