Splunk Search

How to create a search that displays FieldC from Search2 if FieldA from Search1 matches FieldB from Search2?

peterchow
Explorer

Dear all,

I have a search like this:

host="x.x.x.x" login=a | table User,Start_time,Duration    <=main search

Now I want to show one more set of data in this table, but the info is in another log. May I know, is it possible if main search.fieldA matches secondary search.fieldB, then show secondary search.fieldC?

Thanks

0 Karma

javiergn
Super Champion

Yes it is.

SearchA OR SearchB
| where fieldA =fieldB
| table fieldC

Example based on your main search

(sourcetype=typeA host="x.x.x.x" login=a) OR (sourcetype=typeB host="y.y.y.y")
| where fieldAFromSearchA = fieldBFromSearchB
| table fieldCFromSearchB

If your fieldC also exists in your first search then you might want to create an alias for it or apply some extra filtering to only display this field for that particular search.

Thanks,
J

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