UK CA Unified Infrastructure Management User Group

 View Only

LUA script to detect to keywords

  • 1.  LUA script to detect to keywords

    Posted Jan 30, 2017 01:43 PM

    Hi all,


    I'm looking to create a LUA script to detect the username in the alert text, if the usernames match - no action (disregard the alert)


    If no match - alert.


    Here is an example of the alert text:


    Unathorised Change Profile Entries: (Audit trail entry) USERNAME - USERNAME



    I have a similar script that takes variables using the preceding text: 


    local pattern = " pre=(%d+) invoke=(%d+) post=(%d+) send=(%d+) "

    local a = alarm.get()

    local vpre,vinvoke,vpost,vsend = string.match(a.message, pattern)


    But in the example alert text above there is no preceding text to set the variable on.


    Has anyone got any advice on how to build this further?