Logging for iRule isn't working?
Hello,
I want to output rejections for this iRule to a syslog server. My syntax is
when HTTP_REQUEST { if { !(([HTTP::host] starts_with "website.co.uk") or ([HTTP::host] starts_with ";) or ([HTTP::host] starts_with "backup.mywebsite.co.uk") or ([HTTP::host] starts_with ";)) } { discard } {log local0. "blocked [HTTP::header "User-Agent"] requesting [HTTP::host][HTTP::uri]"} }
I tried the following as well;
when HTTP_REQUEST { if { !(([HTTP::host] starts_with "website.co.uk") or ([HTTP::host] starts_with ";) or ([HTTP::host] starts_with "backup.mywebsite.co.uk") or ([HTTP::host] starts_with ";)) } { discard } log local0. "blocked [HTTP::header "User-Agent"] requesting [HTTP::host][HTTP::uri]" }
Which DID log but didn't show correctly in syslog.
Basically I want the syslog message to use the keyword 'blocked' to make searching easier.
Thanks