smp_86112
May 13, 2010Cirrostratus
Logging 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?