Skip to main content

Log Drains

Forward service logs to external destinations like Datadog, Papertrail, Logtail, or any HTTP/syslog endpoint.

Supported Destinations

  • HTTP/HTTPS -- POST JSON log batches to any webhook endpoint
  • Syslog (TCP/UDP) -- Forward to syslog-compatible collectors
  • Configure filters by log level, text pattern, or structured fields
  • View delivery stats (sent, failed, lag, last error)
  • Send test log entries to verify your drain works
API
# Create a log drain
curl -X POST https://railpush.com/api/v1/services/<id>/log-drains \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Datadog",
"type": "http",
"url": "https://http-intake.logs.datadoghq.com/api/v2/logs",
"headers": {"DD-API-KEY": "your-key"},
"filter_level": "error"
}'

# Test a drain
curl -X POST https://railpush.com/api/v1/services/<id>/log-drains/<drain-id>/test \
-H "Authorization: Bearer <token>"

# Get delivery stats
curl https://railpush.com/api/v1/services/<id>/log-drains/<drain-id>/stats \
-H "Authorization: Bearer <token>"