shank098 has asked for the wisdom of the Perl Monks concerning the following question:
Hey all
Hoping that someone can give me a hand with this one...
A while back now I created a script which queries a MySQL database with the goal being to send email notifications to the proper tech support staff. It's pretty basic stuff,
If SlotA = Value AND SlotB = Value AND SlotN = value then notify GroupA
So if all the Slots and values in the event match what we have in the DB, then we know who or what group to send the event to. The issue is that it's based completely on AND statements.
The problem that I have found with this method is that I have to create/maintain a ton of filters since all the slots/values have to match.
What I would like to do is something like the following,
If SlotA = Value and SlotB = Value and (SlotC = value OR SlotC = value) then notify GroupA
Anyone have any tips on how to tackle this?
Without getting into too much detail about the DB structure I have one table which holds all my filter information. Here's it structure,
id int(3)So an example of a filter might look something like this,
1 - 1 - slotA - valueI am hung up on how to construct the logic in situations where a single slot can have multiple values...the original method with to simply dump all the values from the DB into a Hash and then check that slot/value combos against what was being received from the monitoring system...I am hung up on how to do the "OR" statements...
Any suggestions would be appreciated...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Building a notification system based on MySQL
by jfroebe (Parson) on Nov 17, 2008 at 21:32 UTC | |
|
Re: Building a notification system based on MySQL
by Illuminatus (Curate) on Nov 17, 2008 at 23:48 UTC | |
|
Re: Building a notification system based on MySQL
by ig (Vicar) on Nov 17, 2008 at 23:30 UTC | |
by shank098 (Initiate) on Nov 18, 2008 at 14:16 UTC | |
|
Re: Building a notification system based on MySQL
by duckyd (Hermit) on Nov 18, 2008 at 00:14 UTC | |
by shank098 (Initiate) on Nov 18, 2008 at 14:20 UTC | |
by shank098 (Initiate) on Nov 18, 2008 at 16:42 UTC |