Splunk Search

Searching and matching from two different indexes and retrieving values from one index

cald0002
New Member

I have two indexes that contain the same ip address but only one index contains hostnames for the ip addresses. How can I search and match the ip addresses from both indexes in the same query and table out each ip address with their corresponding hostname?

Tags (1)
0 Karma

MuS
SplunkTrust
SplunkTrust

Hi cald0002,

Give this a try:

(SPL to get events from index 1) OR (SPL to get events from index 2)
| stats values(hostname) AS hostname by ip

You might need to adapt the query to match the hostname and ip fields according to your events.

hope this helps ...

cheers, MuS

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...