Forum Discussion
2 Replies
- Kevin_StewartEmployee
There are quite a few options:
-
First, there's no specific reporting, per VIP, for server errors, for that you'd probably want to use an iRule attached to the VIP (in which case you've already narrowed it down to a specific VIP and pool)
-
You could log the response status codes locally.
-
You could log the response status codes remotely.
-
You could increment a local "statistics" counter for a given set of status codes.
when CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool syslog-pool] set clientip [IP::client_addr] set default_pool [LB::server pool] } when HTTP_RESPONSE { switch -glob [HTTP::status] { "40*" - "50*" { local log: /var/log/ltm log local0. "Client: \[$clientip\] received status code: \[[HTTP::status]\] from pool: \[$default_pool\]" high speed remote log HSL::send $hsl "<134>Client: \[$clientip\] received status code: \[[HTTP::status]\] from pool: \[$default_pool\]" stats profile (update counter) switch [HTTP::status] { "401" { STATS::incr status_check 401 } "404" { STATS::incr status_check 404 } "500" { STATS::incr status_check 500 } } } } }
The local logs show up in /var/log/ltm in the shell or the LTM log in the GUI. Remote logs will get sent to a syslog server in your environment. The stats can be found under Local Traffic - Profiles - Other - Statistics, and then under the Statistics tab of a given stats profile.
-
- What_Lies_Bene1Cirrostratus
OK, so, something like this;
when HTTP_RESPONSE { if { [HTTP::status] >= 400 } { log local0. "[LB::server addr] in Pool:[LB::server pool] returned HTTP status: [HTTP::status]" } }
Alternatively, if you meant only log this for a specific server;
when HTTP_RESPONSE { if { ([LB::server addr] equals 10.20.10.100) && ([HTTP::status] >= 400) } { log local0. “[LB:server addr] in Pool:[LB::server pool] returned HTTP status: [HTTP::status]” } }