NAME

jshell - an interactive shell for monitoring JSON log files

VERSION

version 0.03

SYNOPSIS

jshell [--path /path/to/log/file]

DESCRIPTION

Opens a shell to interact with JSON-formatted log files.

OPTIONS

path

Optionally sets the default path to work with.

COMMANDS

help | h

Displays commands and their descriptions.

quit | q

Exits the program.

path | p

Sets or displays the default path.

fields | f

Selects the fields to display from each line's JSON log object. If no fields are selected, all fields will be shown.

> fields timestamp priority message

grep | g

Adds a pattern which must be matched before a log entry is displayed.

> grep field somepattern

Despite the name, patterns are perl regexes and matched against the string value of the field. Embedded modifiers are supported, so a case insensitive search is accomplished thusly:

> grep field (?i)somepattern

grepv | v

Adds a pattern which excludes entries whose field value matches.

> grepv field logswedonotwanttosee

info | i

Displays the current configuration of displayed fields and patterns.

reset | r

Interactively resets fields and patterns.

cat | c

Displays each entry in a file, showing only those fields selected. If no fields are selected, all fields are shown. If no path is specified, the default path will be used if set.

> cat /path/to/json.log

tail | t

Tails a log file, displaying new entries as they are appended to the file. Use control-c to stop output. If no path is specified, the default path will be used if set.

> tail /path/to/json.log

AUTHOR

Jeff Ober <sysread@fastmail.fm>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Jeff Ober.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.