Forum Discussion
NetworkTeam_178
Nimbostratus
Nov 04, 2016Logging 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 ";) o...
someguy_126006
Nimbostratus
Nov 04, 2016Have you tried, the below, where User-Agent is without quotes and has value?
when HTTP_REQUEST {
if { !(([HTTP::host] starts_with "website.co.uk") or ([HTTP::host] starts_with "www.website.co.uk";) or ([HTTP::host] starts_with "backup.mywebsite.co.uk") or ([HTTP::host] starts_with "www.backup.mywebsite.co.uk";)) } {
log local0. "blocked [HTTP::header value User-Agent] requesting [HTTP::host][HTTP::uri]"
discard
}
}
- cjuniorNov 04, 2016
Nacreous
So, the "log" command out of "if" statement, will register log even that is not blocked, am I wrong?
Respectfully. - someguy_126006Nov 04, 2016
Nimbostratus
Was a copy paste from the rule above, but yes, that is correct. I moved it up in though.
- NetworkTeam_178Nov 17, 2016
Nimbostratus
Thanks for your help guys
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects