1.0.1 • Published 2 years ago

linecat v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Parse input lines using custom patterns and output more readable and helpful lines.

Install

npm install -g linecat

Usage

  • linecat -p=pattern_path

pattern_path is the custom pattern json file. Example patterns json files are listed in src/example-patterns.

Pattern json file

fieldrequirenote
idnothe id of current pattern, which can be referenced in outputFormat field
linenoregular expression for whole line content
outputFormatnospecific output line format. Available env variables are listed below.

Many env variables are available in outputFormat field:

Env var namenote
idcurrent pattern id
linewhole line
contentwhole line except other tokens
levellog level if available
monthmonth of current line if available
daydate of current line if available
hourshours of current line if available
minutesminute of current line if available
secondsseconds of current line if available
msms of current line if avaiilable
timedifftime diff from current line.
last-[id|line]-{...}last matched line of specific id or any matched line for fields above. eg: last-line-timediff

You can also check example patterns in src/example-patterns to know more usage.

1.0.1

2 years ago

1.0.0

2 years ago