Forum Discussion
iRule hashing + trim
Hello Devcentral community,
Please can you tell me how to a hash a variable like the sha 512 (i store a certain parameter value by the uri ) and after that i want to keep only the last 10 characters of the sha.
Variable Variablehash--> hashed sha512 of $variable
Than, only the last 10 characters of the $Variablehash
One more question: how i can inspect the response page that returns to the client ( passing from the big ip ) and if a certain string in the HTML body is present than i ll generate a message ( hsl)?
Thanks in advance,
Best Regards,
Matteo
- MDPF52_180608Nimbostratus
Hello, anyone can give me a suggestion ?
Thanks
- Brad_ParkerCirrus
Try this for your hash variable:
set variableHash [sha512 $variable] set lastTenHash [string range $variableHash [expr [string length $variableHash] - 10] end]
For your response you would need to do a
in your when HTTP_RESPONSE event and then in the HTTP_RESPONSE_DATA event you would need to inspect the HTTP::payload for your string probably using scan. Be weary, that this will collect the whole payload of every response which could be a performance hit to the application.HTTP::collect [HTTP::header Content-Length]
https://devcentral.f5.com/wiki/iRules.HTTP_RESPONSE_DATA.ashx
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