Splunk Search

combine 2 index with one common field

anhtran
New Member

Hello

i have index=sqltem with the sourcetype=temp-log with the following field : starttime, endtime, user_id, dbname, instruments_processed, inst_skipped, error_nums

Then I have another index=jobinfo with the sourcetype=jobinfo with the field
jobid
user_id
database
status
jobstarttime
jobfinishtime

As you see only user_id is a common field.

I would like to have a table that will show the all the fields on both index. How can I do that?

Thank you very much.

Tags (1)
0 Karma

fdi01
Motivator

try :

index=sqltem sourcetype=temp-log |join user_id  [search index=jobinfo  sourcetype=jobinfo ] |table  starttime  endtime  user_id  dbname  instruments_processed inst_skipped  error_nums jobid database status jobstarttime jobfinishtime

or

index=sqltem|jobinfo  |table  starttime  endtime  user_id  dbname  instruments_processed inst_skipped  error_nums jobid database status jobstarttime jobfinishtime
0 Karma

stephane_cyrill
Builder

HI try this:

index=sqltem OR index=jobinfo|table starttime, endtime, user_id,
dbname, instruments_processed, inst_skipped,
error_nums,jobid,user_id,database,status,jobstarttime,jobfinishtime

YOU CAN USE ......|fields ........ AT THE PLACE OF ........|table........

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...