Ad Widget

Collapse

Zabbix does not filter out records

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zvictorp
    Junior Member
    • Feb 2024
    • 5

    #1

    Zabbix does not filter out records

    Dear community

    The discovery rule looks as follows

    discovery[{#EXTIFNAME},1.3.6.1.4.1.3715.17.3.1.1.2,{#EXTIFMO DULE},1.3.6.1.4.1.3715.17.3.1.1.3,{#EXTIFPHYINTERF ACE},1.3.6.1.4.1.3715.17.3.1.1.4,{#EXTIFLOGINTERFA CE},1.3.6.1.4.1.3715.17.3.1.1.5]

    The device responds correctly and Zabbix turns it into right JSON format. That is ok.

    ......
    {
    "{#EXTIFLOGINTERFACE}": "254",
    "{#EXTIFMODULE}": "2",
    "{#EXTIFNAME}": "Module 2, IP input interface 1.254",
    "{#EXTIFPHYINTERFACE}": "1",
    "{#SNMPINDEX}": "21010254"
    },
    {
    "{#EXTIFLOGINTERFACE}": "1",
    "{#EXTIFMODULE}": "2",
    "{#EXTIFNAME}": "Module 2, Video output interface 1.1",
    "{#EXTIFPHYINTERFACE}": "1",
    "{#SNMPINDEX}": "22010001"
    },

    ......


    My goal is to exclude interfaces containing 'input' in its name from the result,

    For this purpose I've created a macros:
    {$EXTIFNAME_NOT_MATCHES} = ^.input.*$

    and added the following filter rule:
    {#EXTIFNAME} does not match {$EXTIFNAME_NOT_MATCHES}

    However, the filter does not work and always get the same set of values.

    Please, give me a hint where I am wrong.

    Thank you
    Last edited by zvictorp; 26-02-2024, 16:35.
  • Answer selected by zvictorp at 26-02-2024, 16:35.
    zvictorp
    Junior Member
    • Feb 2024
    • 5

    Thank you for your reply
    Originally posted by cyber
    Your regex does not match your data you can try with "^.*input.*$" or even plain "input" works better that yours.. Yours expects just one character between start of line and "input"...
    I didn’t notice a typo in my post until after I wrote it.

    I didn't know that filters are not applied when Test button pressed. I should create item prototypes and then test results.

    Comment

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

      #2
      Your regex does not match your data you can try with "^.*input.*$" or even plain "input" works better that yours.. Yours expects just one character between start of line and "input"...

      Comment

      • zvictorp
        Junior Member
        • Feb 2024
        • 5

        #3
        Thank you for your reply
        Originally posted by cyber
        Your regex does not match your data you can try with "^.*input.*$" or even plain "input" works better that yours.. Yours expects just one character between start of line and "input"...
        I didn’t notice a typo in my post until after I wrote it.

        I didn't know that filters are not applied when Test button pressed. I should create item prototypes and then test results.

        Comment

        Working...