1.2.2 • Published 7 years ago

outwatch v1.2.2

Weekly downloads
8
License
MIT
Repository
-
Last release
7 years ago

Outwatch

A small cli utility to allow you to watch and evaluate the output of a command and run other commands when matches are found in the output.

I created it to use with a single-process docker container so that I could watch the stdout and stderr and take action when a Tomcat web server reports that a specific warfile has been deployed. It might be useful for other jobs as well.

Installation

npm install -g outwatch

You can get access to the line that matched <matchexpr> by using the variable OUTWATCH_LINE in your output.

Usage example

This watches a file, looks for the word 'error' and writes lines with that error to errorReport.txt

outwatch "tail -f /some/file.log" "/error/gi" "touch errorReport.txt; echo \$OUTWATCH_LINE >> errorReport.txt"

Options reference

To see explanation of all CLI options run:

outwatch --help
1.2.2

7 years ago

1.2.1

7 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago