Splunk Search

Correlate fields from two sources

rbw78
Communicator

Hello,

I would like to correalte events from 2 sources by using a field where there's a hostanme.
If i find a match between the hostanmes in event_source_1 and event_source_2 then in output i would have all the hosts with the total of events for these 2 sources.

The search should looks something like that.

source=event_source_1 or source=event_source_1 | if 'hostanme_source1' == 'hostanme_source2' then display hostname, do it until end of logs

I'd already look at the function contingency, correlate and associate it seems to work for only one kind of log source.

Does someone know how to do that ?

Thanks.

0 Karma

ziegfried
Influencer

Find all hostnames that occur in the specified fields in both sources:

source=event_source_1 OR source=event_source_2 | eval common_host=coalesce(hostanme_source1, hostanme_source2) | stats dc(source) as occur by common_host | where occur>1 | fields - occur
Get Updates on the Splunk Community!

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

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...