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

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.

Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...