360 Secure SkillHub
360 安全技能中心

Pilot Event Filter

核心功能:基于jq的模式匹配,实现Pilot协议事件流的内容过滤、payload转换及条件路由。典型场景:需按事件内容过滤(非仅主题通配符)、转换事件数据后重发、降噪选择性转发、基于内容路由事件。通过Bash命令行调用pilotctl与jq,输入为Pilot事件流,输出为处理后的事件或重发至指定主题。依赖pilot-protocol技能、pilotctl、jq及运行的pilot守护进程。

teoslayer
teoslayer
热度 45.60
最近更新 2026-05-11 17:41:28
分类:自动化依赖:代码执行 / 第三方 API应用场景:自动化脚本 / 数据处理 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pilot-event-filter
Metadata
name
pilot-event-filter
description
Filter and transform events before delivery using pattern matching and jq transforms. Use this skill when: 1. You need to filter events by content, not just topic wildcards 2. You need to transform event payloads before processing 3. You need to route events conditionally based on content 4. You need to reduce event noise by selective forwarding Do NOT use this skill when: - Topic wildcards alone are sufficient (use pilot-event-bus instead) - You need all events without filtering (subscribe directly) - You need persistent storage (use pilot-event-log instead)
tags
["pilot-protocol","pub-sub","filtering","transformation"]
license
AGPL-3.0
compatibility
Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start). Requires jq for JSON filtering and transformation.
metadata
{"author":"vulture-labs","version":"1.0","openclaw":{"requires":{"bins":["pilotctl","jq"]},"homepage":"https://pilotprotocol.network"}}
allowed-tools
["Bash"]

Pilot Event Filter

Filter and transform Pilot Protocol event streams using jq-based pattern matching.

Commands

Subscribe with filtering

pilotctl --json subscribe <source-hostname> <topic> --timeout 60 | \
  jq -c '.data.events[] | select(<filter-expression>)'

Transform and republish

pilotctl --json subscribe <source> <topic> --timeout 60 | \
  jq -c '.data.events[] | <transform-expression>' | \
  while IFS= read -r event; do
    pilotctl --json publish <destination> "<new-topic>" --data "$event"
  done

Workflow Example

Filter critical alerts and forward to on-call agent:

#!/bin/bash
SOURCE_AGENT="monitoring-hub"
ONCALL_AGENT="oncall-agent"

pilotctl --json subscribe "$SOURCE_AGENT" "alerts.*" --timeout 600 | \
  jq -c '.data.events[]' | \
  while IFS= read -r event; do
    severity=$(echo "$event" | jq -r '.data | fromjson | .severity // "unknown"')

    if [ "$severity" = "critical" ]; then
      pilotctl --json publish "$ONCALL_AGENT" "oncall.critical" --data "$event"
    fi
  done

Dependencies

Requires pilot-protocol skill, jq, and a running daemon.