360 Secure SkillHub
360 安全技能中心

Session Log Analyzer

该 Skill 解析 JSONL 格式的 agent 会话日志,统计会话总数、技能调用成功与失败次数、耗时合计、按技能使用分布及近期错误,生成 PDF 分析报告并保存到 pdfs/session_analysis_report.pdf;配置 Notion 令牌与数据库 ID 后,可把报告文本前 2000 字符同步到 Notion 数据库。

terrycarter1985
terrycarter1985
热度 49.73
最近更新 2026-05-12 08:18:14
分类:数据依赖:代码执行 / 读写文件 / 第三方 API应用场景:数据处理 / 报告撰写 / 自动化脚本

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add session-log-analyzer
Metadata
name
session-log-analyzer
description
Analyze agent session logs and generate PDF reports with Notion sync
version
1.2.0
author
ClawdBot
tags
["logs","analysis","pdf","notion"]
requires_bins
["python3"]
requires_env
["NOTION_API_KEY","NOTION_REPORTS_DB_ID"]
requires_config
[]
changelog
[{"version":"1.2.0","date":"2026-05-07T00:00:00.000Z","changes":"修复日志分析报告生成和Notion同步问题"},{"version":"1.1.0","date":"2026-05-07T00:00:00.000Z","changes":"修复日志分析报告生成和Notion同步问题"},{"version":"1.0.0","date":"2026-04-01T00:00:00.000Z","changes":"Initial release"}]

Session Log Analyzer

Analyze agent session logs and generate PDF reports with optional Notion sync.

Features

  • Parse JSONL session logs and compute statistics
  • Generate PDF analysis reports with skill usage breakdown and error summaries
  • Sync generated reports to a Notion database

Usage

Generate Report

PYTHONPATH=./lib python3 scripts/analyze_logs.py

Sync to Notion

Set environment variables first:

export NOTION_API_KEY="your-integration-token"
export NOTION_REPORTS_DB_ID="your-database-id"
PYTHONPATH=./lib python3 scripts/sync_to_notion.py

Report Contents

  • Total sessions count
  • Skill invocation statistics (success/failure rates)
  • Duration totals
  • Per-skill usage breakdown
  • Recent errors listing

Configuration

Variable Required Description
NOTION_API_KEY For sync Notion integration token
NOTION_REPORTS_DB_ID For sync Target Notion database ID

Notes

  • Input logs must be in JSONL format with event, session_id, skill_used, success, and duration fields
  • PDF output is saved to pdfs/session_analysis_report.pdf
  • Notion sync uploads the first 2000 characters of extracted report text