Forum Discussion
'OR' logic between Daga-Groups present in Irule
Hi Team,
Query related to the below Irule:
- dg_glob_blocks_starts_with and dg_lenovo_mgd_url_blocks are data groups, we wanted to have 'OR' logic between them, will || work ? 2.If point 1. is correct, still I am getting Irule error, kindly guide ?
when HTTP_REQUEST priority 500 { if {[class match [HTTP::uri] contains dg_glob_block_contains]}{ HTTP::redirect "http://www.XYZ.com" } elseif {[class match [HTTP::uri] starts_with dg_glob_blocks_starts_with] || [class match [HTTP::uri] starts_with dg_lenovo_mgd_url_blocks] } HTTP::respond 302 Location "http://www.XYZ.com"
log local0. " redirected to http://www.XYZ.com" return
}
Thanks and Regards PZ
3 Replies
- kunjan
Nimbostratus
Parenthesis missing after elseif
when HTTP_REQUEST priority 500 { if { [class match [HTTP::uri] contains dg_glob_block_contains] } { HTTP::redirect "http://www.XYZ.com" } elseif { [class match [HTTP::uri] starts_with dg_glob_blocks_starts_with ] or [class match [HTTP::uri] starts_with dg_lenovo_mgd_url_blocks] } { HTTP::respond 302 Location "http://www.XYZ.com" log local0. " redirected to http://www.XYZ.com" return } }
- Parveez_70209
Nimbostratus
Ok kunjan thank you..so u mean || will be supported by or statement..and if all good thnn will our logic works here..will wait for the feedback..this needs to be rollout into one of our proje t.
- Parveez_70209
Nimbostratus
Hi All,
Still showing error, kindly guide:
when HTTP_REQUEST priority 500 { if {[class match [HTTP::uri] contains dg_glob_block_contains]}{ HTTP::redirect "http://www.lenovo.com" } elseif {[class match [HTTP::uri] starts_with dg_glob_blocks_starts_with] || [class match [HTTP::uri] starts_with dg_lenovo_mgd_url_blocks]} HTTP::respond 302 Location "http://www.lenovo.com"
log local0. " redirected to http://www.lenovo.com"return
}
Thanks and Regards Parveez
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