Skip to content

look at bunyan-formatted logs in a slightly less eye-watering way

Notifications You must be signed in to change notification settings

oxidecomputer/looker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

looker

A lens for removing glare and reducing eye strain while looking at Bunyan logs.

Usage

See looker --help for usage options.

Filtering with RHAI

The -c option accepts an RHAI script that returns a Boolean value indicating whether a record should be displayed. Each record is supplied to the script in a variable named r.

The following Bunyan fields are guaranteed to exist for all records: level, name, hostname, pid, time, and msg. Other fields, including component, are optional and must be followed by the ? operator for RHAI to compile a script referring to them. Records that don't have a field referred to in the script will be elided.

Examples

  • looker -c 'r.msg.contains("Failed")' - include all lines with a msg that contains Failed
  • looker -c 'r.response_code?.parse_int() >= 500' - include all lines with a response_code field in the 5XX level

About

look at bunyan-formatted logs in a slightly less eye-watering way

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages