Forum Discussion
madhawa_chamind
Aug 19, 2018Nimbostratus
Irules with parameter values in target url
Hi,
When defining irules inside a data group file is it possible to add the url parameters in to the target url. As an eg:- please check below
Eg:- "mysite.one.com" := "mysite.second.com/v...
jaikumar_f5
Aug 19, 2018MVP
One way to do this is like below,
datagroup with values of target host with full uri. As URI involves query parameter, planned to call the complete URI itself. Note the host and and URI are split by "|" in the data value.
ltm data-group internal /Common/test_dgl {
records {
mysite.one.com {
data "mysite.second.com|variable?PartnerIdpId=http://team02.com"
}
}
type string
}
Irule: On the irule, using the "|" as a delimiter.
ltm rule test_rule {
when HTTP_REQUEST {
set data_value ""
set newhost_value ""
set newuri_value ""
if { [set data_value [class match -value [HTTP::host] equals test_dgl]] ne ""} then {
set newhost_value [getfield $data_value "|" 1 ]
log local0. "New HOST Value is $newhost_value"
set newuri_value [getfield $data_value "|" 2 ]
log local0. "New URI Value $newuri_value"
Do something
}
}
}
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