Forum Discussion
search for html text A. when not found insert html-text
Is it possible to search for a specific word with an iRule and insert it if it is not found in the html text? I know the possibilities with search and replace, but I don't know how to search for a certain text and then insert it below.
- JG
Cumulonimbus
You can use a stream profile to do this. If you can be more specific, you may get more help here.
- SScheibe_344275
Nimbostratus
I would like to search for the word "Imprint" and if it is not found insert the following: yoursite
- Hannes_Rapp
Nimbostratus
You can certainly do it. Now the main challenge is where exactly in your HTML page you want to insert that "Imprint"? That's why search&replace (what stream profile does) works best. This does not require you to know the exact byte location where to insert your content. Even when you do know, any minor change in HTML layout could mess up things and you may see "Imprint" at a wrong location. If the place of insertion is always at the start or very end, that would ease things considerably. In all other scenarios, I'd refrain from using iRules, or try to find a way to go with search&replace.
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