0

Slack でメッセージの書式設定を使用しようとしています。Elastalert Testrule.yaml ファイルが部分的に解析されています。Slack アラートは、 フィールドslack_alert_fieldsalert_textフィールドのみで表示されます。アラートで添付ファイルも送信したい。attachmentsSlackアラート用のボタンを使用または作成する方法は?

es_host: elasticsearch
es_port: 9200
name: Test rule Alert
type: any
index: alerts-*
filter:
- term:
    alertType.keyword: "New alert created"

alert:
- "slack"

slack_alert_fields:
- title: Network Name
  value: networkName
  short: true
- title: Alert Type
  value: alertType
  short: true
slack_actions:
- name: "network url"
  text: "Network URL"
  type: "button"
  value: networkUrl

alert_text: |
            alertData : {0}

alert_text_type: alert_text_only
alert_text_args: ["alertData"]

attachments: [
    {
        "fallback": "Required plain-text summary of the attachment.",
        "color": "#37964f",
        "pretext": "New alert created",

        "title":  alertData.reason ,
        "fields": [
            {
                "title": "Network Name",
                "value": networkName,
                "short" : true
            },
            {
                "title": "Timestamp",
                "value": timestamp,
                "short" : true
            }
            ],
            "actions": [
                {
                    "name": "network url",
                    "text": "Network URL",
                    "type": "button",
                    "value": networkUrl
                },
                {
                    "name": "org_url",
                    "text": "Organization URL",
                    "type": "button",
                    "value":  organizationUrl

                }

                ]

    }
    ]


slack_webhook_url:
- "https://hooks.slack.com/xxxxxxxxxxxxxxxxxxxxxxx"
4

1 に答える 1