The enconding command exists in the tcl version used in F5 but is not available via iRules as you pointed out.
[root@LABBIGIP1:Active:Changes Pending] images # tclsh
% encoding convertto ebcdic "EXAMPLE"
ÅçÁÔ×ÓÅ
When I try via iRules:
when HTTP_REQUEST {
log local0. [encoding convertto ebcdic "EXAMPLE"]
}
Nov 11 17:51:20 LABBIGIP1 err tmm2[22248]: 01220001:3: TCL error: /Common/test1 <HTTP_REQUEST> - invalid command name "encoding" while executing "encoding convertto ebcdic "EXAMPLE""
One possible solution is to try to build the conversion yourself, using string map:
when HTTP_REQUEST {
log local0. [string map [list "Å" "b"] "Åbc"]
}
Nov 11 18:19:04 LABBIGIP1 info tmm5[22248]: Rule /Common/test1 <HTTP_REQUEST>: bbc
If you can't do the mapping this way, you will have to look mapping using hex or binary.