graylog-labs / graylog-plugin-slack

Graylog alarm callback for Slack
https://www.graylog.org
Apache License 2.0
117 stars 52 forks source link

Color field doesn't appear to change color of anything. #68

Closed phlod closed 6 years ago

phlod commented 6 years ago

Changing the color field in the Slack Alert window doesn't appear to actually change anything. Doesn't matter if I use 'good', 'danger', or hex codes.

Even in the screenshot on this GitHub page you can see that the Color field is set to #FF0000 -- which is red, but the (short) bar on the left side is grey.

phlod commented 6 years ago

I see now. In fact, the option to send alerts as Attachments was removed, and basic Slack messages don't support a color field, or pretty much any extra formatting fields. Please add back the option to send alerts with Attachments. I'm fine with crafting my own Slack messages in the Custom Message box, but not having the option at all has made my alert channels much harder to read.

Aenima4six2 commented 6 years ago

Can you send a before and after example please? Also, you should be able to use Slack's markdown like formatting.

phlod commented 6 years ago

Before: graylog attachment redacted

As I hope you can see in the picture, StreamID, Stream Title, etc. were formatted like titles, with the data underneath, and a red bar running down the length of the left side.

After: Well, after it's just a big mess of text. I'm not going to screenshot it because I don't have time right now to redact private data.

I've tried using the Slack markup, but I wasn't able to figure out a way to make it work. All my attempts to add things like "attachments": [ { ... }] To the Custom Message box, just printed the literal text, it had no effect on formatting. Perhaps I'm doing it wrong, but I tried an awful lot of different ways to make Slack see it as JSON, (enclosing everything in {}, using quotes, single quotes, no quotes, etc.) and I've had no luck. Is there a trick I'm not aware of? I can wrap URLs in <> and Slack seems to HTMLize them, but I think that's still possible without using Attachments.

What am I missing?

Aenima4six2 commented 6 years ago

@phlod You are not missing anything. Slack does not support adding color to anything but attachments. I am in the process of adding back the Attachment option to Outputs and will convert "Custom Messages" to attachments that support the color option.