elastalert2 icon indicating copy to clipboard operation
elastalert2 copied to clipboard

Allow any msg color for Slack

Open thecatontheflat opened this issue 1 year ago • 9 comments

Description

Allows any color for Slack messages. Currently only 3 values are supported in the library, but I would like it to be any hex color value as per their docs: https://api.slack.com/reference/messaging/attachments#fieldsts

Changes the color of the border on the left side of this attachment from the default gray. Can either be one of good (green), warning (yellow), danger (red), or any hex color code (eg. #439FE0)

Checklist

  • [x] I have reviewed the contributing guidelines.
  • [ ] I have included unit tests for my changes or additions.
  • [x] I have successfully run make test-docker with my changes.
  • [ ] I have manually tested all relevant modes of the change in this PR.
  • [ ] I have updated the documentation.
  • [ ] I have updated the changelog.

Questions or Comments

If you think this change makes sense, I'll continue with the checklist

thecatontheflat avatar Feb 20 '24 09:02 thecatontheflat

I think it sounds like a good improvement. It would be good to document what the behavior is if an invalid color name or hex code is given, so that users can be aware of what to look for in case they make a mistake. Such as forgetting to prepend the hex char, etc.

jertel avatar Feb 20 '24 11:02 jertel

I think the documentation should be updated as well. https://github.com/jertel/elastalert2/blob/master/docs/source/alerts.rst

nsano-rururu avatar Feb 20 '24 14:02 nsano-rururu

I think similar settings for mattermost and rocketcat need modification as well.

nsano-rururu avatar Feb 20 '24 14:02 nsano-rururu

Updated the docs according to Slack documentation for the color.

thecatontheflat avatar Feb 20 '24 15:02 thecatontheflat

@thecatontheflat Once you complete the remaining checklist items I will merge this. It looks like you already completed the doc updates so that can probably be checked off, and I'm not sure whether a unit test is feasible for a schema change, but the other two checklist items need completed.

jertel avatar Feb 25 '24 15:02 jertel

This PR is stale because it has been open for 30 days with no activity. The longer a PR remains stale the more out of date with the main branch it becomes.

github-actions[bot] avatar Mar 26 '24 20:03 github-actions[bot]

@thecatontheflat

Have you verified that the settings are working?

nsano-rururu avatar Mar 29 '24 13:03 nsano-rururu

@thecatontheflat

Please update CHANGELOG.md.

nsano-rururu avatar Mar 29 '24 14:03 nsano-rururu

@thecatontheflat

Is it possible to create test code?

nsano-rururu avatar Mar 29 '24 14:03 nsano-rururu

This PR is stale because it has been open for 30 days with no activity. The longer a PR remains stale the more out of date with the main branch it becomes.

github-actions[bot] avatar Apr 29 '24 20:04 github-actions[bot]

This PR was closed because it has been inactive for 30 days since being marked as stale. It will be automatically locked after an additional 30 days. If there is still a commitment to finishing this PR please re-open it, or request that a project maintainer re-open it before it becomes locked.

github-actions[bot] avatar May 29 '24 20:05 github-actions[bot]