Forum Discussion
direct traffic based on information from the XML request
Hi Kevin,
i tried to apply the following IRULE: when HTTP_REQUEST { if { [HTTP::header Content-Type] contains "xml" } { HTTP::collect [HTTP::header Content-Length] }
when HTTP_REQUEST_DATA { set msisdn [string trim [findstr [HTTP::payload] "" 8 ""]]
enable for testing
log local0. "msisdn = $msisdn"
}
when HTTP_REQUEST { some function to parse out the digits from the xml request
switch -glob $msisdn {
"*0" {
if { [LB::status node 10.10.10.1] eq "up" } {
node 172.24.248.85 8580
} else {
node 172.24.248.85 8680
}
}
"*1" {
if { [LB::status node 10.10.10.2] eq "up" } {
node 172.24.248.85 8580
} else {
node 172.24.248.85 8680
}
}
default {
send to a default pool or node
}
}
}
}
but i got an error: 01070151:3: Rule [UCIP_MSISDN] error: line 6: [command is not valid in the current scope] [when HTTP_REQUEST { set msisdn [string trim [findstr [HTTP::payload] "" 8 ""]]
enable for testing log local0. "msisdn = $msisdn" }] line 12: [command is not valid in the current scope] [when HTTP_REQUEST { some function to parse out the digits from the xml request
switch -glob $msisdn { "0" { if { [LB::status node 10.10.10.1] eq "up" } { node 172.24.248.85 8580 } else { node 172.24.248.85 8680 } } "1" { if { [LB::status node 10.10.10.2] eq "up" } { node 172.24.248.85 8580 } else { node 172.24.248.85 8680 } } default { send to a default pool or node } } }]
appreciate your feedback.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
