Splunk Search

How can I get the flieds of two logs by joining them?

marina_rovira
Contributor

Hi people,
I have a doubt. I've two logs with their own fields.
One of them is ldap-pre.log, that has this fields: IPclient, IPbalan, SNAT, whatM
And the other is debug.log and it has this flields: IPbalan, conn

I want some search that join this two logs, and show me, for each Ipclient, the conn (connection) that this IP has done. Like you see, IPbalan, its the same flied and values for both logs.
It tried somethings eval, transaction, stats, and I get all that the conn (connection) done, like serach something, bind, all the sentences, but I need to see the IPclient who did that connection.
Some help please?

Thank you all,
Marina

Tags (4)
0 Karma
1 Solution

musskopf
Builder

Hey Marina, give a try using the join command, something like that:

index=bla source=debug.log "your search" |
join type=left IPbalan [ search index=bla source=ldap-pre.log ]

Now the results should have the joined fields. Not that the join operation is case-sensitive - doesn't really matter for IPs but is good to be aware of that anyway... have a look on the Splunk Doc to see all join options.

Another option, if you ldap-pre.log is quite static, would be exporting your ldap-pre.log and converting it to a lookup table. Lookups are normally faster than joins.

View solution in original post

musskopf
Builder

Hey Marina, give a try using the join command, something like that:

index=bla source=debug.log "your search" |
join type=left IPbalan [ search index=bla source=ldap-pre.log ]

Now the results should have the joined fields. Not that the join operation is case-sensitive - doesn't really matter for IPs but is good to be aware of that anyway... have a look on the Splunk Doc to see all join options.

Another option, if you ldap-pre.log is quite static, would be exporting your ldap-pre.log and converting it to a lookup table. Lookups are normally faster than joins.

Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...