I know iRules are capable of searching and replacing contents of a field in HTTP header, what I am wondering can it be done on dynamic content, in my case I am wondering if you can search for a particular field and change the case of data in it, so from upper case make it lower, or from lower case make it upper case
Following is example
Incoming request
x-up-calling-line-id:18583360321
x-up-subno:N_NBI_SDG_1184168037000100831348
Outgoing request
x-up-calling-line-id:18583360321
x-up-subno:n_nbi_sdg_1184168037000100831348
In this case data will always be in same field and of same length, what I am looking for is changing the case of data in that field.
I appreciate if someone know the answer if this is possible.
If you want to perform a replacement with dynamically generated strings, I think you’d need to collect the request data and use regsub and a backreference to replace the matched content with the string set to lowercase. If the replacement strings are the same length as the existing strings, you can use the credit card scrubber rule (Click here) as an example for how to collect the data and replace the strings.
Does anyone know if it would be possible to manipulate the payload with a binary scan and a simpler string map + string tolower combination instead?
Thanks for replying back to me , my load balancing experience is limited to netscalers, so it seems like i can collect a data using regex and covert it to lowercase using tolower system call? Does F5 offer full regex in iRules?
I think I misread the original request. I thought he wanted to replace strings in the content. If it’s headers, it should be simple like Stefan suggested:
HTTP::header replace $header_name [string tolower [HTTP::header value $header_name]]