Performance Logging iRule (Rule_http_log)
Problem this snippet solves: Here's a logging iRule. You'll need a HSL syslog pool to log too. Various bits gathered from other posts on DevCentral. Sharing in case there is interest. Make sure you...
Updated May 10, 2022
Version 4.0TimRiker
Cirrocumulus
Joined October 03, 2011
antec42
May 12, 2020Altostratus
I found that this upvar statement doesn't work (it crashes later when entering the foreach loop):
upvar 1 $mylog log
From what I understand, you're passing "log" already as a parameter to the hsllog proc and then do a reference from $mylog (which should be a copy of log?) back to yourself? I can't wrap my head around that. Any way I changed the name of the "log" variable inside hsllog proc to "alog", i.e. "upvar 1 $mylog alog" and used alog in the foreach loop instead. That works as expected…
Also you can check http2 version by using this instead:
if {[HTTP2::version] != 0} {
set log(http_version) [HTTP2::version]
} else {
set log(http_version) [HTTP::version]
}
Kind Regards,
Marcus