# Markdown in Watcher Slack Action attachements

**URL:** <https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353>\
**Category:** Elasticsearch\
**Created:** [November 28, 2016, 1:41pm UTC](https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353 "2016-11-28T13:41:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JbRichardet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbrichardet/32/13197_2.png) [@JbRichardet](https://discuss.elastic.co/u/JbRichardet)\
**Post date:** [November 28, 2016, 1:41pm UTC](https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353/1 "2016-11-28T13:41:49Z")

</div>

Hello,

I'm configuring my X-Pack to send me Slack messages when I log an error in ES. The trick is I'd like to have the stacktrace formatted as a code block so I tried this

````
"notify_slack": {
      "slack": {
        "message": {
          "to": "@me",
          "text": "Proxy monitoring",
          "attachments" : [
            {
              "mrkdwn_in": ["text"],
              "title" : "Errors Found",
              "text" : "Encountered {{ctx.payload.hits.total}} errors in the last minute :scream:\n```\n{{ctx.payload.hits.hits.0._source.err.stack}}\n```",
              "color" : "danger"
            }
          ]
        }
      }
    }

````

I added the `mrkdwn_in` because I saw in [Slack documentation](https://api.slack.com/docs/message-formatting#message_formatting) that this is needed to apply markdown on attachment.

Unfortunately, this doesn't please X-Pack API:

```
{
    "error": {
        "root_cause": [
            {
                "type": "parse_exception",
                "reason": "could not parse message attachment field. unexpected field [mrkdwn_in]"
            }
        ],
        "type": "parse_exception",
        "reason": "failed to parse [slack] action [error/notify_slack]. failed to parse [message] field",
        "caused_by": {
            "type": "parse_exception",
            "reason": "could not parse slack message. failed to parse [attachments] field.",
            "caused_by": {
                "type": "parse_exception",
                "reason": "could not parse message attachment field. unexpected field [mrkdwn_in]"
            }
        }
    },
    "status": 400
}

```

Is there a way to make it acceptable or should I forget formatting my attachments?

Thank you

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 28, 2016, 1:54pm UTC](https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353/2 "2016-11-28T13:54:36Z")

</div>

Hey,

indeed this is currently not supported. I created an issue, so we fix it on the x-pack side.

--Alex

---

<div class="post-metadata">

**Author:** ![JbRichardet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbrichardet/32/13197_2.png) [@JbRichardet](https://discuss.elastic.co/u/JbRichardet)\
**Post date:** [November 28, 2016, 1:57pm UTC](https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353/3 "2016-11-28T13:57:10Z")

</div>

Thank you @spinscale!

Could you point me to this issue, or leave a message here when it's fixed so I could be alerted?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 28, 2016, 2:00pm UTC](https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353/4 "2016-11-28T14:00:08Z")

</div>

Hey,

that's internal unfortunately. I'll try to ping here when we fix it.

--Alex

---

<div class="post-metadata">

**Author:** ![JbRichardet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbrichardet/32/13197_2.png) [@JbRichardet](https://discuss.elastic.co/u/JbRichardet)\
**Post date:** [November 28, 2016, 2:01pm UTC](https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353/5 "2016-11-28T14:01:00Z")

</div>

I understand 🙂!

Thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 26, 2016, 2:01pm UTC](https://discuss.elastic.co/t/markdown-in-watcher-slack-action-attachements/67353/6 "2016-12-26T14:01:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
