Splunk Search

search different index

splunkcol
Builder

 

I have 3 different indexes and they asked me to search by document number.

The structure of the logs is different including the name of the field that contains the document number

index = index1 OR index = index2 OR index = index3 1234567

As you know, that query is limited to looking for the number 1234567

I can't tell it to show certain fields in a table using table or stats count.

Any suggestion?

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @splunkcol,

i the name of the field in the three indexes is number1, numer2 and number3

You could use a search like this:

index = index1 OR index = index2 OR index = index3 
| eval number=coalesce(number1, number2, number3)
| where number=1234567
| ...

With this approach you can also correlate the three indexes taking data from all the indexes.

Ciao.

Giuseppe

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@splunkcol 

If you know the document number filed name from each index then you can try this also.

(index=index1 document_number_Field1="1234567") OR (index=index2 document_number_Field2="1234567") OR (index=index3 document_number_Field3="1234567")
 | eval document_number = coalesce(document_number_Field1,document_number_Field2,document_number_Field3)
| .
.
.

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

gcusello
SplunkTrust
SplunkTrust

Hi @splunkcol,

i the name of the field in the three indexes is number1, numer2 and number3

You could use a search like this:

index = index1 OR index = index2 OR index = index3 
| eval number=coalesce(number1, number2, number3)
| where number=1234567
| ...

With this approach you can also correlate the three indexes taking data from all the indexes.

Ciao.

Giuseppe

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

Watch Now Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas     Do you ever feel ...

Build and Launch AI Agents from Your Splunk Workflows

Replay Tech Talk Build and Launch AI Agents from Your Splunk Workflows     We’ve all been there: juggling ...

index This | What kind of room has no doors?

IndexEducation Cover Art Banner Cisco.png August 2026 Edition  Hayyy Splunk Education Enthusiasts and the ...