For the complete documentation index, see llms.txt. This page is also available as Markdown.

Transform event

Rewrite an event inside an event flow before it is branched on or routed: set, copy, map, template, merge and append fields, for every event or only those that match a condition.

A Transform event node rewrites the event as it passes through an event flow. Every node after it works with the new values: a Branch condition tests them, and Route to alert source hands the rewritten event to the alert source.

Use it to fix an event before anyone is paged by it:

  • Turn a tool's own severity words into an ilert priority.

  • Put the environment in the summary, so the alert says where it comes from.

  • Add a label or a runbook link that the tool never sends.

The node is available on every account that has event flows.

Add a Transform event node

1

Open the flow in the editor

Go to Alerting → Event flows, open the flow and click Edit.

2

Add the node

Click the + where the event should be rewritten and choose Transform event. Right below Incoming event is the usual place, because then every later node sees the result. The node's settings open at once.

3

Add rules

Click Add rule, or one of the Quick start chips to begin from a prepared rule. For each rule, choose a Target field, the field the rule writes, and an Operation, then fill in the value. Rules run from top to bottom; the arrows on a rule move it up or down.

4

Limit it to some events (optional)

Check Transform events that meet the following conditions and build the condition. Events that do not match pass through the node unchanged.

5

Save the flow

Click Close, then Save. Close only keeps your rules in the editor; the flow does not change until you save it. If ilert rejects a rule, the node shows an error icon on the canvas, and hovering over it gives the reason.

To confirm it works, send a test event to the flow and open its logs. The node's entry lists every field it changed. See Check what a node changed.

The Transform event settings of the Acme Checkout normalization flow: an Optional title field; Quick start chips Prefix summary, Set priority, Add labels, Add links and Add details; an unchecked box Transform events that meet the following conditions; and a rule named Priority from severity with Target field context.event.priority, Operation Map values, Source field context.event.customDetails.severity, a table mapping critical and error to HIGH and warning to LOW, and Default value LOW.
A Map values rule. Every rule names the field it writes and the operation it uses.

Quick start

Each chip adds one rule, which you then complete.

Chip
Adds a rule that

Prefix summary

Uses Template on context.event.summary, prefilled with [PREFIX] {{context.event.summary}}

Set priority

Uses Set value on context.event.priority

Add labels

Uses Merge properties on context.event.labels

Add links

Uses Add to array on context.event.links

Add details

Writes a table of properties into context.event.details, which holds text. ilert rejects this rule when you save. To add custom details, change Target field to context.event.customDetails and Operation to Merge properties

How the node runs

  1. If the node has a condition, ilert evaluates it once, before any rule. An event that does not match passes through unchanged, and the log shows Skipped. A condition that fails to evaluate also lets the event pass unchanged, without a Skipped entry.

  2. The rules run from top to bottom. Each rule sees what the rules above it wrote: a rule that reads context.event.summary gets the summary an earlier rule rewrote.

  3. The next node gets the rewritten event.

A rule that fails does not stop the node or the flow. The log records an error that names the rule, and the next rule runs. Some mistakes are not errors and change nothing, such as copying from a field the event does not have. When a rule seems to do nothing, check the log.

Two fields can be overwritten after the node. If a Route to alert source node overrides the escalation policy or the notification priority, it replaces the routingKey or priority a transform set.

Fields you can write

Target field offers the event's own fields under Event properties, followed by the custom fields found in the sample payloads of the flow's integrations. You can also type a path.

Target field
Holds
Operations

context.event.summary, context.event.details, context.event.alertKey, context.event.routingKey

Text

Set value, Copy from field, Template, Map values

context.event.eventType

ALERT, ACCEPT or RESOLVE

Set value, Copy from field, Map values

context.event.priority

HIGH or LOW

Set value, Copy from field, Map values

context.event.severity

1 to 5, shown as SEV1 to SEV5

Set value, Copy from field, Map values

context.event.labels

Key-value pairs

Set value, Merge properties

context.event.customDetails

The event's custom payload

Set value, Merge properties

context.event.customDetails.<path>

Any value

All six, unless the path contains the name of an event field, such as severity or labels. Then the editor offers that field's operations

context.event.links, context.event.images, context.event.services, context.event.comments

Lists

Set value, Add to array

A few things to know about these fields:

  • Event type changes what the event does. ACCEPT and RESOLVE act on the open alert with the same alert key instead of creating one. A value that is not an event type is skipped and logged as an error.

  • Priority must end up exactly HIGH or LOW, in capitals. The node writes whatever a rule produces without checking or converting it, so check your mappings. A priority the event leaves the flow with replaces the alert source's own priority setting.

  • Severity must be a number from 1 to 5. Any other value is skipped and logged as an error.

  • You cannot write a single label. context.event.labels.team is not a valid target: Merge properties adds labels and Set value replaces all of them.

  • Custom details paths are created as needed. Set value on context.event.customDetails.ticket.queue creates ticket if the event has none. Write a dot inside a key as \., as in context.event.customDetails.k8s\.namespace, and an array position as [0]. A path can otherwise contain only the letters A to Z, digits, _ and -, so a key with a space, a colon, a slash or any other character cannot be written.

Reference event fields

A value can contain references to the event in double braces, such as {{context.event.summary}} or {{context.event.customDetails.env}}. Every operation renders them. That covers the text of Set value, the target values and default of Map values, the values of Merge properties and every field of an Add to array item. References use the ilert template language, so functions work too: {{context.event.customDetails.env.upperCase()}}.

Two fields read differently from how they are written:

  • The alert key reads as incidentKey. As a target, context.event.alertKey works. As a Source field, in a reference or in a condition, write context.event.incidentKey: {{context.event.alertKey}} renders undefined, and a condition on context.event.alertKey matches nothing. Source field and the condition editor offer alertKey all the same. In the logs, the field is called incidentKey.

  • A field the event does not have renders as the word undefined. A template like [{{context.event.customDetails.env}}] {{context.event.summary}} turns into [undefined] Refund queue backlog for an event without env. Give the reference a fallback with orElse: {{context.event.customDetails.env.orElse("no env")}}.

Limit the node to some events

The condition is built the same way as a Branch condition: filter groups combined with AND and OR, or ICL in the code editor. Events that do not match pass through unchanged.

ICL compares text without regard to case, so context.event.priority == 'high' matches HIGH. In event flows, != nil cannot tell you whether a field exists, because it is also true for a field the event does not have. Test for the value you expect instead, such as context.event.customDetails.env == 'prod'.

Operations

Set value

Writes a fixed value into the target. The editor adapts to the field:

  • Event type, priority and severity: pick a value from the list.

  • Text: type it, with references if you like.

  • Labels and custom details: a Properties table of keys and values. It replaces all labels or all custom details. To add without removing, use Merge properties.

  • Lists: an Items list that replaces the entire list. With no items, the list is cleared. If every item turns out invalid once its references are filled in, the list is left as it was.

  • A path the editor does not know, such as a custom details path: the value is text by default. Use as object and Use as array switch the editor.

Copy from field

Copies the value of Source field into the target. If the event has no such field, the target keeps its value. Into a custom details path, any value is copied, objects and lists included. Into one of the event's own fields, only text, numbers and true or false are copied, as text; an object or a list leaves the target unchanged.

Template

Composes text from fixed text and references, using the ilert template language:

Map values

Looks up the value of Source field in a table and writes the matching Target value. Matching is exact and case-sensitive: Critical does not match a row for critical. When no row matches, the rule writes Default value (when no mapping matches).

Merge properties

Adds keys to context.event.labels or to custom details. A key the event already has keeps its value: an event that arrives with the label team: web keeps web even if the rule sets team to payments. Within custom details, nested objects are merged level by level, under the same rule.

To overwrite labels, use Set value, which replaces all of them.

Add to array

Appends items to a list, creating the list if the event has none. Each kind of list has its own fields:

List
Fields

context.event.links

URL and Link text, both required. The URL must start with http:// or https://, and is limited to 2,048 characters; the text to 512

context.event.images

Image URL, Link URL (optional), Alt text

context.event.services

ID or Service alias. A service with the same alias as one the event already lists, or the same ID when there is no alias, is not added again

context.event.comments

Creator and Comment. Comment is required

Items can contain references. An item that is invalid once its references are filled in, such as a link whose URL renders as undefined, is skipped and logged as an error. The other items are still added.

Check what a node changed

Open the flow, click View event flow logs, and select an entry to open Event flow log details. The Transform event entry shows:

  • Transformed fields: each field the node changed, as before → after. Lists and objects show their type and size, such as ARRAY (0) → ARRAY (1), and custom details show only whether they changed.

  • Transformed event: the whole event as it left the node.

  • Skipped, instead, when the node's condition did not match.

  • Error in and the rule's name, with the reason, once for each problem. A rule that skips three items logs three errors.

If no rule changed anything, the entry has neither Transformed fields nor Transformed event.

The Incoming event entry above it can show the event as it left the Transform event node rather than as it arrived. The values the event arrived with are the "before" values under Transformed fields.

Event flow log details for one event in the Acme Checkout normalization flow. The Transform event entry lists Transformed fields: summary from Checkout p95 latency above 2s to [prod] Checkout p95 latency above 2s, priority to HIGH, links from ARRAY (0) to ARRAY (1), and labels from NULL (undefined) to OBJECT (1). Above it, the Incoming event entry already shows the rewritten summary and HIGH priority.
Read Transformed fields for what a node did. The Incoming event entry above already shows the rewritten summary.

Example: normalize events from a monitoring tool

A tool sends its severity as a word in a custom field, puts the environment in another, and links its runbook in a third:

YOUR_INTEGRATION_KEY is the key of the API integration on the flow's Incoming event node. One Transform event node with four rules makes the event ready to route:

Rule
Target field
Operation
Value

Priority from severity

context.event.priority

Map values

Source field context.event.customDetails.severity; critical → HIGH, error → HIGH, warning → LOW; Default value (when no mapping matches) LOW

Environment in summary

context.event.summary

Template

[{{context.event.customDetails.env.orElse("no env")}}] {{context.event.summary}}

Team label

context.event.labels

Merge properties

team → payments

Runbook link

context.event.links

Add to array

URL {{context.event.customDetails.runbook}}, Link text Runbook

The event leaves the node with these changes, and the custom details are unchanged:

Field
Before
After

Summary

Checkout p95 latency above 2s

[prod] Checkout p95 latency above 2s

Priority

none

HIGH

Labels

none

team: payments

Links

none

Runbook, pointing at https://runbooks.acme.example/checkout-latency

Limits

Limit
Value

Rules per node

30. The editor lets you add more, but ilert rejects the node when you save

Characters in a value, template or condition

4,096

Items per Add to array rule

50

Rows per Map values table

200

Properties per Set value or Merge properties table

299, counting nested values (300 for Merge properties on labels)

Items a Set value list writes

50. Any further items are dropped when the rule runs

Last updated

Was this helpful?