Splunk Search

Club results from multiple search in a single table.Search involves dedup and count by parameter

arunsubram
Explorer

index=* activatesessionIdsForREST() : partnerId=11111111111 ActivateOfferRequestVO |dedup sessionIds|stats count(sessionIds) as SessionCount by partnerId append [search index=* activatesessionIdsForREST() : partnerId=22222222222 ActivateOfferRequestVO |dedup sessionIds|stats count(sessionIds) as SessionCount by partnerId]

Above is my query
I am looking for a table like
PartnerId SessionCount
11111111111 10
22222222222 20

When I run the first query, I get the result separately
index=* activatesessionIdsForREST() : partnerId=11111111111 ActivateOfferRequestVO |dedup sessionIds|stats count(sessionIds) as SessionCount by partnerId append

I get
PartnerId SessionCount
11111111111 10

but when I append the second query, I dont get results. Appreciate any suggestion

Tags (1)
0 Karma
1 Solution

gyslainlatsa
Motivator

hi,

If you want to use the append command, use the pipe | before like this:

 index= activatesessionIdsForREST() : partnerId=11111111111 ActivateOfferRequestVO  |dedup sessionIds |stats count(sessionIds)    as SessionCount by partnerId 
|append  [search index=activatesessionIdsForREST() : partnerId=22222222222 ActivateOfferRequestVO 
 |dedup sessionIds|stats count(sessionIds) as SessionCount by partnerId]

View solution in original post

0 Karma

gyslainlatsa
Motivator

hi,

If you want to use the append command, use the pipe | before like this:

 index= activatesessionIdsForREST() : partnerId=11111111111 ActivateOfferRequestVO  |dedup sessionIds |stats count(sessionIds)    as SessionCount by partnerId 
|append  [search index=activatesessionIdsForREST() : partnerId=22222222222 ActivateOfferRequestVO 
 |dedup sessionIds|stats count(sessionIds) as SessionCount by partnerId]
0 Karma

gyslainlatsa
Motivator

thanks, don't forget to vote.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...