Splunk Search

How to find the redirect request along with its redirected target location?

santhakr
Explorer

When a request comes on domain 1 (say abc.com) we do a 301 redirect to domain 2 (def.com). These will be two separate requests on my server access log. The original one (abc.com) ending up in 301 and the redirected one (def.com) ending up in 200 and both these requests are not synchronous or sequential.

How do I write a query to find the requests on the domain 1 (abc.com) which has redirected to domain 2 (def.com). I basically want to write something below:

domain="abc.com" http_status="301" response_location="def.com"

I don't think there is any response location identifier in splunk or is there one? Any help would be appreciated.

Thanks.

Tags (2)
0 Karma

somesoni2
Revered Legend

You can try using transaction over clientip.

your base search | transaction clientip startswith=http_status=301 endswith=http_status=200 maxevents=2

santhakr
Explorer

One information that can be the same between these two requests can be the client (source) ip. So if the ip remains the same between the original request and the redirected request, how would I map both?

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Okay, any other info to tie the two events together?

santhakr
Explorer

Nope, we didn't capture those information in the access log. Moreover the requests can be made by clients on headless mode too, which doesn't retain session information between requests.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Do you have session IDs or cookies in your logs?

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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