Forum Discussion

MR_Freddy's avatar
MR_Freddy
Icon for Nimbostratus rankNimbostratus
Apr 05, 2017

Summarize IRule using Switch command

I need to summarize the two below commands to different switch case ,, can you guide me ?

when HTTP_RESPONSE {

if { [HTTP::header exists Location] } { Here I would like to switch on IP (172.16.2.1:5050) to replace it to different IP (172.16.2.1) as I will have more IPs and I need to replace them to certain IPs HTTP::header replace Location [string map {"https:// 172.16.2.1:5050" "https:// 172.16.2.1"} [HTTP::header Location]] log local0. "[HTTP::header Location]" }
if { [HTTP::header Content-Type] contains "text" } {
The same Here, I would like to use switch to different cases using the Stream 

    STREAM::expression {@ https://172.16.2.1:5050@https:// 172.16.2.1@}
    STREAM::enable
}

}

No RepliesBe the first to reply