Splunk Search

combinig two search commands

vjtechie67
New Member

I have 2 indexers which are having the same columns
Index1:
Name DOB Age
A 5/1/1990 25
B 7/1/2010 6

Index2:

Name DOB Age
C 5/1/2000 15
D 7/1/2003 13

I need to combine both and provide output as below. I will use this to create graphs.

Output:

Name DOB Age
A 5/1/1990 25
B 7/1/2010 6
C 5/1/2000 15
D 7/1/2003 13

Please help me. Can i use append command?

Tags (3)
0 Karma

jplumsdaine22
Influencer

Or if you want to make it complicated try this

[ search [| tstats count WHERE index=2 OR index=1 by index | fields index] | search index=* | stats count by index | fields index ] | table Name DOB Age | sort 0 Name
0 Karma

woodcock
Esteemed Legend

Like this:

index=index1 OR index=index2
| table Name DOB Age
| sort 0 Name
0 Karma

javiergn
Super Champion

Simply do:

index=index1 OR index=index2
| table Name, DOB, Age
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!

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, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...