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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...