HTTP::uri caching

Hi

Irule snippet…

set foo [HTTP::uri]
log local0.info "foo = $foo"
set foo [string map -nocase {"jim" "fred"} [HTTP::uri]]
log local0.info "foo =  $foo"
set HTTP::uri foo
log local0.info "HTTP::URI =  [HTTP::uri]"

…gives…

May 29 09:23:49 10.39.49.55 tmm tmm[4854]: Rule XXXX :  foo = /jim/services/ServiceA
May 29 09:23:49 10.39.49.55 tmm tmm[4854]: Rule XXXX :  foo =  /fred/services/ServiceA
May 29 09:23:49 10.39.49.55 tmm tmm[4854]: Rule XXXX :  HTTP::URI =  /jim/services/ServiceA

…and the URI passed onto the pool is /jim/services/ServiceA, when I want it to be /fred/services/ServiceA - web logs of the server in the pool show that /fred/services/ServiceA is being passed to the server

Why isn’t the HTTP::uri assignment actually happening/sticking? Looks like there’s some caching going on in the iRule?

It’s the only iRule associated with the VS

Grateful for any assistance - this is causing a big problem at the moment

Thanks Martin

…sorry about the formatting!

e.g.

config

[root@ve11a:Active:In Sync] config  tmsh list ltm rule qux
ltm rule qux {
    when HTTP_REQUEST {
  log local0. "\[HTTP::uri\] = [HTTP::uri]"
  set newuri [string map -nocase {"jim" "fred"} [HTTP::uri]]
  HTTP::uri $newuri
  log local0. "\[HTTP::uri\] = [HTTP::uri]"
}
}

 /var/log/ltm

[root@ve11a:Active:In Sync] config  tail -f /var/log/ltm
May 29 01:43:00 ve11a info tmm1[9801]: Rule /Common/qux : [HTTP::uri] = /jim/services/ServiceA
May 29 01:43:00 ve11a info tmm1[9801]: Rule /Common/qux : [HTTP::uri] = /fred/services/ServiceA

Thanks for the prompt reply

I added a $ into

set HTTP::uri foo

i.e. set HTTP::uri $foo

..but still the same result :frowning:

“BIG-IP 10.2.3 Build 112.0 Final” if that makes a difference?

I’ve read: DevCentral - An F5 Technical Community ..which seems to be a similar issue, resolved by changing iRule order - but I only have this one irule.

Any ideas please…

Thanks Martin

e.g.

config

[root@ve10:Active] config  tmsh list ltm rule qux
ltm rule qux {
    when HTTP_REQUEST priority 100 {
  log local0. "\[HTTP::uri\] = [HTTP::uri]"
  set newuri [string map -nocase {"jim" "fred"} [HTTP::uri]]
  HTTP::uri $newuri
}
when HTTP_REQUEST priority 200 {
  log local0. "\[HTTP::uri\] = [HTTP::uri]"
}
}

 /var/log/ltm

[root@ve10:Active] config  tail -f /var/log/ltm
May 29 16:44:49 local/tmm info tmm[4955]: Rule qux : [HTTP::uri] = /jim/services/ServiceA
May 29 16:44:49 local/tmm info tmm[4955]: Rule qux : [HTTP::uri] = /fred/services/ServiceA

e.g.

config

[root@ve10:Active] config  tmsh list ltm rule qux
ltm rule qux {
    when HTTP_REQUEST priority 100 {
  log local0. "\[HTTP::uri\] = [HTTP::uri]"
  set newuri [string map -nocase {"jim" "fred"} [HTTP::uri]]
  HTTP::uri $newuri
}
when HTTP_REQUEST priority 200 {
  log local0. "\[HTTP::uri\] = [HTTP::uri]"
}
}

 /var/log/ltm

[root@ve10:Active] config  tail -f /var/log/ltm
May 29 16:44:49 local/tmm info tmm[4955]: Rule qux : [HTTP::uri] = /jim/services/ServiceA
May 29 16:44:49 local/tmm info tmm[4955]: Rule qux : [HTTP::uri] = /fred/services/ServiceA

this is due to ID224251 (iRule command caching does not properly get cleared when data changes) which is fixed in 11.0.0.

this is due to ID224251 (iRule command caching does not properly get cleared when data changes) which is fixed in 11.0.0.

Unfortunately 11.0.0 is not an option at the moment.

But it looks like splitting the “When HTTP_REQUEST” into two different priority parts has solved the problem. Well, it looks like it has - if it continues to be a problem, I’ll be back

Many thanks for the quick responses

Martin

just want to be clear. this is about caching data when logging only. uri is changed correctly.

OK. Understood. Thanks