Jarroba Tools · Logs

v0.3.2
io.github.Invarato/jarroba-tools-logs Checked 4 hours ago Published 7 days ago

Lets your AI read a CI log far too big for its context.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

log_analyze

Understand a log without reading it: detected format, number of EVENTS (a 40-line stack trace counts as one), breakdown by level, time range, the errors with their ROOT CAUSE resolved, and the most frequent patterns. Accepts a file PATH — that is how you look at a log that does not fit in your context, such as a CI log of hundreds of MB. Logs WRAPPED by whatever collected them (Docker json-file, CRI/Kubernetes `P`/`F` lines, `journalctl -o json`, OpenTelemetry OTLP JSON, AWS CloudTrail) are unwrapped first and the pieces the runtime split are joined back, so a stack trace spread over 40 reco…

ParameterTypeDescription
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
textstringThe log as text. Alternative to `path`.

log_reduce

Cut a log down to a CHARACTER budget while keeping what matters: errors with their full stack trace, the window of what happened just before, and anything that appears only once or twice. Repeats are collapsed with their count ([xN]) and gaps are marked ([...N]). Use it to hand a big log to a model without spending the context on the same line repeated.

ParameterTypeDescription
contextintegerEvents kept before each error
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
fullTracesbooleanfalse collapses each stack trace to its one-line summary
maxCharsintegerCharacter budget for the output
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
textstringThe log as text. Alternative to `path`.

log_patterns

Group log lines into TEMPLATES (Drain algorithm): "connected to 10.0.0.1" and "connected to 10.0.0.7" are the same message. Turns a million lines into a few hundred readable things, each with its count, worst level and time range. Also returns the RARE ones (seen once or twice), which in a production log are usually what you were looking for.

ParameterTypeDescription
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
limitintegerHow many patterns to return
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
textstringThe log as text. Alternative to `path`.

log_stacktrace

Read an exception stack trace (Java/JVM, Python, Node, Go, .NET, Rust, Ruby or PHP) and answer the only question anyone asks it: WHERE TO LOOK. Follows the "Caused by" chain to the root cause, separates your code from the framework, and points at your first frame. Infers which package is yours from the trace itself if you do not say.

ParameterTypeDescription
trace *stringThe stack trace, pasted as-is
myPrefixesarrayPrefixes of your own code, e.g. ["com.acme.", "src/"]

log_lint

Check whether the log is WELL WRITTEN — not what happened in the system: secrets or personal data printed, one line flooding the file, timestamps with no time zone (which make two machines impossible to correlate), the clock going backwards, everything at the same level, no request id, payload dumps, and orphan stack traces with no error line. Every finding comes with its count and a sample; secrets are masked.

ParameterTypeDescription
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
textstringThe log as text. Alternative to `path`.

log_convert

Convert a log from one format to another through OpenTelemetry's Logs Data Model: JSON, logfmt, syslog RFC 5424, CSV, OpenTelemetry or Elastic Common Schema. Tells you UP FRONT what the conversion loses — syslog only has eight severities and a text body, so coming down to it from JSON drops fields.

ParameterTypeDescription
target *stringOutput format
columnsarrayCSV only: which fields become columns
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
hoststring
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
servicestring
textstringThe log as text. Alternative to `path`.

log_around

What ELSE happened around a moment in time. Given an instant — the spike log_trends returned, or the time of an alert — find the patterns that cluster there and do not appear the same way in the rest of the log. Correlation is NOT causation, and what settles it is order: what started BEFORE comes first and is a candidate explanation; what came after is usually a consequence. Background noise is filtered out even when a narrow window lands on one of its bursts.

ParameterTypeDescription
at *stringReference instant, in ISO 8601 (e.g. "2026-08-27T10:40:00Z")
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
limitinteger
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
radiusSecondsintegerHow far to look on each side
textstringThe log as text. Alternative to `path`.

log_distinguish

What sets a group of events APART from the rest of the log: the field=value pairs over-represented in the selection. E.g. of 300 errors, 92% have `version=2.4.1` against 4% of everything else — the deploy that broke it, found without reading 300 errors. Select by minimum level (default: errors), by text, or by one field=value; that selector is left out of the answer, since it would trivially top it. Fields that are unique per event (request ids, trace ids) are skipped: they identify, they do not distinguish. A difference in proportions, not causation.

ParameterTypeDescription
containsstringSelect events whose raw text contains this (case-insensitive)
fieldstringSelect events with this field…
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
limitinteger
minLevelstringSelect events at this level or above (default "error" if nothing else is given)
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
textstringThe log as text. Alternative to `path`.
valuestring…equal to this value

log_rotation

Put a folder or a list of rotated logs into TIME ORDER, split into series. Rotation numbering runs BACKWARDS against time: `app.log.3.gz` is older than `app.log.1.gz`, and plain `app.log` is the newest; alphabetically `app.log.10` sorts before `app.log.9` while in time it comes after. Use this BEFORE reading several logs of one service, or you will read them backwards. Returns the paths already ordered, ready to feed to log_analyze one by one.

ParameterTypeDescription
directorystringFolder to look in (does not recurse). Alternative to `names`.
namesarrayList of file names or paths, in any order

log_profile_check

Validate a Jarroba Tools LOG PROFILE (the `logprofile: 1` JSON that configures the log tools: format, server time zone, own-code prefixes, rules and AI budget). Returns ALL errors at once, each with the exact field (`rules[2].pattern`) and what was expected, so you can fix them in one pass instead of one at a time. Format documented in `public/logprofile.md`.

ParameterTypeDescription
profile *stringThe profile as JSON

log_profile_suggest

Propose a LOG PROFILE from a real log: infers the format, the own-code prefix (read from the stack traces, which is where it is demonstrated) and a starting set of rules covering the most frequent errors and whatever floods the file. What it does NOT propose is the server time zone: that is not in the log, and inventing it shifts the entire timeline without anyone noticing. Accepts a file path.

ParameterTypeDescription
formatstringForce the format instead of detecting it
fromstringWhich end to read if the file is over 32 MB
namestringName for the profile
pathstringPath to the log file. Use this for big logs: they do not fit in a tool call.
textstringThe log as text. Alternative to `path`.