Ad Widget

Collapse

Unclear example in logrt.count documentation

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • seren
    Junior Member
    • Jun 2023
    • 10

    #1

    Unclear example in logrt.count documentation

    The logrt.count documentation has the example:
    Code:
    logrt.count["/home/zabbix/logs/^logfile[0-9]{1,3}$",,,100]
    with the description:
    this item will count the number of matches for the pattern "^logfile[0-9]{1,3}$" in log files in the "/home/zabbix/logs" directory.
    This description seems incorrect: the pattern "^logfile[0-9]{1,3}$" is for matching files in the log directory, and the description seems to say it's used for matching within log files.

    Also, the "regexp" parameter is left blank. In this case does `logrt.count` return the number of file matches, or the number of lines in the files (or something else)?

    So my question is, is this example valid and if so, should the description be something like:

    this item will count the number of _files_ matching the pattern "^logfile[0-9]{1,3}$" in the "/home/zabbix/logs" directory.
    or
    this item will count the number of _lines in files_ matching the pattern "^logfile[0-9]{1,3}$" in the "/home/zabbix/logs" directory.
    Thanks in advance!
  • Answer selected by seren at 05-02-2025, 14:49.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    That example seems to be faulty.. that regex part there is for logfile name and pattern has not been specified. It would return 0 as value, if any matching file is found. At least my testing shows it.

    You can select that text on that page, press ctrl-enter and then write your suggestions to change it.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4806

      #2
      That example seems to be faulty.. that regex part there is for logfile name and pattern has not been specified. It would return 0 as value, if any matching file is found. At least my testing shows it.

      You can select that text on that page, press ctrl-enter and then write your suggestions to change it.

      Comment

      • seren
        Junior Member
        • Jun 2023
        • 10

        #3
        Thanks for testing and confirming the example is faulty! I've submitted feedback on the documentation page.

        Comment

        Working...