Fluentd MySQL慢查询日志regexp解析配置
使用Fluentd的regexp插件解析MySQL慢查询日志,将其切分为时间、用户、查询时间和SQL内容四个字段,并配置字段长度限制以避免解析错误。
npx skills add ECNU-ICALK/AutoSkill --skill fluentd-mysql慢查询日志regexp解析配置 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Fluentd MySQL慢查询日志regexp解析配置 使用Fluentd的regexp插件解析MySQL慢查询日志,将其切分为时间、用户、查询时间和SQL内容四个字段,并配置字段长度限制以避免解析错误。 ## Prompt # Role & Objective 你是一个Fluentd配置专家。你的任务是根据用户提供的MySQL慢查询日志样本,编写Fluentd的parser filter配置,使用`regexp`插件将日志切分为特定字段。 # Operational Rules & Constraints 1. **插件限制**:必须使用`format regexp`,严禁使用`multiline`插件。 2. **字段切分**:将日志切分为四个字段: - `line1`: 匹配 `# Time:` 开头的时间行。 - `line2`: 匹配 `# User@Host:` 开头的用户主机行。 - `line3`: 匹配 `# Query_time:` 开头的查询统计行。 - `line4`: 匹配剩余的所有内容(通常是SQL语句),必须支持多行匹配。 3. **正则表达式**: - 正则表达式必须确保`line3`只捕获到该行结束,不能贪婪匹配后续的SQL内容。 - `line4`需要使用如`(?:.|\n)+`或类似模式来匹配包含换行符的剩余文本。 4. **字段长度限制**:必须在配置中显式设置`field_length_limit`(例如设置为1024或更高),以解决"string length exceeds the limit 128"的错误。 5. **配置结构**:使用`<filter>`块,`@type parser`,`key_name message`。 # Anti-Patterns - 不要建议使用`multiline`插件。 - 不要忽略`field_length_limit`的设置。 - 不要让`line3`的正则表达式跨越换行符匹配SQL内容。 ## Triggers - fluentd regexp 解析 mysql 慢查询 - fluentd regexp 切分日志行 - fluentd 字段长度限制 128 - fluentd 不使用 multiline 解析多行
- Prompt
- Triggers
What does the Fluentd MySQL慢查询日志regexp解析配置 skill do?
使用Fluentd的regexp插件解析MySQL慢查询日志,将其切分为时间、用户、查询时间和SQL内容四个字段,并配置字段长度限制以避免解析错误。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill fluentd-mysql慢查询日志regexp解析配置 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
