Forum Discussion
swabbies_112156
Jan 24, 2012Nimbostratus
Relational class or tables
We are running v9.4.8.
I am looking to create a relation based class, not sure if this is a function of a table in v10.
the relation is that I want a way to evaluate...
hooleylist
Jan 31, 2012Cirrostratus
Sorry, I was mistaken on the name value format I gave for 9.x. That was added in ~10.0 or 10.1.
If you have a data group defined as this:
class test_penaltybox {
"testuser1 command1"
"testuser1 command2"
"testuser2 commnad1"
}
To look up a single string (like the UID) in the data group and get the second field you could use findclass:
log local0. [findclass testuser1 test_penaltybox " "]
Note that the data group name is test_penaltybox and should be referenced without the $:: prefix in 9.4.4+.
Or if you want to check if a uid and command combination exist, you could try this:
if {[matchclass "[URI::query ?&[HTTP::query] &uid] [URI::query ?&[HTTP::query] &command]" equals test_penaltybox]}{
log local0. "matched"
} else {
log local0. "no match"
}
Note the workaround used for a URI::query bug which was fixed in v11:
http://devcentral.f5.com/wiki/iRules.uri__query.ashx
Aaron
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