Forum Discussion
9 Replies
Sort By
- Sriram_87174Nimbostratus
Are you trying to log the 404 error in the response packet? try using when HTTP_RESPONSE function and see if you can log 404 error.
- /404 is a uri not a response error
- Sriram_87174NimbostratusYou can try using HTTP::path instead of HTTP::uri when HTTP_REQUEST { if {[HTTP::path] != "/404"} { log local0. "uri = [HTTP::uri]" } }
- Sriram_87174NimbostratusI tried with both HTTP::path and HTTP::uri - It works fine. i am using v11.4.1 BIG IP appliance.
- arpydaysNimbostratus
does the logged /404 uri match exactly /404 as per your irule or does it start with or contain /404 i.e. /404/
cheers
- arpydaysNimbostratus
not sure what's going on then - I'm using 11.6 VE, prehaps you can run the same commands and post your results
ltm rule test404 { when HTTP_REQUEST { if {[HTTP::uri] != "/404"} { log local0. "uri = [HTTP::uri]" } } } [root@f5lab] config curl http://10.12.12.145/402 [root@f5lab] config curl http://10.12.12.145/403 [root@f5lab] config curl http://10.12.12.145/404 [root@f5lab] config curl http://10.12.12.145/405 Sep 18 16:43:00 f5lab info tmm[17994]: Rule /Common/test404 : uri = /402 Sep 18 16:43:05 f5lab info tmm[17994]: Rule /Common/test404 : uri = /403 Sep 18 16:43:11 f5lab info tmm[17994]: Rule /Common/test404 : uri = /405
Try using ne instead of !=. You may be having an issue with data type conversion. Using ne will ensure you are doing a string comparison. I'm not positive that is the issue, but it's an easy change to test.