Ad Widget

Collapse

Trigger on a log

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cperera
    Junior Member
    • May 2007
    • 19

    #1

    Trigger on a log

    I found a few threads that may be related but doesn't exactly address my question.

    I have setup monitoring of a log file with the following key:
    hostname:log[/path/to/logfile/filename.log,BASIC\sREGULAR\sEXPRESSION]

    This works fine, whenever the string 'BASIC REGULAR EXPRESSION' is found I see that line show up in the history of the item. Now I want a trigger for whenever such a line is detected.

    But it seems like even the trigger needs a regexp like this:
    {hostname:log[/path/to/logfile/filename.log,BASIC\sREGULAR\sEXPRESSION].str(BASIC\sREGULAR\sEXPRESSION)}=1

    Is there a syntax so that I don't have to match the regexp even in the trigger? I suppose I could remove the regexp from the item's key and just have it in the trigger's key, but that would mean all the lines in the log being stored in the DB, and I don't want to waste so much space.



    Charith.
  • cperera
    Junior Member
    • May 2007
    • 19

    #2
    I got around the issue by setting the trigger to be
    {hostname:log[/path/to/logfile/filename.log,BASIC\sREGULAR\sEXPRESSION].regexp(.*)}=1

    But now I've run into this issue.


    I'm trying to send the matching line in the body of the email that's configured as an action, but there doesn't seem to be a macro that can give me that line. Any ideas on how to achieve this?

    Comment

    • cperera
      Junior Member
      • May 2007
      • 19

      #3
      Any tips for this? I want to be able to mail out the matching lines in the log when the trigger get's triggered.

      Comment

      Working...