Forum Discussion
Insert Pool Name into serverside HTTP Header
Yes our intention is to send traffic to a pool that matches a specific path. So we do have different if else statements to handle that logic and this is acceptable for us. We are looking for a better way to use an irule to insert the pool name to the header after the pool has been selected. Currently we are doing that with 'HTTP::header insert' after it matches the HTTP path and before the traffic is sent to the pool.
The idea is to have an irule that can do this separate from our irule used to send traffic to the different pools after a path is matched. That way we can use this across multiple Virtual Servers where needed instead of having to update the other irules with the HTTP::header insert.
- jaikumar_f5Nov 18, 2021MVP
Understood. But do the path name & pool name have something in common ? because from your example, it clearly doesn't match any pattern.
If it was something like.
URI - "/xyz/1234" --> Send traffic to Pool_xyz or Pool_1234
URI - "/abc/5678" --> Send traffic to Pool_abc or Pool_5678
We can simply extract xyz or abc or 1234 or 5678 and set it on a variable.
Then use
set poolname Pool_$extractedvalue
You see what I'm telling, we can auto populate it, if its matches a pattern. That way we dont have to hardcore it.
If these don't match a pattern, the way i see it is to build a datagroup with path as key & poolname as value pair. Build a class match condition & send the traffic to pool as well insert header with the value. You can use this datagroup across multiple other irules too.
Recent Discussions
Related Content
* 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