Forum Discussion
Leo_Rodrigues_1
Altocumulus
Jun 22, 2015Sporadic TCL errors from iRule showing up in logs
Hello!
I noticed a few errors are showing up on /var/log/ltm. To be able to further debug it, I added a log statement to the script. It then became evident that the log message comes up only ~10% o...
StephanManthey
Nacreous
Jun 24, 2015Hi Leo,
the
scan in your code works fine to remove the trailing route domain information.In my sample (tested on TMOS v10.2.4) below I use
getfield instead.I´m testing for the variable and validate the IPv4 address before logging it.
In case the variable does not exist or
catch detects an invalid IPv4 address an error will be logged.
set client_ip "[getfield [IP::client_addr] "%" 1]"
if { [info exists client_ip] } {
if { [catch {IP::addr ${client_ip} mask 255.255.255.255}] } {
log local0. "error: no valid IPv4 address found (${client_ip})"
} else {
log local0. "address found (${client_ip})"
}
} else {
log local0. "error: variable \$client_ip does not exist"
}
Regarding the error: I guess the result of the scan may contain white space characters or invalid characters causing the TCL error. My sample code might help to figure out these strings.
Thanks,
Stephan
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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