Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kjirou/log-filter

Filter server logs simply
https://github.com/kjirou/log-filter

Last synced: 14 days ago
JSON representation

Filter server logs simply

Awesome Lists containing this project

README

        

# log-filter [![npm version](https://badge.fury.io/js/log-filter.svg)](http://badge.fury.io/js/log-filter)

## Installation
```bash
npm install -g log-filter
```

## Usage
```bash
log-filter [--contain -c KEYWORD] [--match -m REG_EXP] [--not -n]
```

### --contain, -c
```bash
echo 'warn: It is warning' | log-filter --contain warn
warn: It is warning
echo 'warn: It is warning' | log-filter --contain error # Not displayed
```

### --match, -m
```bash
echo 'warn: It is warning' | log-filter --match '(warn|error)'
warn: It is warning
echo 'warn: It is warning' | log-filter --match '^warning' # Not displayed
```

- Note: `--match` is priority than `--contain`.

### --not, -n
```bash
echo 'warn: It is warning' | log-filter --contain error --not
warn: It is warning
echo 'warn: It is warning' | log-filter --contain warn --not # Not displayed
```

## Examples
```bash
npm run start-your-server | log-filter -n -m 'log pattern that you do not want reading'
```