Splunk Search

How to build a datamodel like this ?

szabados
Communicator

My data consists of pairs of files, lets call them file_A_1...file_A_n, and file_B_1...file_B_n, where file_A_1 is connected with file_B_1.
The pairs are always ingested at the same time together. The first step I need in my datamodel is to join the corresponding pairs, like
source=file_A_1 join type=outer myIDField [ search source=file_B_1 ]. How can I achieve this dynamically, with every pair of file?

Tags (3)
0 Karma

Jeremiah
Motivator

If myIDField is unique across all files, do you really need to join the two files together?

source=file_A* OR source=file_B* | stats values(*) AS * by myIDField

If the myIDField value is not unique, you could also extract the id number from the file.

source=file_A* OR source=file_B* | rex field=source "_(?<file_id>\d+)" | stats values(*) AS * by myIDField, file_id

jplumsdaine22
Influencer

Here is a handy chart on when to use the various aggregators

http://docs.splunk.com/Documentation/Splunk/6.3.2/Search/Abouteventcorrelation

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...