# logstreamtool

> Tool for dealing with logs as a stream of events for analysis

Latest version **1.1.1** (published 2016-01-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install logstreamtool
pnpm add logstreamtool
yarn add logstreamtool
bun add logstreamtool
```

Provides the command `logstreamtool`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-01-09 |
| First published | 2016-01-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Aria Stewart |
| Maintainers | aredridel |
| Keywords | timestream, histogram, log, analysis |

## Links

- npm: https://www.npmjs.com/package/logstreamtool
- Repository: https://github.com/aredridel/logstreamtool
- Homepage: https://github.com/aredridel/logstreamtool#readme
- Issues: https://github.com/aredridel/logstreamtool/issues
- npm.io page: https://npm.io/package/logstreamtool

## Dependencies (5)

- [split](https://npm.io/package/split.md) ^1.0.0
- [yargs](https://npm.io/package/yargs.md) ^3.31.0
- [through2](https://npm.io/package/through2.md) ^2.0.0
- [timestream](https://npm.io/package/timestream.md) ^0.1.1
- [stream-combiner](https://npm.io/package/stream-combiner.md) ^0.2.2

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2016-01-09
- 1.1.0 — 2016-01-09
- 1.0.0 — 2016-01-08

## README

logstreamtool
=============

Process (json stream) logs in a streaming fashion, doing analyses like summing
numbers of events.

Use
-----

```shell
logstreamtool [--bole] [--sum hour] < logfile
```

### Flags

* `--bole` Process timestamps in the `time` field and parse them as ISO8601 dates.
* `--sum period` Sum the values of each field in the period.
* `--mean period` Take the mean of the values in each period.
* `--mode period` Take the mode of the values in each period.
* `--median period` Take the median of the values in each period.
* `--variance period` Take the variance of the values in each period.
* `--stdev period` Take the standard deviation of the values in each period.
* `--min period` Take the minimum value in each period.
* `--max period` Take the maximum value in each period.
* `--count period` Count the occurances of each key in the period.
* `--first period` Take the first value in each period.
* `--last period` Take the last value in each period.
* `--sample period` Take a random value from each period.

### Periods

Any period accepted by [`floordate`](https://npmjs.com/packages/floordate) should work.

* s, sec, secs, second, seconds
* m, min, mins, minute, minutes
* h, hr, hrs, hour, hours
* d, day, days
* w, wk, wks, week, weeks
* M, mon, mons, month, months
* q, qtr, qtrs, quarter, quarters
* y, yr, yrs, year, years

Examples
--------

```shell
logstreamtool --bole --sum minute < logfile
```

Read a log file written by [`bole`](https://npmjs.com/packages/bole), and sum
the values of each field over each minute.

---
_Source: https://npm.io/package/logstreamtool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
