Splunk Search

Join same index twice for search1 and search2 into a single table

jw44250
New Member

I have one index that search for an error and the same index search for exeception

now i have error result and exception result... i want append into table format..

Tags (4)
0 Karma

aaraneta_splunk
Splunk Employee
Splunk Employee

@jw44250 - To add to richgalloway's comment, the more information and context you can provide to the Answers community, the better chances you have of another user providing a working solution to your question. It would be helpful if you provided your current search so that experts in the community have a starting point in order help you out.

0 Karma

DalJeanis
Legend

This example assumes that you will have certain fields that naturally exist in both searches (server, _time) certain fields that each search will fill in (ProblemType, ProblemCode, ProblemMessage) and other fields that will be different for the two searches (SomeErrorStuff, SomeExceptionStuff).

[error search goes here] 
| fields server _time ErrorCode ErrorMessage SomeErrorStuff  
| eval ProblemType="Error" 
| eval ProblemCode=ErrorCode  
| eval ProblemMessage=ErrorMessage 
| append 
   [
   [exception search goes here] 
   | fields server _time ExceptionCode ExceptionMessage SomeExceptionStuff 
   | eval ProblemType="Exception" 
   | eval ProblemCode=ExceptionCode  
   | eval ProblemMessage=ExceptionMessage  
   ]
| table server _time ProblemType ProblemCode ProblemMessage SomeErrorStuff SomeExceptionStuff

SomeErrorStuff and SomeExceptionStuff will be NULL in records that are not relevant to them.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What are your current searches?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...