Splunk Enterprise Security

Temporal sequence between a search and a multisearch

SIEMStudent
Path Finder

Hi Splunkers,

today I'm facing a problem related to temporal sequence between a multisearch and a search, but let me introduce the context and explain better.

In ES, I have to build a correlation search that must verify 2 events in time order:

1. First, check if a trojan, backdoor or exploit is founded on a destination host, from some source.
2. Then, check is from the same source on the same destination a login and/or an account change is performed.
Bonds: use datamodels (if possible) and avoid transaction.

Now, I know that I can use:

1. Intrusion Detection for point 1.
2. Authentication and Change for point 2

Now, the search for point one is something like that:

| tstats summariesonly=true fillnull_value="N/D" count from datamodel=Intrusion_Detection
where IDS_Attacks.signature IN ("*trojan*","*backdoor*","*exploit*")
by IDS_Attacks.dest, IDS_Attacks.src, IDS_Attacks.signature, index, host
| `drop_dm_object_name("IDS_Attacks")`

while, for point 2, due I have 2 different datamodels I builded it with a multisearch:

| multisearch 
    [| tstats summariesonly=true prestats=true fillnull_value="N/D" count from datamodel=Authentication where nodename="Authentication.Successful_Authentication" by index, host, Authentication.src, Authentication.dest
    | `drop_dm_object_name("Authentication")`] 
    [| tstats summariesonly=true prestats=true fillnull_value="N/D" count from datamodel=Change where nodename="All_Changes.Account_Management" by index, host, All_Changes.src, All_Changes.dest
    | `drop_dm_object_name("All_Changes")` ] 
| stats count by src, dest, index, host
| stats count values(host) as host, values(index) as inde by src, dest

I tested both search separately and they work well.

Now the point is: how to tell to Splunk that search 1 must trigger before search 2 without transaction? 
I thougth about funcion 

min(_time)
max(_time)

and the use of 

eval

to check is first time occurrence of block 2 is greater than last time occurrence of block 1, but I'm struggling about the correct use of this functions, because the field with time occurrence is always empty, so it's clear I'm wrong in my combined code.
Consider for example the multisearch of block 2, where I tested the use of min:

| multisearch 
    [| tstats prestats=true fillnull_value="N/D" min(_time) as firstSuccess, count from datamodel=Authentication where nodename="Authentication.Successful_Authentication" AND by index, host, Authentication.src, Authentication.dest
    | `drop_dm_object_name("Authentication")`] 
    [| tstats prestats=true summariesonly=true fillnull_value="N/D" min(_time) as firstSuccess, count from datamodel=Change where nodename="All_Changes.Account_Management" by index, host, All_Changes.src, All_Changes.dest
    | `drop_dm_object_name("All_Changes")` ] 
| stats count min(firstSuccess) as firstSuccess by log_region, log_country, src, dest, index, host

The idea is to find the first occurrence in both search of multisearch with min(_time) and then, in the following stats, use min(firstSuccess) to find the smaller one between them; the search show me in output the required fields, except fisrtSuccess which is empty.



Labels (1)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...