Forum Discussion
Jobin1
Altostratus
Dec 18, 2019F5 APM Custom Variable Assign
How can i extract mobile number which is the header and assign to a custom variable. host header session.http.last.response_header.0 contains X-MOBILE_PHONE: 012345678 I need to ext...
Dario_Garrido
Noctilucent
Dec 18, 2019Hello Jobin.
You can get that using an iRule event instead of a custom variable in your VPE.
After doing that, you should configure a new iRule like next:
when HTTP_REQUEST {
if { [HTTP::header exists "X-MOBILE_PHONE"] } {
set phone [HTTP::header values "X-MOBILE_PHONE"]
}
}
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "addPhone" } {
ACCESS::session data set "session.custom.mobile" $phone
}
}
}Finally, you should associate this iRule with the VS.
KR,
Dario.
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
