Skip to main content

MS Teams

Notification

Synopsis

Sends alert notifications to Microsoft Teams channels using incoming webhooks, supporting Adaptive Card formatting with titles, text, facts, actions, and theme colors.

Schema

- msteams:
webhook_url: <string>
title: <string>
text: <string>
subtitle: <string>
image: <string>
theme_color: <string>
width: <string>
facts: <fact[]>
actions: <action[]>
description: <text>
if: <script>
ignore_failure: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>

Configuration

FieldRequiredDefaultDescription
webhook_urlN${MSTEAMS_WEBHOOK_URL}Microsoft Teams incoming webhook URL
titleY-Card title displayed prominently
textY-Main message body text
subtitleN-Subtitle displayed below the title
imageNVirtualMetric iconURL to image displayed in the card
theme_colorN#47BEFFCard accent color: good, warning, danger, info, or hex code
widthNFullCard width: Full for full-width cards
factsN-Array of fact objects with title and value fields
actionsN-Array of action objects with title and url fields
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseSee Handling Failures
on_failureN-See Handling Failures
on_successN-See Handling Success
tagN-Identifier

Details

The msteams processor sends notifications to Microsoft Teams channels using incoming webhooks with Adaptive Card formatting.

Webhook Setup: Create an incoming webhook in Teams:

  1. Open the target channel
  2. Click "..." → "Connectors" or "Workflows"
  3. Add "Incoming Webhook" connector
  4. Copy the webhook URL

Theme Colors: Visual severity indicators for the card's accent stripe:

  • good / green hex: Success, resolved incidents
  • warning / orange hex: Warnings, degraded states
  • danger / red hex: Errors, critical alerts
  • info / blue hex: Informational messages
  • Custom hex codes (e.g., #FF5733) for brand colors

Facts: Key-value pairs displayed in a structured format:

facts:
- title: "Server"
value: "{{ .hostname }}"
- title: "CPU"
value: "{{ .cpu_usage }}%"

Actions: Clickable buttons linking to external resources:

actions:
- title: "View Dashboard"
url: "https://dashboard.example.com/{{ .server }}"

Template Support: All string fields support Go template syntax with event field interpolation using {{ .field_name }}.

For integration patterns with schema validation, see Schema Drift Detection.

Examples

Basic Alert

Sending a simple alert notification...

{
"alert_name": "High CPU Usage",
"server": "prod-server-01",
"cpu_usage": "95%"
}
- msteams:
webhook_url: "${MSTEAMS_WEBHOOK_URL}"
title: "Alert: {{ .alert_name }}"
text: "CPU usage is at {{ .cpu_usage }} on server {{ .server }}"
theme_color: "danger"

Red-themed alert card sent to Teams channel...

Card with Facts

Including structured data as facts...

{
"alert_name": "Schema Drift Detected",
"schema": "ASimNetworkSessionLogs",
"missing": "3 required fields"
}
- msteams:
webhook_url: "${MSTEAMS_WEBHOOK_URL}"
title: "{{ .alert_name }}"
text: "Schema validation failed"
theme_color: "warning"
facts:
- title: "Schema"
value: "{{ .schema }}"
- title: "Missing Fields"
value: "{{ .missing }}"

Facts displayed in structured format below text...

Card with Actions

Adding clickable action buttons...

{
"alert_name": "Database Connection Failed",
"server": "db-server-01"
}
- msteams:
webhook_url: "${MSTEAMS_WEBHOOK_URL}"
title: "{{ .alert_name }}"
text: "Connection to {{ .server }} failed"
theme_color: "danger"
actions:
- title: "View Dashboard"
url: "https://dashboard.example.com/servers/{{ .server }}"
- title: "View Logs"
url: "https://logs.example.com/{{ .server }}"

Action buttons link to dashboards and logs...

Complete Card

Full-featured card with all elements...

{
"alert_type": "Critical",
"server": "prod-server-01",
"cpu_usage": "95%",
"memory_used": "87%",
"disk_space": "92%"
}
- msteams:
webhook_url: "${MSTEAMS_WEBHOOK_URL}"
title: "{{ .alert_type }} Alert"
subtitle: "Server: {{ .server }}"
text: "Server resources are critically high"
image: "https://example.com/alert-icon.png"
theme_color: "danger"
width: "Full"
facts:
- title: "CPU Usage"
value: "{{ .cpu_usage }}"
- title: "Memory Used"
value: "{{ .memory_used }}"
- title: "Disk Space"
value: "{{ .disk_space }}"
actions:
- title: "View Dashboard"
url: "https://dashboard.example.com/{{ .server }}"

Full-width card with image, facts, and actions...

Schema Drift Alert

Alerting on schema validation failures...

processors:
- check_schema:
schema: "ASimNetworkSessionLogs"
target_field: "schema_check"
on_missing:
- msteams:
webhook_url: "${MSTEAMS_WEBHOOK_URL}"
title: "Schema Validation Failed"
subtitle: "Data Quality Alert"
text: "Missing required fields detected"
theme_color: "danger"
facts:
- title: "Schema"
value: "ASimNetworkSessionLogs"
- title: "Valid"
value: "{{ .schema_check.is_valid }}"

Alert triggered automatically when schema drift detected...