Forum Discussion
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 more than 1 criteria for a class in relation. I know I can create 2 classes and have the irule match both, but the problem I run into is that the group of users may not all match the group of commands to be matched on.
In the example below I want to match testsuser1 on commands 1 and 2, but testuser2 should only match on command2. It is not scalable to create multiple matching classes for every user as the list is dynamic and will be frequently updated via api. At times there could be 2 users or there could be 15 users. Same with commands.
class penatly_box {
"testuser1" "command1"
"testuser1" "command2"
"testuser1" "command2"
}'
Is there a function that exists to handle these relations?
- hooleylistCirrostratusWith datagroups and memory tables, the key must be unique. If you want to have multiple values for a key, you could combine them:
class penatly_box { "testuser1" "command1|command2|command3" "testuser2" "command2" "testuser3" "command1" }
- swabbies_112156NimbostratusThanks Aaron.
- swabbies_112156NimbostratusStill need a bit of clarification on this.
- swabbies_112156Nimbostratus
duplicate
- swabbies_112156Nimbostratus
duplicate
- swabbies_112156Nimbostratussorry duplicate. deleted text
- hooleylistCirrostratusSorry, I was mistaken on the name value format I gave for 9.x. That was added in ~10.0 or 10.1.
class test_penaltybox { "testuser1 command1" "testuser1 command2" "testuser2 commnad1" }
if {[matchclass "[URI::query ?&[HTTP::query] &uid] [URI::query ?&[HTTP::query] &command]" equals test_penaltybox]}{ log local0. "matched" } else { log local0. "no match" }
- swabbies_112156NimbostratusThanks very much! Early testing looks great. Now I just have to sort out the logic.
- swabbies_112156NimbostratusHoolio.
- hooleylistCirrostratusThat looks right to me and saves on a test box. When you say it's not working, what error or issue do you see and when (saving the rule, during runtime or just not matching)?
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