Forum Discussion

Adam_Fint_1489's avatar
Icon for Nimbostratus rankNimbostratus
Oct 04, 2011

splitting a domain apart; can I used awk in an iRule?

Our Marketing department went out and purchased hundreds of domains names in the format of, such as:



They want these to point to a VIP, and have the F5 do a 301 to: -> -> -> ->



I don't know the business case, but this is what they want.



Can I use awk in an iRule to split the HTTP::host apart?



2 Replies

  • Hi Adam,



    No, you can't use awk from an iRule. But you can use string functions or a regex to do this. You could use the getfield string function for this to avoid the overhead of a regex:



    set subdomain [getfield [HTTP::host] "" 1]


    HTTP::replace Host "$"



    For details on the getfield command, you can check the wiki page: