Forum Discussion
Chadwick_McInni
Nimbostratus
Oct 04, 2005iRule that generates an email
Is there a way to have an iRule generate an email from the BigIP when an event happens? For example, we want an email to be sent to a group whenever a certain vip is hit 10 times in one minute from the same IP.
Thanks,
Chad
- Colin_Walker_12Historic F5 AccountChad,
- Chadwick_McInni
Nimbostratus
Thanks Colin! I'm going to give this a shot and reply back with how it works. - Chadwick_McInni
Nimbostratus
We have syslog-ng setup to email us whenever the term "script_kiddies" shows up in the ltm logs. I've used unRuley's post (http://devcentral.f5.com/Default.aspx?tabid=28&view=topic&forumid=5&postid=2169) as a starting point for our rule to notify us when one connection hits a particular site more than three times per second. The rule I've written is not looping correctly, any suggestions? Here's the rule I have so far:when HTTP_REQUEST { log "$reqs_sec [HTTP::uri]" set cur_time [clock seconds] if { [HTTP::request_num] > 1 } { if { $cur_time == $start_time } { if { [HTTP::uri] contains "SomethingInTheURI" } { incr reqs_sec log "$reqs_sec" if { $reqs_sec > "3" } { log "to [HTTP::uri]" log "script_kiddies from [IP::client_addr] hit [HTTP::uri] three or more times per second at $cur_time" return } } } } set reqs_sec "0" set start_time $cur_time }
when HTTP_REQUEST { set cur_time [clock seconds] if { [HTTP::request_num] > 1 } { if { $cur_time == $start_time } { if { $reqs_sec > 3 } { HTTP::respond 503 Retry-After 2 } incr reqs_sec return } } set start_time $cur_time set reqs_sec 0 }
- Colin_Walker_12Historic F5 AccountWhen you say it's not looping properly...what do you mean? Could you provide some more clarification as to how the iRule is behaving in comparison to how you'd like it to behave?
- unRuleY_95363Historic F5 AccountI think you may want to place the
if { [HTTP::uri] contains "SomethingInTheURI" } {
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