Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Slack Plugin #569

Closed
5 of 6 tasks
lingpri opened this issue Sep 16, 2020 · 3 comments · Fixed by #618 or #595
Closed
5 of 6 tasks

Update Slack Plugin #569

lingpri opened this issue Sep 16, 2020 · 3 comments · Fixed by #618 or #595
Assignees
Labels

Comments

@lingpri
Copy link
Contributor

lingpri commented Sep 16, 2020

Description

The Slack Plugin need to be updated to work with the new notification/alerting system:

graylog-labs/graylog-plugin-slack#89

Why

We have paying customers (viasat) that make use of that and putting pressure on us to make this work again.

Broad Strokes

  • build UI
  • build back end
  • local testing
  • code refactoring ( eslint warning about stateless function, color picker, fix all or some of the todo's that bernd suggested )
  • unit testing

Fine grained Tasks

How to test this slack Plugin ?

slack notification is auto-triggered during an occurrence of an event definition (filter and aggregate on a search query)

Questions

  1. what are some attributes , that a user needs to fill in to successfully test this functionality ?

color,webhookUrl,channel,customMessage,backlogItemMessage, userName,notifyChannel,linkNames,iconUrl,iconEmoji,graylogUrl,proxy

  1. can this be tested without a web interface ?

  2. what protocol do we use to test this plugin ? (SMTP,TCP, Http).

  3. is the reminder an alert ?

  4. can I assume the email notification works ? yes.

  5. how do i test the email notification in graylog?
    https://community.graylog.org/t/how-to-send-email-alerts-using-gmail/4103

  6. where do i find the information to test my gmail email ?
    https://www.gmass.co/blog/gmail-smtp/

  7. which graylog ui component, should I use for each of the attribute in question 1?
    Refer : https://github.com/graylog-labs/graylog-plugin-slack

  8. what is the difference between okhttpclient vs httpclient ?
    https://square.github.io/okhttp/recipes/
    https://openjdk.java.net/groups/net/httpclient/recipes.html#proxy

  9. Test webhook url : https://hooks.slack.com/services/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

  10. curl command : curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/xxx/xxx/xxxxx678

Ref :

http://docs.graylog.org/en/3.1/pages/streams/alerts.html
https://api.slack.com/messaging/webhooks

Reference

https://github.com/sportalliance/graylog-plugin-slack-notification
Graylog2/graylog2-server#8893

@lingpri
Copy link
Contributor Author

lingpri commented Sep 16, 2020

Issue transferred from https://github.com/Graylog2/graylog-plugin-enterprise/issues/1217

@lingpri lingpri self-assigned this Sep 16, 2020
@lingpri lingpri linked a pull request Sep 17, 2020 that will close this issue
@lingpri lingpri linked a pull request Sep 22, 2020 that will close this issue
@lingpri
Copy link
Contributor Author

lingpri commented Sep 22, 2020

Slack_Notification

@bud1979
Copy link

bud1979 commented Oct 7, 2020

Looking good. We need to add back in the field of "Backlog Messages Size", so we can limit how many logs we are attaching the alert going to slack. We would want this separate from the Alert definitions backlog setting, with the Slack Setting over-riding the alert setting. In case the Alert is set at 50 Messages, but you really only want to send 3 messages for brevity to slack.

Also need to make sure that is noted below the field for clarity that the Slack setting over-rides the alert setting.

Lennart said this field was not in the code, so we need to make sure it is in working order, with current test we could set this to 1 and enable the rule to fire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment