Forum Discussion
NZ_David_20489
Nimbostratus
Oct 09, 2013How to match multiple HTTP headers
I've been tasked with creating an iRule that searches for a header of 'screen' and field of 'ABC'. The iRule (or part of iRule) is below:
} elseif {[string tolower [HTTP::header value screen]] e...
Kevin_Stewart
Employee
Oct 09, 2013It's a little odd because this appears to actually work with multiple headers in 11.3:
when HTTP_REQUEST {
if { [string tolower [HTTP::header screen]] equals "abc" } {
log local0. "match"
}
}
What version are you on?
In lieu of the above, you could also iterate through the list of headers like this:
when HTTP_REQUEST {
foreach x [HTTP::header names] {
if { ( $x equals "screen" ) and ( [string tolower [HTTP::header $x]] equals "abc" ) } {
log local0. "match"
break
}
}
}
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