Ad Widget

Collapse

logsource() trigger correct syntax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • z3d0
    Junior Member
    • Sep 2021
    • 1

    #1

    logsource() trigger correct syntax

    With Zabbix 5.4, logsource() trigger function requires a parameter and a period; since documentation is not updated yet, and with previous version (https://www.zabbix.com/documentation...gers/functions) the syntax was logsource (<pattern>), I need some help with a custom trigger

    The linked item is a working custom item that checks a log file, with the following key:
    Code:
    log[Path\to\file.log,"Some text '[A-Za-z0-9-]+' some other text: '[A-Za-z]+',"]

    So the trigger expression should be:

    Code:
    logsource(/Server Name/log[Path\to\file.log,"Some text '[A-Za-z0-9-]+' some other text: '[A-Za-z]+',"],#1,"Failed")=1

    Where "Failed" is the text to search in the log entry.

    The triggers returns: "Cannot evaluate logsource(...): invalid regular expression", but I don't understand why the regexpr is not correct, it's just a text match and I tested it in zabbix (admin > general > regexp)

    Tried also removing the #1 but nothing changed

    Thanks in advance!
Working...