Discord error notifications

Can anyone help me here…I can’t seem to find the documentation for this (sorry if it is out there), but I’m trying to format a local discord/webhook notification with parameters and it’s not working. Can’t for the life of me figure it out. this is my formatted message

{:warning: Error Alert: The monitor ‘{{sieve.name}}’ encountered an error URL: {{sieve.uri}} Monitor ID: {{sieve.id}} Time: {{sieve_data.ts}}}

attached are screenshots of my config on the UI.

thanks.

1 Like

my other screenshot

the first step to troubleshoot an alert or error action is to check the job log at Distill Web Monitor. can you check these and let me know what you see?

  1. are the error actions listed?
  2. are they successful or have errored out?
  3. did the discord channel receive any message for the successful ones?

sieve_data is only available in case of a change. when an error occurs, there is no new sieve_data recorded. you can use {{work.ts}} for getting the timestamp at which the last error was logged.

can you should remove the outer curly brackets unless you need for a specific purpose.

we will add this note to the documentation.

looking at the logs it wasn’t sending webhooks after error action but it is after removing the outer braces. i also only updated the work.ts but the sieve.name and sieve.id are returning data now.

working content value:

⚠️ **Error Alert** 📊 Monitor: **{{sieve.name}}** 🔗 URL: {{sieve.uri}} 🆔 Monitor ID: {{sieve.id}} ⏰ Time: {{work.ts}}

returns the discord in the attached screenshot.

can you run an embed or even some new lines (\n) to get nicer formatting? i tried a few embeds with no luck.

{
  "embeds": [{
    "title": "⚠️ Monitor Error Detected",
    "description": "The monitor **{{sieve.name}}** has encountered an error",
    "color": 15158332,
    "fields": [
      {
        "name": "🔗 URL",
        "value": "{{sieve.uri}}",
        "inline": false
      },
      {
        "name": "🔍 Monitor ID",
        "value": "{{sieve.id}}",
        "inline": true
      },
      {
        "name": "⏰ Timestamp",
        "value": "{{work.ts}}",
        "inline": true
      }
    ],
    "footer": {
      "text": "Distill Web Monitor"
    }
  }]
}

or

⚠️ **Error Alert**\n\n📊 Monitor: **{{sieve.name}}**\n🔗 URL: {{sieve.uri}}\n🆔 Monitor ID: {{sieve.id}}\n⏰ Time: {{work.ts}}

neither worked using the embed or the new lines.

if no go on embeds or new lines then no worries but just curious. thank you.