teams.message() function

The teams.message() function is a user-contributed function maintained by the package author and can be updated or removed at any time.

The teams.message() function sends a single message to a Microsoft Teams channel using an incoming webhook.

*Function type: Output*

  1. import "contrib/sranka/teams"
  2. teams.message(
  3. url: "https://outlook.office.com/webhook/example-webhook",
  4. title: "Example message title",
  5. text: "Example message text",
  6. summary: "",
  7. )

Parameters

url

Incoming webhook URL.

*Data type: String*

title

Message card title.

*Data type: String*

text

Message card text.

*Data type: String*

summary

Message card summary. Default is "". If no summary is provided, Flux generates the summary from the message text.

*Data type: String*

Examples

Send the last reported status to a Microsoft Teams channel
  1. import "contrib/sranka/teams"
  2. lastReported =
  3. from(bucket: "example-bucket")
  4. |> range(start: -1m)
  5. |> filter(fn: (r) => r._measurement == "statuses")
  6. |> last()
  7. |> findRecord(fn: (key) => true, idx: 0)
  8. teams.message(
  9. url: "https://outlook.office.com/webhook/example-webhook",
  10. title: "Disk Usage"
  11. text: "Disk usage is: *${lastReported.status}*.",
  12. summary: "Disk usage is ${lastReported.status}"
  13. )

Package author and maintainer

Github: @sranka
InfluxDB Slack: @sranka