<commit_before>---
title: Customizing Alert Target Templates
keywords: alert targets
tags: [alerts, best practice]
sidebar: doc_sidebar
permalink: alert_target_customizing.html
summary: Learn how to customize alert target templates.
---

You can use Wavefront alert targets to integrate alerts with many types of notification systems. [Using Alert Targets to Send Alerts to Notification Systems](webhooks_alert_notification.html) explains how to create and manage alert targets.

Alert target customization variables and customization functions support customizing alert target templates. Wavefront alert target templates support [Mustache syntax](https://mustache.github.io/).

## Alert Target Customization Iterators and Properties

You can customize the alert target using iterators and properties.

The iterator categories are:
* `failing`
* `inMaintenance`
* `newlyFailing`
* `recovered`

The iterators return three types of objects:

- `host` - Affected source (host). The only value returned by `XXXHosts` iterators such as `failingHosts` or `newlyFailingHosts`.
- series - Returned by `XXXSeries` iterators such as `failingSeries` or `newlyFailingSeries`.
  - `host` - Affected source (host).
  - `label` - Metric or aggregation.
  - `tags` - Point tags on the series.
- alert series - Returned by `XXXAlertSeries` iterators such as `failingAlertSeries` or `newlyFailingAlertSeries`. You can further customize objects of type alert series, but not the other object types.
  - `host` - Affected source (host).
  - `label` - Metric or aggregation.
  - `tags` - Point tags on the series.
  - `observed` - Number of points returned by the alert condition.
  - `firing` - Number of points that satisfy the alert condition.
  - `stats` - Series statistics: `first`, `last`, `min`, `max`, and `mean`. These are values for the Display Expression associated with the alert. If you do not set the Display Expression, the iterator returns the only the value that is associated with the alert condition. Because the condition that triggers the alert is always either 0 or not 0, that information is usually not useful.

Only the `XXXAlertSeries` and `XXXfailingSeries` iterators iterate through an empty source (host).

Alert targets support the following customization variables:
<table>
<colgroup>
<col width="25%"/>
<col width="75%"/>
</colgroup>
<thead>
<tr><th>Variable</th><th>Definition</th></tr>
</thead>
<tbody>
<tr>
<td markdown="span">`additionalInformation`</td>
<td>Text in the Additional Information section of the alert.</td>
</tr>
<tr>
<td markdown="span">`alertId`</td>
<td>ID of the alert that triggered the alert target.</td>
</tr>
<tr>
<td markdown="span">`alertTags`</td>
<td>List of tags associated with the alert that triggered the alert target.</td>
</tr>
<tr>
<td markdown="span">`condition`</td>
<td>Alert condition query.</td>
</tr>
<tr><commit_msg>Minor fix to alert targets<commit_after>---
title: Customizing Alert Target Templates
keywords: alert targets
tags: [alerts, best practice]
sidebar: doc_sidebar
permalink: alert_target_customizing.html
summary: Learn how to customize alert target templates.
---

You can use Wavefront alert targets to integrate alerts with many types of notification systems. [Using Alert Targets to Send Alerts to Notification Systems](webhooks_alert_notification.html) explains how to create and manage alert targets.

Alert target customization variables and customization functions support customizing alert target templates. Wavefront alert target templates support [Mustache syntax](https://mustache.github.io/).

## Alert Target Customization Iterators and Properties

You can customize the alert target using iterators and properties.

The iterator categories are:
* `failing`
* `inMaintenance`
* `newlyFailing`
* `recovered`

The iterators return three types of objects:

- `host` - Affected source (host). The only value returned by `XXXHosts` iterators such as `failingHosts` or `newlyFailingHosts`.
- series - Returned by `XXXSeries` iterators such as `failingSeries` or `newlyFailingSeries`.
  - `host` - Affected source (host).
  - `label` - Metric or aggregation.
  - `tags` - Point tags on the series.
- alert series - Returned by `XXXAlertSeries` iterators such as `failingAlertSeries` or `newlyFailingAlertSeries`. You can further customize objects of type alert series, but not the other object types.
  - `host` - Affected source (host).
  - `label` - Metric or aggregation.
  - `tags` - Point tags on the series.
  - `observed` - Number of points returned by the alert condition.
  - `firing` - Number of points that satisfy the alert condition.
  - `stats` - Series statistics: `first`, `last`, `min`, `max`, and `mean`. These are values for the Display Expression associated with the alert. If you do not set the Display Expression, the iterator returns only the value that is associated with the alert condition. Because the condition that triggers the alert is always either 0 or not 0, that information is usually not useful.

Only the `XXXAlertSeries` and `XXXfailingSeries` iterators iterate through an empty source (host).

Alert targets support the following customization variables:
<table>
<colgroup>
<col width="25%"/>
<col width="75%"/>
</colgroup>
<thead>
<tr><th>Variable</th><th>Definition</th></tr>
</thead>
<tbody>
<tr>
<td markdown="span">`additionalInformation`</td>
<td>Text in the Additional Information section of the alert.</td>
</tr>
<tr>
<td markdown="span">`alertId`</td>
<td>ID of the alert that triggered the alert target.</td>
</tr>
<tr>
<td markdown="span">`alertTags`</td>
<td>List of tags associated with the alert that triggered the alert target.</td>
</tr>
<tr>
<td markdown="span">`condition`</td>
<td>Alert condition query.</td>
</tr>
<tr>
{'fraction_non_alphanumeric': 0.10290283330436294, 'fraction_numerical': 0.0020858682426560054, 'mean_word_length': 4.883435582822086, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6524244', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1583, 'n_words': 696}