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!

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