Forum Discussion
nitass_89166
May 26, 2015Noctilucent
what about this?
configuration
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when RULE_INIT {
set static::uri "/MacBlue_SAMTV/GetAttachmentDownloadInfo"
set static::param_name "encoding"
set static::param_value "TVOD_"
set static::param_newvalue "MPEG-4"
}
when HTTP_REQUEST {
log local0. "before: uri=[HTTP::uri]"
if { [HTTP::uri] starts_with $static::uri } {
set value [URI::query [HTTP::uri] $static::param_name]
if { $value starts_with $static::param_value } {
HTTP::query [string map [list $static::param_name=$value $static::param_name=$static::param_newvalue] [HTTP::query]]
}
}
}
when HTTP_REQUEST priority 1000 {
log local0. "after: uri=[HTTP::uri]"
}
}
/var/log/ltm
May 26 11:42:15 ve11c info tmm[32414]: Rule /Common/qux : before: uri=/something
May 26 11:42:15 ve11c info tmm[32414]: Rule /Common/qux : after: uri=/something
May 26 11:42:32 ve11c info tmm1[32414]: Rule /Common/qux : before: uri=/MacBlue_SAMTV/GetAttachmentDownloadInfo?something=1234
May 26 11:42:32 ve11c info tmm1[32414]: Rule /Common/qux : after: uri=/MacBlue_SAMTV/GetAttachmentDownloadInfo?something=1234
May 26 11:42:42 ve11c info tmm[32414]: Rule /Common/qux : before: uri=/MacBlue_SAMTV/GetAttachmentDownloadInfo?encoding=TVOD_123_456&test=789
May 26 11:42:42 ve11c info tmm[32414]: Rule /Common/qux : after: uri=/MacBlue_SAMTV/GetAttachmentDownloadInfo?encoding=MPEG-4&test=789
May 26 11:42:59 ve11c info tmm1[32414]: Rule /Common/qux : before: uri=/MacBlue_SAMTV/GetAttachmentDownloadInfo?prefix=abc&encoding=TVOD_123_456&test=789
May 26 11:42:59 ve11c info tmm1[32414]: Rule /Common/qux : after: uri=/MacBlue_SAMTV/GetAttachmentDownloadInfo?prefix=abc&encoding=MPEG-4&test=789
- CGIMay 26, 2015AltostratusThanks I will give it a go and let you know, could we hav e done this with stream profile ? /Craig
- nitass_89166May 26, 2015Noctilucentwith http profile, stream profile/irule does rewrite http payload only (request and header are not included).
- CGIMay 31, 2015AltostratusThe rule worked so thanks for the help /Craig