All Apps and Add-ons

Slack Webhook Alert

biec1
Explorer

Hello Experts,

Version : Splunk Enterprise 7.0.2

We have configured alerts from scheduled search which successfully sends alerts to slack.
Using "Slack Webhook Alert" with $result.fieldname$ .

Currently we have a problem of formatting the appearance of message in slack.
Please provide some documents or resources where the formatting in splunk can be done,so that the message looks good in slack.

Thank you.

0 Karma

joseft
Explorer

Edit slack_webhook_alert.py

Replace the last line with :
try:
json_object = json.loads(slack_message)
requests.post(slack_webhook, data=slack_message)
except ValueError, e:
requests.post(slack_webhook, data=json.dumps({'text': slack_message}))

This will allow you to send the message as JSON

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...