Forum Discussion
Sumanta_88744
Cirrus
Jun 24, 2016i Rule for extracting specific value from http payload and using it for UIE persistence
Hi Experts What would be the iRule code for identifying and extracting a particular field from http payload and using it for creating UIE persistence? http.request.line == "X-3GPP-Intended...
cjunior
Nacreous
Jun 30, 2016Hi, the "X-3GPP-Intended-Identity" is a request header, isn't?
If so, I would try like this:when HTTP_REQUEST {
if { [HTTP::header exists "X-3GPP-Intended-Identity"] } {
regexp {sip:(.+@\w*\.[\w|-]*\.[\w|-]*)} [HTTP::header value "X-3GPP-Intended-Identity"] dummy key
if { [info exists key] } {
persist uie $key
}
unset -nocomplain dummy key
}
}
or this (without costly regex):
when HTTP_REQUEST {
if { [HTTP::header exists "X-3GPP-Intended-Identity"] } {
set values [split [lindex [split [HTTP::header value "X-3GPP-Intended-Identity"] :] 1] .]
set key [concat [lindex $values 0].[lindex $values 1].[lindex $values 2]]
if { $key ne "" } {
persist uie $key
}
unset values key
}
}
I hope it helps.
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