A few related possibilities:
- Are you checking the serverside connection to see the change? As Colin mentioned, the change would be made in the request which LTM proxies to the pool member. If you want the client to see the change, you could use HTTP::redirect to send a redirect instead of rewriting the proxied request's host header.
- If you're on 9.4.4 or higher, you should remove the $:: prefix from the class name reference in the iRule. In 10.x, this would break the matching.
- The value for HTTP::host and most other HTTP commands is cached in the same event and event priority. So if you log the value for HTTP::host, change it with HTTP::header replace newhost.example.com, and then log the value for HTTP::host again, the cached value will be logged.
Aaron