Forum Discussion
Alex_Chan_88951
Nimbostratus
Jul 21, 2008Add data in the class
I have create a class "rate_limit_black_list" in the gui, this class store the black list host. But when i cannot use irule to insert data in the group. is my irule syntax problem or what makes me cannot do that ? thanks.
I have add "1.1.1.1" in the class, so "tested" can print in the log. And when the office ip match the client ip all statement is processed, I can see "office ip black listed" in the log and the the web page show collectly. Just the lappend that statement not working, please help.....thanks.
when HTTP_REQUEST {
set client_ip [IP::remote_addr]
set office_ip "xxx.xxx.xxx.xxx"
set test "1.1.1.1"
if {[matchclass $test equals $::rate_limit_black_list]}{
log local0.info "tested"
}
if { $office_ip == $client_ip }{
lappend "$client_ip\n" $::rate_limit_black_list
log local0.info "office ip black listed"
pool http_01
}
}
- Nicolas_Menant
Employee
Hi, - hoolio
Cirrostratus
I thought you could add to a datagroup with lappend, but the change couldn't be saved to file and wouldn't be persisted through a reload of the configuration. I don't remember the exact details from the last time this came up and couldn't find the post I was thinking of. - Nicolas_Menant
Employee
Hi, - Alex_Chan_88951
Nimbostratus
Thx all of your help, I am totally unerstand how the class and data group work, thx all you guy....^^ - hoolio
Cirrostratus
Is there a compelling reason changes can't be saved from memory to file from an iRule? In theory you could run a cronjob to modify the class from outside the rule using 'b class CLASS_NAME...', and/or save the config running in memory to file using 'b config save'. I'm wondering if it's opening a can of worms or more plausible.
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