log
44 TopicsPrint string found in Data Group to Log
I have an iRule that is looking in the HTTP POST request method data payload for a string that is defined in a data-group. I would like to print to the log whichever string from the referenced data-group is found. # See https://devcentral.f5.com/s/question/0D51T00006i7hpJSAQ/irule-to-block-requests-with-specific-word # #ltm data-group internal restricted_dg { #records { #restricted {} #} #type string #} when HTTP_REQUEST_DATA { set payload [HTTP::payload] if {[class match [string tolower $payload] contains "restricted_dg"]} { # set variable named restricted_text to the string found in $payload # that matches something in data-group restricted_dg log local0. "Rejecting restricted content $restricted_text" reject } }505Views1like2Commentsurl redirect irule
I am trying to get an irule working for redirecting a url to a different one. When users connect *.host1.abc.com it needs to redirect to *.host2.xyz.com when HTTP_REQUEST { if { [class match [string tolower [HTTP::host]] contains *.host1.abc.com redirect] } { *.host2.xyz.com #log local0. "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri]" } } }360Views1like5Comments