• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

Cette traduction automatique est fournie pour votre commodité.

En cas d'incohérence entre la version anglaise et la version traduite, la version anglaise prévaudra. Veuillez visiter cette page pour plus d'informations.

Créer un problème

Envoyer un rapport à Slack

Exécuter une requête NRQL, convertir les résultats en CSV et les publier sur Slack.

Exigences:

  • Requête NRQL
  • Jeton Slack dans les secrets.

Ce que fait ce workflow :

  • Exécuter une requête NRQL sur le compte New Relic
  • Générer un CSV à partir des résultats de la requête
  • Publier un CSV sur un canal Slack avec un message

Actions clés: newrelic.nrdb.query, utils.transform.toCSV, slack.chat.postMessage

name: nrqlToSlackReport
workflowInputs:
accountId:
type: Int
nrqlQuery:
type: String
defaultValue: 'FROM Transaction SELECT count(*) FACET appName SINCE 1 hour ago'
slackChannel:
type: String
steps:
- name: queryData
type: action
action: newrelic.nrdb.query
version: 1
inputs:
accountIds:
- ${{ .workflowInputs.accountId }}
query: ${{ .workflowInputs.nrqlQuery }}
- name: convertToCSV
type: action
action: utils.transform.toCSV
version: 1
inputs:
data: ${{ .steps.queryData.outputs.results | tostring }}
- name: postToSlack
type: action
action: slack.chat.postMessage
version: 1
inputs:
token: ${{ :secrets:slack_token }}
channel: ${{ .workflowInputs.slackChannel }}
text: 'NRQL Query Report'
attachment:
filename: 'query-results.csv'
content: ${{ .steps.convertToCSV.outputs.csv }}

Et ensuite ?

Droits d'auteur © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.