Forum Discussion
Adam_Fint_1489
Nimbostratus
Oct 04, 2011splitting 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 xxxcompany.com, such as:
applecompany.com
bananacompany.com
picklecompany.com
...
hoolio
Cirrostratus
Oct 05, 2011Hi 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] "company.com" 1]
HTTP::replace Host "$subdomain.company.com"
For details on the getfield command, you can check the wiki page:
http://devcentral.f5.com/wiki/iRules.getfield.ashx
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
