Forum Discussion
Anthony_Epron
Nimbostratus
Dec 08, 2016How use Datagroup in iRule ?
Hello Guys,
I need to write an iRule for extract the radius attribute 81 and check if this attribute is present on my datagroup.
For the moment i write this iRule :
when CLIENT_DATA {
log ...
Kai_Wilke
MVP
Dec 08, 2016Hi Anthony,
The first column of the data-group is the "search string" and the seconds column is the "return-value" of the data-group entry. The
equals, contains, starts_with or ends_with operators of the [class match] command is always comparing your $input with the "search strings" of the given datagroup and then may or may not return the return-data or simply boolean 0|1 depending on the used [class] command syntax...
You can give it another try using the slightly polished iRule below...
when CLIENT_DATA {
log "Irule OK - The vlan is [RADIUS::avp 81]"
if { [class match [RADIUS::avp 81] equals vlancheck] } {
log "Vlan OK"
} else {
log "Vlan not OK"
}
}
... in combination with a modified data-group...
ltm data-group internal vlancheck {
records {
202 { }
203 { }
}
type string
}
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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