0
  1. The log files to be monitored are as follows, and I want to monitor the string "ERROR".

    /var/log/waagent.log
    
  2. ITEM

    log[/var/log/waagent.log,,,,skip]
    

enter image description here

  1. Trigger : If more than 0, trigger will occur.

    count(/Linux Azure Waagent/log[/var/log/waagent.log,,,,skip],#1,"regexp","ERROR")>0
    

enter image description here

  1. Result

    It seems to be searching for "ERROR" throughout the log file. I want to find "ERROR" in the last line of the log file.

If possible, I also want to create a trigger that solves the problem when "INFO" is printed. Please help me.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
gotothesky
  • 13
  • 3

1 Answers1

0

For monitoring "ERROR" in the last line of the log file: Change the log file path to:

/var/log/waagent.log|tail -n 1
Modify the trigger condition to: count(/Linux Azure Waagent/log[/var/log/waagent.log|tail -n 1,,,,skip],#1,"regexp","ERROR") > 0

For creating a trigger for "INFO": Add a new trigger condition:javascriptcount(/Linux Azure Waagent/log[/var/log/waagent.log|tail -n 1,,,,skip],#1,"regexp","INFO") > 0

VSYS Host
  • 11
  • 1