Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.blocklight.co/llms.txt

Use this file to discover all available pages before exploring further.

Send alerts to multiple channels simultaneously. Each channel can be configured with custom templates and severity filters.

Supported Channels

  • Log - Console output (JSON format)
  • File - Write to file (JSONL format)
  • Webhook - POST JSON to any HTTP endpoint
  • Slack - Slack webhook with Block Kit formatting
  • Discord - Discord webhook with rich embeds
  • Email - SMTP email notifications
  • Telegram - Telegram Bot API with MarkdownV2
  • Script - Execute custom scripts (Python/JavaScript/Bash)

Configuration

Configure alert channels in config.yaml:
alerting:
  enabled: true
  
  channels:
    - type: "log"
      enabled: true
      min_severity: "WARNING"
    
    - type: "file"
      enabled: true
      path: "output/detections.jsonl"
      min_severity: "NOTICE"
    
    - type: "slack"
      enabled: true
      url: "${SLACK_WEBHOOK_URL}"
      min_severity: "WARNING"
      icon_emoji: ":warning:"
    
    - type: "webhook"
      enabled: true
      url: "https://api.example.com/alerts"
      min_severity: "CRITICAL"

Template Variables

Use Go template syntax in notification messages:
template: |
  🚨 **{{.RuleName}}** detected
  
  **Severity:** {{.Severity}}
  **Transaction:** {{.TxHash}}
  **Block:** {{.BlockNumber}}
  **Network:** {{.Chain}}
  
  From: {{.Transaction.From}}
  To: {{.Transaction.To}}
  Value: {{.Transaction.Value}} wei

Available Variables

  • {{.RuleName}} - Rule name
  • {{.Severity}} - Priority level (NOTICE, WARNING, CRITICAL)
  • {{.TxHash}} - Transaction hash
  • {{.BlockNumber}} - Block number
  • {{.Chain}} - Blockchain name
  • {{.Transaction.*}} - Full transaction data
  • {{.Description}} - Rule description
  • {{.Output}} - Alert output message

Severity Filtering

Each channel can filter by minimum severity:
  • NOTICE - All alerts (lowest threshold)
  • WARNING - Warnings and critical alerts
  • CRITICAL - Only critical alerts (highest threshold)

Channel-Specific Features

Slack

  • Block Kit formatting (automatic)
  • Custom templates supported
  • Icon emoji configuration
  • Username customization

Discord

  • Rich embed formatting (automatic)
  • Custom templates supported
  • Avatar URL configuration
  • Username customization

Email

  • HTML formatting
  • SMTP configuration
  • Multiple recipients
  • Subject line customization

Telegram

  • MarkdownV2 formatting
  • Bot API integration
  • Chat ID configuration

Script

  • Execute custom scripts with finding data as JSON
  • Support for Python, JavaScript, Bash, etc.
  • Environment variables available
See Alert Configuration for complete setup examples.