Splunk Search

combining two indexes together in one search

awedmondson
Explorer

Index 1
event with text "log-off" in the event
event with text log-on" in the event
event with field A, field B.
event with field B, field C
event with "log-off" in the event
event with "log-on" in the event

index 2
event with field A and field D

Search
I need to join the events to get an event with fields A, B C & D and which returns
logon and logoff time.
The events occur within 1 minute of each other.

I have tried to start off with something like..
index=1 A AND B AND C "log-on" AND "lof-off" | transaction A [search index=2 A AND D] | startswith "log-on"endswith "log-off"

How can I add iD into the search?

thanks

Tags (2)
0 Karma

lguinn2
Legend

Try this for starters

(index=1 A=8 OR B=* OR C=* OR "log-on" OR "log-off") OR (index=2 A=* AND D=*)
| transaction A B startswith="log-on" endswith="log-off"

And definitely read the answer that @martin_mueller suggests!

0 Karma

MuS
SplunkTrust
SplunkTrust

I second that comment by @martin_mueller 😉

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