跳到正文
Skillpedia
分析与电子表格40k · #7314

optimize-simplicite-logs

它能做什么

这个工具可以整理 Simplicité 日志文件。它会把原始的文本文件转换成更干净、结构化的格式(JSON),去掉不必要的信息,让分析更轻松。

适用场景

  • ✓当你有一个文本格式的大型 Simplicité 日志文件时。
  • ✓避免 AI 需要阅读庞大的原始日志文件。
  • ✓从日志中提取时间、错误级别和消息等重要信息。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/optimize-simplicite-logs/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/optimize-simplicite-logs/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“把这个 Simplicité 日志文件转换成整理好的 JSON,只保留时间戳、级别和消息。”

每周 5 个新技能,1 分钟读完。

工作原理

该工具使用脚本(Python 或 PowerShell)读取日志文本文件,筛选并只选取时间、消息等重要数据,然后将其整理成一个新的 JSON 文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Optimize Simplicite Logs

This skill provides the capability to parse Simplicité logs from a raw .txt file, filter fields to reduce noise, and output the result as structured JSON. This is critical for optimizing AI context size (saving ~56% of tokens) and providing structured, predictable data for troubleshooting.

When to Use This Skill

Use this skill when you need to:

  • Analyze user-provided Simplicité log files in .txt format.
  • Avoid ingesting massive raw log files into your context window.
  • Extract structured fields (like timestamp, level, body) from verbose multi-line log output.

IMPORTANT: Instead of directly reading a raw .txt log file provided by the user using file read tools, you must use one of the log converter scripts (PowerShell or Python) to parse the file into a JSON format first, optionally extracting only the fields needed.

Prerequisites

  • Access to either the PowerShell script (/scripts/SimpliciteLog2Json.ps1) or the Python script (/scripts/simplicite-log2json.py).

Core Capabilities

1. Context Optimization

Reduces the tokens consumed by large Simplicité logs by extracting only relevant log fields (e.g. body, timestamp, level) and discarding non-relevant structural log data (like app, endpoint, contextPath).

2. Multi-line Support

Properly captures stack traces and multiline errors inside the body field of the JSON structure, which a simple text search might miss.

3. Stdout Support

If no output path is provided for the JSON file (e.g. omitting --output or -Output), the parsed JSON will be printed directly to stdout, allowing you to pipe the output to other tools.

Output Summary

After processing, the tool prints a summary to stderr (or console):

Processed: 123 entries, Skipped: 2 entries

Usage Examples

Example 1: Python Version (Recommended)

Convert a log file to JSON, keeping only the most important fields:

python /absolute/path/to/skills/optimize-simplicite-logs/scripts/simplicite-log2json.py <input.txt> --include timestamp,level,body --output <output.json>

Example 2: PowerShell Version

/python /absolute/path/to/skills/optimize-simplicite-logs/scripts/SimpliciteLog2Json.ps1 -InputPath "<input.txt>" -Output "<output.json>" -Include "body,timestamp,level"

After generating the <output.json>, you can safely read the resulting file to perform your analysis.

Guidelines

  1. Always Convert First: Never directly read .txt log files from Simplicité using standard text reading tools. Always convert them to JSON using the available scripts.
  2. Filter Fields: Use --include (Python) or -Include (PowerShell) to restrict fields to what is absolutely necessary to diagnose the issue (usually timestamp,level,body).
  3. Available Fields: The fields you can filter include: timestamp, app, level, endpoint, contextPath, event, user, class, function, rowId, body.

Common Patterns

Pattern: Fast Contextual Troubleshooting

# 1. Run the script to generate a minified JSON output in the current directory
python /absolute/path/to/skills/optimize-simplicite-logs/scripts/simplicite-log2json.py logs.txt --include timestamp,level,body --output logs_minified.json

# 2. Then read logs_minified.json to understand the context.

Limitations

  • The parser depends on a fixed regex pattern that matches the standard Simplicité log output. If the log format has been heavily customized, parsing might fail or degrade.
常见问题

为什么不能直接把原始日志文本文件交给 AI?

原始日志文件可能非常大,而且包含很多对 AI 没用的信息,会占用过多的“空间”(token),也让分析变得困难。

我可以提取哪些重要信息?

你可以提取 “timestamp”(时间)、“level”(错误或信息级别)和 “body”(日志的主要消息)等字段。

如果一条日志跨越多行,会怎么样?

该工具可以把这些多行条目合并成一条 JSON 记录,确保详细的错误信息不会丢失。

详情

作者的原始描述

capability to parse Simplicité logs from a raw `.txt` file, filter fields to reduce noise, and output the result as structured JSON.

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7314
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能