Forum Discussion
Gary_Bristol_19
Nimbostratus
Oct 12, 2015Irule to External Data Group not pulling up second data field
In using an External Data Group everything seems to work except for the pulling up of the second data area.
when RULE_INIT {
Turn Debug on or off (0=off 1=on)
Turn debug off in prod
...
Gary_Bristol_19
Nimbostratus
Oct 13, 2015Here is the final version of the iRule
when RULE_INIT {
Turn Debug on or off (0=off 1=on)
Turn debug off in prod
set static::redir_debug 1
}
when HTTP_REQUEST {
Use following to match against datagroup
Lookup the redirect or pool based upon match_string value
set goto [class match -value [string tolower [HTTP::host][HTTP::path]] starts_with www_ou_edu_redir_class]
if {$static::redir_debug}{log local0. "Goto: $goto"}
if { [getfield $goto "," 1] equals "pool" }{
if {$static::redir_debug}{log local0. "Pool declaration detected. Going to: [getfield $goto "," 2]"}
pool [getfield $goto "," 2]
} else {
if {$static::redir_debug}{log local0. "Redirect declaration detected. Redirecting to: [getfield $goto "," 2]"}
HTTP::redirect http://[getfield $goto "," 2]
}
}
and then here is a sample of the external Datagroup file that goes with the rule that works.
ags.ou.edu := "redir,www.ou.edu/ags.html",
ags.ou.edu/~ := "redir,parker.ou.edu",
airport.ou.edu := "redir,www.ou.edu/airport.html",
alc.ou.edu := "pool,ouwww_bostitch",
so what i was missing, which was pointed out here was the fact that the F5 was unable to pull out the second part of the data. encapsulating the data in Double Quotes enabled that to work.
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