ExportXMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      SLA service tags with the "contains" operator do not match any service when the value contains "_" or "%". Values without these characters match correctly. The "equals" operator also works correctly.

      Steps to reproduce:
      1. Create a service and give it a tag, e.g. tag "TEST_SLA" with value "TEST_SLA_A".
      2. Create an SLA with a service tag: name "TEST_SLA", operator "Contains", value "TEST_SLA_".
      3. Save the SLA and check the matching services: no services are returned.
      4. Repeat with value "TEST" (no underscore): the service matches.

      Result:
      No services are matched when the contains value contains "" or "%". The same happens with a value like "TEST_SLA%".

      Expected:
      "Contains" should match underscores , so value "TEST_SLA_" should match service tags "TEST_SLA_A", "TEST_SLA_B", etc.

      Notes:

      • Affects Zabbix 7.0 (tested on 7.0.24) and current master (8.0).
      • Root cause: in ui/include/classes/api/services/CService.php the LIKE pattern is built as
          REPLACE(REPLACE(REPLACE(UPPER(sst.value), '%', 'Unable to render embedded object: File (%'), '_', ') not found._'), '!', '!!')
          Escaping "Unable to render embedded object: File (" last duplicates the ") not found." characters introduced for "%" and "_", producing a broken pattern.
      • Suggested fix: escape "!" first:
          REPLACE(REPLACE(REPLACE(UPPER(sst.value), '!', '!Unable to render embedded object: File ('), '%', ') not found.%'), '', '!')

            Assignee:
            Zabbix Support Team
            Reporter:
            Juan V, Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: