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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...