Splunk Search

Run same search for two different time ranges, identify users who appear in both time ranges

darraghlong
New Member

Hello,

I have a search that returns results in the format user, source ip, destination ip, timestamp.

I would like to run that search for two different time windows and return any results where the user is detected in both time windows. In an ideal world, the output would be a single chart showing number of user detections per user over both time durations.

I tried to use a join search to do this:

index="myindex" category="blah"
earliest=-7d@d latest=-1d@d | join user [search index="myindex" category="blah" earliest=-42d@d latest=-14d@d ] | table user, source ip, destination ip, timestamp

but it only returns results for the time period in the main search, and omits results from the join search.

Any help would be greatly appreciated

0 Karma

skalliger
Motivator

You could use an outer join or simply use append instead:
index=... earliest=-42d@d latest=-14d@d
| append [ same search with earliest=-7d@d latest=-1d@d ]

Worked for me, but I got no good data here for that use case to check.

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...