Forum Discussion
dlg_23340
Nov 18, 2011Cirrus
[class exists $redir_class]
Hello, all. I have an irule that needs to check if a class exists, then if it does, pull a record from it. If not, it should do nothing. in this case, the value contained in redir_class does not ex...
nitass
Nov 22, 2011Employee
mine is 10.2.3.
[root@ve1023:Active] config b version|grep -iA 1 version
BIG-IP Version 10.2.3 112.0
Final Edition
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set redir_class test_vars
if {[class exists $redir_class]}{
log local0. "[class match -value -- [HTTP::uri] starts_with $redir_class]"
} else {
log local0. "class $redir_class does not exist"
}
}
}
[root@ve1023:Active] config curl -I http://172.28.19.79/var1
HTTP/1.1 404 Not Found
Date: Tue, 22 Nov 2011 11:35:21 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
Content-Type: text/html; charset=iso-8859-1
[root@ve1023:Active] config
Nov 22 03:35:07 local/tmm info tmm[24220]: Rule myrule : 4
[root@ve1023:Active] config curl -I http://172.28.19.79/var2
HTTP/1.1 404 Not Found
Date: Tue, 22 Nov 2011 11:35:24 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
Content-Type: text/html; charset=iso-8859-1
[root@ve1023:Active] config
Nov 22 03:35:10 local/tmm info tmm[24220]: Rule myrule : 8
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set redir_class fake_test_vars
if {[class exists $redir_class]}{
log local0. "[class match -value -- [HTTP::uri] starts_with $redir_class]"
} else {
log local0. "class $redir_class does not exist"
}
}
}
[root@ve1023:Active] config curl -I http://172.28.19.79/var1
HTTP/1.1 404 Not Found
Date: Tue, 22 Nov 2011 11:35:58 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
Content-Type: text/html; charset=iso-8859-1
[root@ve1023:Active] config
Nov 22 03:35:43 local/tmm info tmm[24220]: Rule myrule : class fake_test_vars does not exist
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