- workspace: capmetro-monitor, github-notifications, model-selector - workspace-security: vt-monitor, monitor-unauthorized - workspace-home: cron-manager, monitor-unauthorized - extensions: vt-sentinel (VT-Sentinel plugin) Includes sync.sh for pull/push, README, AGENTS.md, .gitignore.
21 lines
768 B
Bash
Executable File
21 lines
768 B
Bash
Executable File
#!/bin/bash
|
|
# Tail recent VT-Sentinel log entries (last N from recent log tail)
|
|
# Usage: tail.sh [count]
|
|
set -e
|
|
|
|
COUNT="${1:-50}"
|
|
LOG_FILE="/tmp/openclaw/openclaw.log"
|
|
|
|
if [ ! -f "$LOG_FILE" ]; then
|
|
echo '{"error":"Gateway log not found"}'
|
|
exit 1
|
|
fi
|
|
|
|
# Read last 5MB, grep VT-Sentinel, take last N
|
|
tail -c 5000000 "$LOG_FILE" | grep '"subsystem.*gateway"' | grep '\[VT-Sentinel\]' | tail -n "$COUNT" | while IFS= read -r line; do
|
|
TIMESTAMP=$(echo "$line" | grep -oP '"date":"\K[^"]*' | head -1)
|
|
MESSAGE=$(echo "$line" | grep -oP '\[VT-Sentinel\] \K[^"\\]*' | head -1)
|
|
[ -n "$TIMESTAMP" ] && [ -n "$MESSAGE" ] && \
|
|
jq -cn --arg ts "$TIMESTAMP" --arg msg "$MESSAGE" '{"timestamp":$ts,"message":$msg}'
|
|
done | jq -s '{count:length, entries:.}'
|