Forum Discussion
Create an iRule that can search and replace
It depends how is your topology.
If you you a specific VS fo each server then you don't need to identify it.
But if you have one VS then you somehow need to know which server it is.
You can use IPs, headers, cookies, or whatever unique application may has.
Another one is that you don't specify if this is a request or a response.
So my example is for request.
If you need it for a response it needs to be adjusted accordingly.
- rg-f5Jun 08, 2025
Nimbostratus
The message will come through from an application to the Virtual Server, i'm not sure if this is a response or a request. The message will not have a role identifier. Hence I have to add in the following irule.
Let's start with it being one virtual server and we want a basic example to get the irule started to search and replace.
This is a message sent from the application, and an irule to replace <soapenv:Header/> with <soapenv:Header>
<job:roleIdentifier>SERVER1</job:roleIdentifier>
</soapenv:Header>Step one in the message payload
Find <soapenv:Header/> and replace with
<soapenv:Header>
<job:roleIdentifier>SERVER1</job:roleIdentifier>
</soapenv:Header>
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