Splunk Search

How to combine the results of two searches to display on one chart or visualization?

ssrdc
New Member

Hi all

First search is

( host=wjb2* NOT host=wjb2stl22 NOT host=wjb2*23 NOT host=wjb2*24 NOT host=wjb2*25 NOT host=wjb2*26) "[/clientapi/walletapi/*/login]" "User successfully authenticated for" NOT "healthcheckcdm@company.com"  |fillnull value=NULL |  timechart span=1d count 

Second search is

( host=wjb2* NOT host=wjb2stl22 NOT host=wjb2*23 NOT host=wjb2*24 NOT host=wjb2*25 NOT host=wjb2*26)  "[/clientapi/walletapi/*/login]" "error code" | rex "Error Code : (?.*)," | rex "Error Message : (?.*)" | eval Error_Message=if(Error_Code="USER_NOT_FOUND" AND Error_Message="User authentication failed", "Invalid Password", Error_Message) | eval Error_Message=if(Error_Message="Authentication failed due to invalid username/password ", "Invalid Username", Error_Message) |fillnull value=NULL | timechart span=1d count

Want to combine both results of two different searches to calculate rate !!

0 Karma

jkat54
SplunkTrust
SplunkTrust

Maybe you're looking for the append command?

 ( host=wjb2* NOT host=wjb2stl22 NOT host=wjb2*23 NOT host=wjb2*24 NOT host=wjb2*25 NOT host=wjb2*26) "[/clientapi/walletapi/*/login]" "User successfully authenticated for" NOT "healthcheckcdm@company.com" 
| append [ search 
( host=wjb2* NOT host=wjb2stl22 NOT host=wjb2*23 NOT host=wjb2*24 NOT host=wjb2*25 NOT host=wjb2*26) "[/clientapi/walletapi//login]" "error code" | rex "Error Code : (?.)," | rex "Error Message : (?.*)" | eval Error_Message=if(Error_Code="USER_NOT_FOUND" AND Error_Message="User authentication failed", "Invalid Password", Error_Message) | eval Error_Message=if(Error_Message="Authentication failed due to invalid username/password ", "Invalid Username", Error_Message)
] 
|fillnull value=NULL | timechart span=1d count
0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...