Skip to content

Event Router

event-router

The event-router plugin is a flexible event processing system for RackN DRP that filters, transforms, and routes events to multiple output destinations.

Configuration

The event-router can be configured using either:

Parameter Configuration: Use the event-router/event-fto parameter

Parameter Configuration

Set the event-router/event-fto parameter with JSON containing output and rules sections.

Set the event-router/name parameter to optionally set the event names to something other than the default.

Output Destinations

File Output (Primary Example)

Write events to rotating log files with automatic file management:

JSON
{
  "output": {
    "destinations": [
      {
        "type": "file",
        "file_path": "/var/log/drp",
        "file_name": "drp-events.log",
        "max_size": 10000000,
        "max_files": 5
      }
    ],
    "format": "json"
  },
  "rules": [
    {
      "name": "machine_events",
      "filter": "machines.*.*",
      "transform": {
        "select_fields": ["Time", "Action", "Key", "Principal", "Object.Name"]
      }
    }
  ]
}

Kafka Output

Send events to Kafka topics for real-time stream processing. Configure with brokers, topic, and optional headers:

JSON
{
  "type": "kafka",
  "topic": "drp-events",
  "brokers": ["localhost:9092"],
  "kafka_headers": {"source": "drp"}
}

Auditor Functionality

Write events to the audit entries object in DRP

JSON
{
  "rules": [{
    "name": "audit-user-actions",
    "filter": "*.*.*.And(event.Principal=Re(^user:),event.Principal=Ne(user:docker-context),event.Principal=Ne(user:racks),event.Type=Ne(websocket),event.Type=Ne(connections),event.Type=Ne(audit_entries),event.Type=Ne(activities))"
  }],
  "output": {
    "destinations": [{
      "type": "drp_audit"
    }]
  }
}

Event Filtering

The event-router supports flexible event filtering using DRP's event filter syntax:

Basic Filters

  • *.create.* - All create events
  • *.delete.* - All delete events
  • machines.create.* - Machine creation events
  • machines.delete.* - Machine deletion events
  • jobs.create,delete.* - Job creation and deletion events