Back to list
michalkucharczyk

plox

by michalkucharczyk

Extract numeric values from log files and plot them over time. Fully CLI-driven.

4🍴 0📅 Jan 6, 2026

SKILL.md


name: plox description: Plot timestamped logs as graphs. Use when user wants to visualize log data, plot numeric values over time, count events, track time deltas between events, compare multiple log files, or get statistics from logs.

plox - Time Plots from Logs

Turn messy logs into clean graphs. Extract numeric values using regex and plot them over time.

Requirements

  • plox must be available in PATH
  • gnuplot required for PNG output

Commands

graph - Plot data from logs

plox graph --input <LOG_FILE> --plot <GUARD> <FIELD> [OPTIONS]

Basic example:

plox graph --input app.log --plot duration

With regex extraction:

plox graph --input app.log --plot worker "took:([\d\.]+)(\w+)?"

Multiple panels:

plox graph --input app.log \
  --plot module1 value1 \
  --panel \
  --plot module2 value2

stat - Show statistics and histogram

plox stat --input <LOG_FILE> field-value <GUARD> <FIELD>

Shows count, min, max, mean, median, percentiles (q75, q90, q95, q99) and ASCII histogram.

cat - Display extracted values

plox cat --input <LOG_FILE> field-value <GUARD> <FIELD>

Prints raw extracted timestamp-value pairs.

match-preview - Debug regex patterns

plox match-preview --input <LOG_FILE> --verbose <GUARD> <FIELD>

Test regex patterns before plotting. Use -v or -vv for more detail.

Data Sources (Line Types)

OptionDescription
--plot <guard> <field>Plot numeric field values
--event <guard> <pattern> <yvalue>Mark events with fixed Y value
--event-count <guard> <pattern>Cumulative event count over time
--event-delta <guard> <pattern>Time delta between consecutive events
--field-value-sum <guard> <field>Cumulative sum of field values

Line Styling Options

OptionValues
--stylepoints, steps, lines, lines-points
--line-colorred, blue, dark-green, purple, cyan, goldenrod, brown, olive, navy, violet, coral, salmon, steel-blue, dark-magenta, dark-cyan, orange, green, black, magenta, yellow
--line-widthnumeric
--dash-stylesolid, dashed, dotted, dash-dot, long-dash
--marker-typedot, triangle-filled, square-filled, diamond-filled, plus, cross, circle, x, triangle, square, diamond
--marker-colorsame as line-color
--marker-sizenumeric (default: 2)
--yaxisy (primary/left), y2 (secondary/right)
--titleLegend label for this line

Panel Options

OptionDescription
--panelStart a new panel
--panel-title <TITLE>Panel title
--height <RATIO>Height ratio relative to other panels
--yaxis-scalelinear or log
--legendtrue or false
--time-range-modefull (union) or best-fit (overlap)

Input Options

OptionDescription
-i, --input <FILES>Log files (comma-separated)
-r, --timestamp-format <FMT>Timestamp format (default: %Y-%m-%d %H:%M:%S%.3f)
-t, --ignore-invalid-timestampsSkip lines with bad timestamps
--guard <GUARDS>Global filter - only lines containing all guards
-c, --config <FILE>Load TOML config

Output Options

OptionDescription
-o, --output <FILE>Output PNG path (default: graph.png)
-w, --write-config <FILE>Save config to TOML
-x, --do-not-displayDon't open the output file
-p, --plotly-backendGenerate interactive HTML instead of PNG
--inline-output <FILE>Output next to input log file
-a, --display-absolute-pathsShow absolute paths in output

Generated files:

  • PNG graph at specified location
  • .gnuplot script alongside PNG
  • CSV cache in .plox/ directory next to log files

Multi-File Comparison

Binding lines to specific files

# Apply line only to 3rd input file (0-indexed)
--input a.log,b.log,c.log --plot guard duration --file-id 2

# Apply line to a specific file
--plot guard duration --file-name errors.log

Per-file panel duplication

# Duplicate panel layout for each input file
plox graph --input a.log,b.log --per-file-panels \
  --plot worker duration

Creates separate panels for each log file, useful for side-by-side comparison.

Panel alignment

OptionDescription
--panel-alignment-mode shared-fullAll panels share same x-axis range (union)
--panel-alignment-mode per-panelEach panel has its own x-axis range
--panel-alignment-mode shared-overlapShared range based on overlap
--time-range <RANGE>Override with fixed range (for zooming)

Timestamp Formats

FormatExample
%Y-%m-%d %H:%M:%S%.3f2025-04-03 11:32:48.027
%Y-%m-%dT%H:%M:%S%.6fZ2025-06-10T12:08:41.600447Z
[%s][1577834199]
%s1577834199
%b %d %I:%M:%S %pApr 20 08:26:13 AM

Field Regex Patterns

The field can be a simple name or regex with capture groups:

PatternMatchesIn Log Line
duration5sduration=5s
took:([\d\.]+)(\w+)?value + unittook:5ms
txs=\((\d+),\s+\d+\)first numbertxs=(99,124)
txs=\(\d+,\s+(\d+)\)second numbertxs=(99,124)

Unit conversion: Time units (s, ms, us, ns) are auto-converted to milliseconds when captured.

TOML Config Example

[[panels]]
panel_title = "Metrics"
legend = true

[[panels.lines]]
guard = "worker"
field = "duration"
style = "points"
marker_size = 3.0
marker_color = "red"
title = "Worker duration"

[[panels]]

[[panels.lines]]
guard = "module"
field = 'count=(\d+)'
style = "steps"
line_color = "blue"

Environment Variables

VariablePurpose
PLOX_IMAGE_VIEWERImage viewer for PNG output
PLOX_BROWSERBrowser for Plotly HTML output
PLOX_SKIP_GNUPLOTSkip PNG generation, only save gnuplot script

Workflow

  1. Start simple: plox graph --input app.log --plot <keyword>
  2. Debug regex: plox match-preview -v --input app.log <guard> <field>
  3. Check distribution: plox stat --input app.log field-value <guard> <field>
  4. Iterate: Add panels, styling, more lines
  5. Save config: -w config.toml when CLI gets complex
  6. Reuse: plox graph -i new.log -c config.toml
  7. Compare logs: --input a.log,b.log --per-file-panels

Real-World Example

Given log lines like:

2025-04-22 09:31:00.885 INFO maintain txs=(29382, 0) duration=56.206398ms
2025-04-22 09:31:13.081 DEBUG prune: validated_counter=2, took:4.708552ms
# Plot prune duration and validation count
plox graph --input eve.log \
  --plot prune "validated_counter" --style points --marker-size 3 \
  --panel \
  --plot prune "took:([\d\.]+)(\w+)?" --style points --marker-size 3

# Extract watched txs count from maintain lines
plox graph --input eve.log \
  --plot maintain "txs=\((\d+),\s+\d+\)"

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

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

+20
LICENSE

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

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新

+5
フォーク

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

0/5
Issue管理

オープンIssueが50未満

+5
言語

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

+5
タグ

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

+5

Reviews

💬

Reviews coming soon