Filtering Script in EventProcessing

Started by Spheron, June 25, 2015, 01:51:13 PM

Previous topic - Next topic

Spheron


Hello @all,

i'd like to implement a filtering script in event processing:

-----
if ($event->message like "*ERP Basis System*"){
  return false; // Match rule
}
return true;
-----

Event processing should only throw a alarm, if there is NOT the text "ERP Basis System" in the message text of the event. How can/must i use wildcards in filtering scripts?

Thanks for helping me...

Greets
Marco

Victor Kirhenshtein

Hi,

in matching scripts true means "match" and false means "do not match".

Best regards,
Victor



Spheron


Thanks for the reply. I understand this.

But i think that the code from above is false. Can i use "*" als wildcard in filtering code? Is the script above functional in NetXMS?

Spheron


I found a solution myself. I'm using following filter script in events to filter the message text with wildcards:

if($event->message ~= "(.*)ERP Basis System(.*)") return false;
else return true;

Greets
Marco