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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...