# HTTP Path redirect for Splunk

**URL:** <https://community.f5.com/t/http-path-redirect-for-splunk/2961>\
**Category:** Technical Forums\
**Tags:** irules, big-ip, devops, ltm, application-delivery\
**Created:** [October 5, 2015, 1:43am UTC](https://community.f5.com/t/http-path-redirect-for-splunk/2961 "2015-10-05T01:43:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doran\_Lum\_13484](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Doran\_Lum\_13484](https://community.f5.com/u/Doran_Lum_13484)\
**Post date:** [October 5, 2015, 1:43am UTC](https://community.f5.com/t/http-path-redirect-for-splunk/2961/1 "2015-10-05T01:43:36Z")

</div>

Hi all, I have one VIP which is running the irule below to direct traffic to either of the 3 servers depending on the url from the users.. Users will enter [https://test.domain.com/server1](https://test.domain.com/server1) or [https://test.domain.com/server2](https://test.domain.com/server2)

AT the backend, the server is listening on port 8000. On the server itself, I could reach the server with

I try both the irule below and it’s not working. On Chrome, I’m getting “ERR\_CONNECTION\_REFUSED”.

when HTTP\_REQUEST {

if { [HTTP::path] starts\_with “/server1” } {

```tcl
pool Pool_server1_8000

```

} elseif { [HTTP::path] starts\_with “/server2” } {

```tcl
pool Pool_server2_8000

```

} elseif { [HTTP::path] starts\_with “/server3” } {

```tcl
pool Pool_server3_8000

```

}

}

when HTTP\_REQUEST {

if { [HTTP::path] ends\_with “\_server1” }{

```tcl
pool Pool_server1_8000

```

} elseif { [HTTP::path] ends\_with “\_server2” }{

```tcl
pool Pool_server2_8000

```

} elseif { [HTTP::path] ends\_with “\*server3” }{

```tcl
pool Pool_server3_8000

```

}

}

---

<div class="post-metadata">

**Author:** ![Doran\_Lum](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Doran\_Lum](https://community.f5.com/u/Doran_Lum)\
**Post date:** [October 5, 2015, 9:34am UTC](https://community.f5.com/t/http-path-redirect-for-splunk/2961/2 "2015-10-05T09:34:20Z")

</div>

HI all, would this be a better way to redirect ?

when HTTP\_REQUEST {

if {[string tolower [HTTP::host]] eq “[https://test.domain.com/server1](https://test.domain.com/server1)”}{

HTTP::redirect " [HTTP::uri]"

} }
