Forum Discussion
MDPF52_180608
Feb 26, 2015Nimbostratus
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 charac...
Brad_Parker
Feb 26, 2015Cirrus
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
HTTP::collect [HTTP::header Content-Length]
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.
https://devcentral.f5.com/wiki/iRules.HTTP_RESPONSE_DATA.ashx
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects