Forum Discussion
Scott_83827
Apr 10, 2012Nimbostratus
Log Not Showing Modified URI
The script below works properly. If the uri contains /hh/ then changes the extention from .cfm to .aspx and sends the request to the MigrationPool pool. So if you go to http://nowhere.com/hh/test.cfm it should send the request to http://nowhere.com/hh/test.aspx. It does this correctly. However, when I log the URI it shows the old URI in the log:
Rule Test1 HTTP_REQUEST: Migration Pool: /hh/news.cfm
I would expect it to say:
Rule Test1 HTTP_REQUEST: Migration Pool: /hh/news.aspx
Any ideas on why it does this?
when HTTP_REQUEST {
if { [HTTP::uri] contains "/hh/" } {
HTTP::uri [string map -nocase {.cfm .aspx} [HTTP::uri]]
log local0. "Migration Pool: [HTTP::uri]"
pool MigrationPool
} else {
log local0. "Current Production: [HTTP::uri]"
pool CurrentProduction
}
}
Thanks,
Scott
- nitassEmployeeNotes
- Scott_83827NimbostratusI don't understand what "log the value in a higher priority" means in this case.
- Michael_YatesNimbostratusHi Scott,
First iRule: when HTTP_REQUEST { log local0. "First iRule HTTP::uri Value: [HTTP::uri]" HTTP::uri "/something" } Second iRule: when HTTP_REQUEST { log local0. "Second iRule HTTP::uri Value: [HTTP::uri]" }
- Michael_YatesNimbostratusSorry,
First iRule: when HTTP_REQUEST { log local0. "First iRule HTTP::uri Value: [HTTP::uri]" HTTP::uri "/something" log local0. "First iRule, Post HTTP::uri Modification: [HTTP::uri]" } Second iRule: when HTTP_REQUEST { log local0. "Second iRule HTTP::uri Value: [HTTP::uri]" }
- Scott_83827NimbostratusOk, I understand now and I can see the correct value. Thank you for the explanation.
- hooleylistCirrostratusAs Michael and Nitass said, in pre-v11.0, many HTTP:: commands were cached in the same iRule event. To see the updated value in a single iRule you could use a later priority iRule event:
See priority wiki page for details: https://devcentral.f5.com/wiki/iRules.priority.ashx when HTTP_REQUEST { log local0. "Original \[HTTP::uri\] value: [HTTP::uri]" HTTP::uri "/something" } when HTTP_REQUEST priority 501 { log local0. "Updated \[HTTP::uri\] value: [HTTP::uri]" }
- Michael_YatesNimbostratusIt is worth noting that any iRule that does not specifically have the Priority set has a Priority of 500.
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