LogWisp
About
LogWisp started as a way to stop SSH-ing into servers to tail and grep log
files (the story). It is now one static binary, lw, that
runs anything from a shell filter to a multi-node aggregation topology, and
composes its own configuration on a terminal or on this page.
- Pipelines
- Each pipeline is independent: sources feed a flow that rate-limits, filters and formats, and the flow fans out to any number of sinks.
- Never blocks
- A full queue drops and counts its own entries rather than stalling the stages around it, so a slow reader costs only itself.
- Chaining
- Links carry the structured entry, not formatted text, so a relay can filter and reformat as if the entries were local, and every entry keeps the node it came from.
- Security
- TLS 1.2/1.3 everywhere, mutual TLS with identity-based authorization, and
Argon2id-SCRAM passwords.
lw tlsmakes the certificates, or a listener makes its own at startup. A listener can also hold a single SCRAM user with no credentials file, its password read from a file, a descriptor or the terminal, where Enter alone draws a 130-bit one. Unknown configuration keys are refused. - Access
- Every listener can refuse addresses by allow and deny lists before the TLS handshake, cap each client's connections (and over HTTP its request rate), and read the client's address from a load balancer's PROXY header.
- Viewer
- A browser at an HTTP sink gets a live page that follows the stream, with a search and a level filter; a sink that keeps a backlog shows the latest entries first. Behind a site's TLS proxy it signs in with SCRAM.
- Presets
pipe,tail,serve,edgeandaggregatorbuild the common pipelines from a few keys, andlw preset serveprints the file one expands to. An aggregator and an edge given the sameusermake a temporary authenticated pipe between two hosts, with nothing written to disk.- Compose
lw --tuicomposes pipelines on a terminal, and the Configure tab does it in the browser: both run LogWisp's own engine, here compiled to WebAssembly, and write the same file, command line or environment. On the terminal they also run in place: a live view shows every entry, parsed from JSON, logfmt, journald and the common loggers' lines, with the stage or filter that dropped it, one key from editing that stage.lw --checknames every problem of each part, a line each, by its key's path.- Reload
- Edit the TOML and the service rebuilds itself. A candidate that fails validation leaves the running pipelines untouched.
- Filter
- With no file and no options,
lwis a Unix filter: stdin to stdout, line for line.
Pipeline
Every plugin LogWisp ships, in one pipeline, drawn from the schema its engine writes. A configuration picks any number of sources and sinks; the flow stages are each optional and run in this order.
Sources
consoleReads stdin; the source when none is givenfileTails every matching file in a directory, through rotationrandomGenerated entries, to check a deployment before real logsnullHolds a source's place until one is chosentcp_chainlistens Entries from another node over one persistent streamhttp_chainlistens Entries from another node in batches over POST
Flow
rate_limitToken bucket, and a cap on entry sizefiltersInclude and exclude RE2 patterns, in orderformatraw, txt or json, with a sanitizer policyheartbeatA keep-alive entry on a timer
Sinks
consolestdout or stderr, levels in colourfileRotating files with size caps and retentionnullDiscards; holds a sink's place until one is chosentcplistens Formatted lines broadcast to every clienthttplistens Server-Sent Events and status; a browser viewer with searchtcp_chaindials To the next node; holds entries across reconnectshttp_chaindials To the next node in batches, with retry
- Entries
- A source turns each line into a structured entry: time, level, message, optional JSON fields, and the node it came from. The formatter renders it for the sinks, which also receive the entry itself.
- Drops
- Every queue is bounded. A full one drops the entry for that stage, sink or client alone and counts it. The console sink waits instead, so a filter loses no line to a slow reader; the TCP chain sink holds a line across reconnects, so an outage downstream surfaces as counted drops upstream, not silent loss.
- Topologies
- An edge node tails local files and dials an aggregator; the aggregator listens for its edges and serves one stream, or writes one archive. Two presets build them, below: the aggregator makes its certificate at startup and logs the key edges pin, and each edge logs in with its own SCRAM user.
# on the aggregator: a user for each edge, its generated password in a file
lw auth add-user --credentials /etc/logwisp/users.toml -u edge-01 \
--password-file /etc/logwisp/edge-01.pass
# the aggregator: edges' entries into files under /var/log/edges/
lw -p aggregator:users=/etc/logwisp/users.toml,out=/var/log/edges/
# each edge, given its password file: a directory's files, to the
# aggregator whose logged key it pins
lw -p edge:path=/var/log/app/,to=agg.example.org:9000,pin=sha256//BASE64,\
user=edge-01,password_file=/etc/logwisp/edge-01.pass
Configure
Compose pipelines here and take them away as a configuration file, a command
line or environment variables. Start from a preset, an empty pipeline or a
configuration you paste, or, where the Describe box is offered, from a sentence;
then choose a part of the pipeline to set its options. Every list, default and
rule comes from LogWisp’s own engine running in your browser, and nothing you
enter is sent anywhere but a description you send for a draft. On the host,
lw --check -c logwisp.toml remains the authority for files, certificates and
credentials.
The configurator needs JavaScript and WebAssembly. Without them, LogWisp's annotated configuration lists every option, and lw --tui composes pipelines on a terminal.
Live
The ViF multiplayer lobby streams every game server’s log through one LogWisp pipeline, running on the node beside the cluster rather than in it. Open its Log tab and start a game to watch it fill.
From
Sources
fileTails every game's file in that volume as it is written
Flow
rate_limit400 records a second, bursts of 800, the rest droppedfiltersLeaves out TRACE records and the admission records that name a player's addressformatraw: each JSON line as written
Sinks
httplistens One Server-Sent Events stream, on the node's loopback only
To
Install
Runtime
- Platforms: Linux and FreeBSD on amd64, natively or in a container
- Toolchain: Go 1.27.3, no CGO, one static binary
- Libraries: Terminal, Color, TOML, Config, Log and Auth
- Configuration: a TOML file, or the same keys as flags and environment variables
- Presets:
pipe,tail,serve,edgeandaggregator - License: BSD-3-Clause
Install
- Build
git clone https://github.com/lixenwraith/logwisp --depth 1, thencd logwisp && make releasefor a static, strippedbin/lw- Service
sudo make installaddslw, its manual and completion, a systemd unit or rc.d script, and the annotatedlogwisp.tomlto edit;make debandmake archpackage the same- One user
- Without root,
make release installputslw, its manual and completion under~/.local, with no service; thenlw config initwrites the filelwreads - Container
make imagebuilds ascratchimage that runs read-only with no capabilities- Fleet
deploy/lw-deploy.shsets up an edge, an aggregator or a standalone node, as a container or a systemd or rc.d service
Quick start
# a filter: errors and warnings only
tail -F app.log | lw --filter include:patterns=ERROR,patterns=WARN
# stdin as a live SSE stream, with a browser viewer at http://127.0.0.1:8080/
journalctl -f | lw --sink http:host=127.0.0.1,port=8080
# a directory's logs, served to one subnet
lw -p serve:path=/var/log/app/,listen=0.0.0.0:8080,allow=192.0.2.0/24
# any command line as a configuration file
lw -p serve:path=/var/log/app/ --dump > logwisp.toml
# compose pipelines on screen, then run, tap or print them
lw -T
# tap a stream: each line parsed, and what the flow did with it
journalctl -f -o json | lw -T -p pipe
# a temporary pipe, nothing on disk: Enter at the receiver's prompt draws
# the password, which the sender's prompt takes
lw -p aggregator:listen=0.0.0.0:9000,user=pipe,format=raw,allow=192.0.2.10/32
cmd | lw -p edge:to=192.0.2.20:9000,pin=sha256//BASE64,user=pipe