Splunk Search

Compare field value from different sourcetypes to list the value of the third field

mardix86
New Member

Hi All,
i have 2 files indexed as 2 different source types.
In Sourcetype1 i created:
1. Field1 presents the value of a file let's say example.txt
2. Field2 presents the value of the result let's say [OK]

In Sourcetype2 i created:
Field1 presents the value of a file let's say example.txt

I would like to create a search that
If Field1 value from sourcetype1 = Field1 value from sourcetype2 list Field2 value from sourcetype1

My final goal is to create a table that lists the event details (time, user, files, results) the last column will be the result that is a little bit more trickier to achieve.

Thanks A Lot Guys!

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

There probably are a few ways to do that. Here's one.

sourcetype=sourcetype1 OR sourcetype=sourcetype2 | stats values(Field2) by Field1
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...