Skip to content
Skillv1.0.0

pilot-event-log

Persistent NDJSON event logging with rotation, compression, and retention policies. Use this skill when: 1. You need persistent storage of event streams 2. You need log rotation and compression for lo

by TeoSlayer(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from TeoSlayer/pilot-skills (skills/pilot-event-log/SKILL.md). Install upstream with npx skills add TeoSlayer/pilot-skills --skill pilot-event-log. Copyright stays with the author (AGPL-3.0).

Pilot Event Log

Persistent NDJSON logging of Pilot Protocol event streams with rotation and compression.

Commands

Subscribe and Log

pilotctl --json subscribe <source> <topic> --timeout <seconds> | jq -c '.data.events[]' >> <log-file.ndjson>

Query by Time

jq -c --arg start "2026-04-08T00:00:00Z" --arg end "2026-04-08T23:59:59Z" \
  'select(.timestamp >= $start and .timestamp <= $end)' events.ndjson

Query by Topic

jq -c 'select(.topic | startswith("alerts."))' events.ndjson

Rotate Logs

[ "$(du -m "$log_file" | cut -f1)" -ge "$MAX_SIZE_MB" ] && mv "$log_file" "$log_file.$(date +%s)" && gzip "$log_file.$(date +%s)" &

Compress Old Logs

find /var/log/pilot-events -name "events-*.ndjson" -mtime +1 -exec gzip {} \;

Retention Cleanup

find /var/log/pilot-events -name "events-*.ndjson.gz" -mtime +90 -delete

Workflow Example

#!/bin/bash
# Production event logging

SOURCE="${1:-production-app}"
LOG_DIR="/var/log/pilot-events/$SOURCE"
MAX_SIZE_MB=500

mkdir -p "$LOG_DIR"
log_file="$LOG_DIR/current.ndjson"

while true; do
  pilotctl --json subscribe "$SOURCE" "*" --timeout 600 | jq -c '.data.events[]? // empty' | \
  while IFS= read -r event; do
    echo "$event" | jq -c '. + {logged_at: (now | todate)}' >> "$log_file"

    size_mb=$(du -m "$log_file" 2>/dev/null | cut -f1)
    if [ "${size_mb:-0}" -ge "$MAX_SIZE_MB" ]; then
      rotated="$LOG_DIR/events-$(date +%Y%m%d-%H%M%S).ndjson"
      mv "$log_file" "$rotated" && gzip "$rotated" &
    fi
  done
  sleep 5
done

Dependencies

Requires pilot-protocol skill, jq (1.6+), gzip, and running daemon.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/teoslayer-pilot-skills-pilot-event-log/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

teoslayer-pilot-skills-pilot-event-log.ocm.jsonjson
{
  "ocm": "1",
  "id": "teoslayer-pilot-skills-pilot-event-log",
  "kind": "skill",
  "name": "pilot-event-log",
  "description": "Persistent NDJSON event logging with rotation, compression, and retention policies. Use this skill when: 1. You need persistent storage of event streams 2. You need log rotation and compression for long-term retention 3. You need to audit event history with timestamps 4. You need to export events for external analysis Do NOT use this skill when: - You need real-time event processing (use pilot-event-bus instead) - You need short-term replay (use pilot-event-replay instead) - You need filtered logs (use pilot-event-filter first, then log)",
  "publisher": "TeoSlayer",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "pilot-protocol",
      "pub-sub",
      "logging",
      "audit",
      "persistence",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Persistent NDJSON event logging with rotation, compression, and retention policies. Use this skill when: 1. You need persistent storage of event streams 2. You need log rotation and compression for long-term retention 3. You need to audit event history with timestamps 4. You need to export events for external analysis Do NOT use this skill when: - You need real-time event processing (use pilot-event-bus instead) - You need short-term replay (use pilot-event-replay instead) - You need filtered logs (use pilot-event-filter first, then log)"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/TeoSlayer/pilot-skills",
      "path": "skills/pilot-event-log/SKILL.md",
      "ref": "f5677946caac6b9f75f30ef652a40dacaa9de617",
      "url": "https://github.com/TeoSlayer/pilot-skills/blob/f5677946caac6b9f75f30ef652a40dacaa9de617/skills/pilot-event-log/SKILL.md",
      "key": "TeoSlayer/pilot-skills/skills/pilot-event-log/SKILL.md"
    },
    "compatibility": "Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start). Requires jq for JSON processing.\n",
    "allowed_tools": [
      "Bash"
    ],
    "license": "AGPL-3.0"
  },
  "instructions": "# Pilot Event Log\n\nPersistent NDJSON logging of Pilot Protocol event streams with rotation and compression.\n\n## Commands\n\n### Subscribe and Log\n```bash\npilotctl --json subscribe <source> <topic> --timeout <seconds> | jq -c '.data.events[]' >> <log-file.ndjson>\n```\n\n### Query by Time\n```bash\njq -c --arg start \"2026-04-08T00:00:00Z\" --arg end \"2026-04-08T23:59:59Z\" \\\n  'select(.timestamp >= $start and .timestamp <= $end)' events.ndjson\n```\n\n### Query by Topic\n```bash\njq -c 'select(.topic | startswith(\"alerts.\"))' events.ndjson\n```\n\n### Rotate Logs\n```bash\n[ \"$(du -m \"$log_file\" | cut -f1)\" -ge \"",
  "cost": {
    "context_tokens": 421
  }
}

Fetch it by URL: GET /api/v1/registry/teoslayer-pilot-skills-pilot-event-log/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.