| Crates.io | rtally |
| lib.rs | rtally |
| version | 0.5.0 |
| created_at | 2025-12-30 13:20:48.606864+00 |
| updated_at | 2025-12-30 13:20:48.606864+00 |
| description | A real-time log stream analyzer and ranking tool similar to top command. |
| homepage | |
| repository | https://github.com/albert-einshutoin/tally |
| max_upload_size | |
| id | 2012643 |
| size | 92,800 |
top command for log streamstally aggregates log lines from stdin in real time and shows a ranked top list.
Unlike sort | uniq -c | sort -nr, you can see “what’s hot right now” as the stream flows.
# Cargo (Rust)
cargo install rtally
# Homebrew / binary releases are planned
Note: crates.io package name may differ from binary name. See Cargo.toml.
tail -f access.log | cut -d ' ' -f 7 | tally
# 7th field (space-separated)
tail -f access.log | tally -f 7
# 3rd field (comma-separated)
tail -f access.log | tally -f 3 -d ','
-f, --field <N>: Aggregate the Nth field after splitting-d, --delimiter <CHAR>: Delimiter character (1 char)-n, --top <N>: Show top N entries (default: 10)--interval <MS>: Refresh interval in ms (clamped to 50–2000)NO_COLOR=1 to disable ANSI color output# Release build
cargo build --release
# Quick check with sample input
time cat samples/bench.log | ./target/release/tally -f 1 -d '=' -n 5 --interval 200 > /dev/null
# 1) Popular paths in access log
tail -f access.log | tally -f 7
# 2) Second column in CSV
tail -f data.csv | tally -f 2 -d ','
# 3) Top 5 with faster refresh
tail -f access.log | tally -f 7 -n 5 --interval 100
Q. The output does not refresh
A. Check if --interval is too large and whether input is actually flowing.
Q. The aggregation looks wrong
A. -f is 1-based. Check delimiter settings and how consecutive delimiters are treated.
Q. I see mojibake
A. Ensure the input is UTF-8; verify your LC_ALL.
# Build
cargo build
# Test
cargo test
# Format
cargo fmt
# Lint
cargo clippy
ROADMAP.md and PRD.md firstCONTRIBUTING.md for development workflow and rulesCONTRIBUTING.mdCODE_OF_CONDUCT.mdSECURITY.mdCHANGELOG.mdRELEASE.mdLICENSELICENSE)SECURITY.md for reportingtop command for log streams (日本語)tally は標準入力のログをリアルタイムで集計し、頻出項目をランキング表示するCLIツールです。
sort | uniq -c | sort -nr のように全件読み込み完了を待たず、実行直後から「今多いもの」を見られます。
# Cargo (Rust)
cargo install rtally
# 将来的に Homebrew / バイナリ配布を予定
※ crates.ioのパッケージ名はバイナリ名と異なる場合があります(Cargo.toml を参照)。
tail -f access.log | cut -d ' ' -f 7 | tally
# 空白区切りの7番目を集計
tail -f access.log | tally -f 7
# カンマ区切りの3番目を集計
tail -f access.log | tally -f 3 -d ','
-f, --field <N>: 区切り文字で分割したN番目の要素を集計-d, --delimiter <CHAR>: 区切り文字を指定(1文字)-n, --top <N>: 上位N件のみ表示(デフォルト: 10)--interval <MS>: 描画更新間隔(ミリ秒、50〜2000に丸め)NO_COLOR=1 を設定するとANSIカラーを無効化できる# リリースビルド
cargo build --release
# サンプル入力での簡易計測
time cat samples/bench.log | ./target/release/tally -f 1 -d '=' -n 5 --interval 200 > /dev/null
# 1) アクセスログの人気パス
tail -f access.log | tally -f 7
# 2) CSVの2列目を集計
tail -f data.csv | tally -f 2 -d ','
# 3) 上位5件だけ表示、更新間隔を短く
tail -f access.log | tally -f 7 -n 5 --interval 100
Q. 出力が更新されません
A. --interval が大きすぎないか確認してください。入力が流れているかも確認してください。
Q. 集計結果が期待と違います
A. -f は1始まりです。区切りが空白か -d 指定か、連続区切り時の空フィールド扱いを確認してください。
Q. 文字化けします
A. UTF-8以外の入力が混在していないか、LC_ALL の設定を確認してください。
# ビルド
cargo build
# テスト
cargo test
# フォーマット
cargo fmt
# リント
cargo clippy
ROADMAP.md と PRD.md を確認してくださいCONTRIBUTING.md を参照してくださいCONTRIBUTING.mdCODE_OF_CONDUCT.mdSECURITY.mdCHANGELOG.mdRELEASE.mdLICENSELICENSE)SECURITY.md を参照してください