Forum Discussion
smp_86112
Cirrostratus
May 13, 2010Logging output of an expression
OK I feel really dumb having to post this question, so please hit me with kid gloves. I'm trying to do something that appeared to be very trivial at first glance...
All I want to do is log the output of a simple expression:
[HTTP::uri] equals "/myuri"
I believe this expression should evaluate to a 1 or a 0, and that's the value I want to log. This was my first attempt:
when HTTP_REQUEST {
set val [[HTTP::uri] equals "/myuri"]
log local0. "$val"
}
I've also tried this more simple approach:
when HTTP_REQUEST {
log local0. "[[HTTP::uri] equals "/myuri"]"
}
By "try", I mean I've attempted all sorts of different placement of double-quotes, parenthesis, braces, and brackets. Either I get a syntax error updating the iRule, a TCL error "invalid command name "/myuri"", or the string [HTTP::uri] equals "/myuri". Is this a TCL thing, or am I just having trouble with the syntax?
- smp_86112
Cirrostratus
Yes, fantastic...it's a TCL thing. It's never clear to me when I need to look at the iRules wiki versus TCL doc, and I have a tough time navigating the TCL doc... - hoolio
Cirrostratus
- smp_86112
Cirrostratus
Oh man, you're great. Thanks a ton!!!
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