I 'am looking for a example of script to create a pre-processing filter from a lua script ?
I need to pre filter some type of alarms comming from application's.
No, this is before it is recorded in the database, but the data returned by the script is stored if changed.
If you want to post-process it then you'll need to run in through an AO profile/script.
The pre-processing script kan result in a modified or deleted inbound alarm event. The following scripts simply overrides the origin and prepends a string to the message.
if event.hostname == "xpcase" then
event.origin = "Metropolis"
event.message = "LUA: " .. event.message
The snippet below deletes the event if the hostname is 'my.server' :
if event.hostname == "my.server" then
Retrieving data ...