スキル一覧に戻る
dloss

log-analysis

by dloss

CLI log processor with embedded Rhai scripting and built-in functions for parsing, transforming, and analyzing logs

4🍴 2📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: log-analysis description: Analyze, filter, transform, and convert log files using Kelora. Use for parsing logs, extracting patterns, investigating incidents, calculating metrics, or converting formats. metadata: version: "1.0"

Log Analysis with Kelora

Kelora is a streaming log processor with Rhai scripting. It auto-detects formats and provides 150+ built-in functions.

Getting Help

Run these for detailed reference (prefer over asking the user):

  • kelora --help-examples - Common patterns
  • kelora --help-functions - All 150+ functions
  • kelora --help - Full CLI reference
  • kelora --help-rhai - Scripting guide

Core Patterns

Filter logs:

kelora -l ERROR,WARN app.log                          # By level
kelora --filter 'e.status >= 500' api.log             # By expression
kelora --since "1 hour ago" app.log                   # By time

Transform:

kelora -e 'e.duration_sec = e.duration_ms / 1000' api.log
kelora -e 'e.absorb_json("data")' events.log          # Parse embedded JSON

Convert formats:

kelora -f combined -J access.log > access.jsonl       # Apache to JSON
kelora -j -F logfmt events.jsonl                      # JSON to logfmt
kelora -f syslog -F csv syslog.log                    # Syslog to CSV

Metrics:

kelora -s app.log                                     # Summary stats
kelora -q --metrics -e 'track_count("by:" + e.level)' app.log

Pattern discovery:

kelora --drain app.log                                # Find message templates

Context around matches:

kelora -C 5 --filter 'e.level == "ERROR"' app.log     # 5 lines before/after

Field Access

e.level              // Direct
e["@timestamp"]      // Special chars
e.get_path("a.b.c")  // Safe nested (returns () if missing)
e.has("field")       // Check exists

Key Options

OptionPurpose
-f <fmt>Input format (auto/json/logfmt/syslog/combined/csv/regex:...)
-F <fmt>Output format (json/logfmt/csv)
-j / -JShorthand for -f json / -F json
--filterBoolean expression filter
-eRhai script per event
-l / -LInclude/exclude log levels
-k / -KInclude/exclude fields
-nLimit output events
--headLimit input lines (faster)
-qSuppress events (metrics only)
-s / -mShow stats/metrics
--drainDiscover message patterns
-C / -B / -AContext lines around matches

Tips

  1. Use -f auto (default) - Kelora detects JSON, logfmt, syslog, combined, CSV
  2. Preview with -n 10 or --head 100 before processing large files
  3. Use -q with --metrics when you only need aggregates
  4. Run kelora --help-functions to find the right function for your task

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です