Ad Widget

Collapse

I need help with preprocessing an ITEM in zabbix.

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • XxSoulDarkxX
    Junior Member
    • Dec 2023
    • 14

    #1

    I need help with preprocessing an ITEM in zabbix.

    I need help with preprocessing an ITEM in zabbix.

    The ITEM returns the following line:

    QMNAME(rsdcapjboss01) STATUS(Running)

    and in Preprocessing I want to use a regular expression to extract only the word that is inside the second parenthesis "Running"

    I tried different ways but it only accepts the following regex "(STATUS\([^\)]*\))" which should get what I need but extracts "STATUS(Running)" instead of "Running".

    I try several ways but it shows me the error "I am receiving this invalid parameter ""/1/params/1": invalid regular expression."

    Click image for larger version

Name:	prepro.jpg
Views:	178
Size:	36.6 KB
ID:	477032

    Click image for larger version

Name:	prepro 2.jpg
Views:	180
Size:	59.9 KB
ID:	477033


    Using "STATUS\(([^)]+)\)" shows the error

    Click image for larger version

Name:	image.png
Views:	159
Size:	10.2 KB
ID:	477035
    Click image for larger version

Name:	image.png
Views:	168
Size:	17.5 KB
ID:	477036

    Click image for larger version

Name:	image.png
Views:	171
Size:	18.9 KB
ID:	477034​​
  • Answer selected by XxSoulDarkxX at 12-01-2024, 20:51.
    Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    Code:
    STATUS\((.*)\)
    and first capture group \1

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #2
      Code:
      STATUS\((.*)\)
      and first capture group \1

      Comment

      • XxSoulDarkxX
        Junior Member
        • Dec 2023
        • 14

        #3
        Originally posted by Hamardaban
        Code:
        STATUS\((.*)\)
        and first capture group \1
        Thanks, it worked, but I would like to know why some regular expressions that should work don't work.

        Is there any specification that needs to be kept in mind to use some regular expressions?​

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #4
          Perl Compatible Regular Expressions (PCRE, PCRE2) are supported in Zabbix​dd
          all information at https://www.zabbix.com/documentation...sions?hl=regex

          Comment

          Working...