Skip to content

Add an ability to use macro processing functions in message templates. #56

@ozaryx

Description

@ozaryx

Add an ability to use not only macros in templates, but also macro processing functions. Sometimes you need to pull something out of a macro using a regular expression.
For example,

{EVENT.NAME} = "ora primary DB_TEST,dbtest - status - SLA=1"
{{EVENT.NAME}.regsub("^ora .* ([^ ].*),.*$",\1)} => "DB_TEST"

According to the documentation
https://www.zabbix.com/documentation/6.0/en/manual/config/macros/macro_functions

Now an attempt to use macro functions looks like this

---start cut message---
DB_NAME: {ora primary DB_TEST,dbtest  - status - SLA=1.regsub("^ora .* ([^ ].*),.*$",\1)}
---end cut message---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions