Forum Discussion
dabance
Altocumulus
Nov 28, 2018filter based on "User-Agent" , irule
I want permit traffic to a VIP only if the User-Agent matches "Chrome/52.0.2743.98"
Does the below irule works?. Also i want to add logging.
when HTTP_REQUEST { if {[HTTP::header "User-Agent"] ...
PeteWhite
Employee
Nov 28, 2018Yes, that iRule should do the job although it is a little blunt. You also want to consider whether contains is good enough or you should have exact matching.
Logging can be done locally to /var/log/ltm with the log command eg
log local0.debug "User Agent: [HTTP::header user-agent]"
but ideally you would do regular logging to a remote server via HSL.
You may also want to check if the User-Agent header exists - note that HTTP headers are non case sensitive.
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