iRule Host Header Pool
I'm new to F5 iRule scripting and I'm looking to simplify the following so we don't have to edit the iRule every time we add a new site and pool.
Current
when HTTP_REQUEST { if { [HTTP::host] eq "abc.123.com" } { pool abc.123.com } elseif { [HTTP::host] eq "def.123.com" } { pool def.123.com } elseif { [HTTP::host] eq "abc.456.com" } { pool abc.456.com } }
I would like to simplify this script so that what ever comes in is sent to the pool with out defining each one.
The pool name will always match the site. Example site: abc.123.com = pool: abc.123.com
Not sure how to write the script
when HTTP_REQUEST { if { [HTTP::host] eq "*.123.com" } { pool .123.com } elseif { [HTTP::host] eq ".456.com" } { pool *.456.com } }