Notify to slack#
You can trigger slack notifications by formatting log messages a certain way. The notify helper function does this for you, so that there is a single, consistent way to trigger notifications. See docs on how this works. Note that an instrument should always be set, so that an event definition in graylog can filter notification logs and notify the relevant slack channel for a given log message. This can be done by calling setup_logger and providing an instrument.
See this i15-1 event definition, and set one up to pick up notifications for your instrument if one doesn’t yet exist.
This notification configures how logs picked up by the above event definition are formatted and where to send them.