# iRule Script Request

**URL:** <https://community.f5.com/t/irule-script-request/2851>\
**Category:** Technical Forums\
**Tags:** irules, application-delivery\
**Created:** [April 2, 2016, 11:52am UTC](https://community.f5.com/t/irule-script-request/2851 "2016-04-02T11:52:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed\_ismail\_21](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@ahmed\_ismail\_21](https://community.f5.com/u/ahmed_ismail_21)\
**Post date:** [April 2, 2016, 11:52am UTC](https://community.f5.com/t/irule-script-request/2851/1 "2016-04-02T11:52:47Z")

</div>

please I need iRule match the below procedure.

1- Matching by Header " REFERER" section a- Match header " REFERER" contains vlaue MUSEPROXY=1103, then forward traffic persist to sr1 2- By URL pattern a- if URL pattern contains MUSEPROXY=1103, then forward traffic persist to sr1

3- By URL second value

a- if URL pattern contain .1103. then forward traffic persist to sr1

4-if nothing of policies match apply default load balancing " least connections "

---

<div class="post-metadata">

**Author:** ![gilliek\_282631](https://avatars.discourse-cdn.com/v4/letter/g/94ad74/32.png) [@gilliek\_282631](https://community.f5.com/u/gilliek_282631)\
**Post date:** [August 4, 2016, 12:18pm UTC](https://community.f5.com/t/irule-script-request/2851/2 "2016-08-04T12:18:11Z")

</div>

Hi,

The irule below may fit your request :

```tcl
when HTTP_REQUEST {
        switch -glob "[HTTP::header "Referer"]|[HTTP::uri]" {
            "*MUSEPROXY=1103*|*" -
            "*|*MUSEPROXY=1103*" -
            "*|*.1103.*" {
                node srv1
            }
            default {
                 pool defined with least connection lb method
                pool pool1
            }
        }
}

```
