# node-logstash-send

> Fast send to logstash.

Latest version **1.1.1** (published 2020-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-logstash-send
pnpm add node-logstash-send
yarn add node-logstash-send
bun add node-logstash-send
```

## 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 | 2020-09-14 |
| First published | 2019-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Hai Liang Wang |
| Maintainers | hain |
| Keywords | logstash |

## Links

- npm: https://www.npmjs.com/package/node-logstash-send
- Repository: https://github.com/Samurais/node-logstash-send
- Homepage: https://github.com/Samurais/node-logstash-send#readme
- Issues: https://github.com/Samurais/node-logstash-send/issues
- npm.io page: https://npm.io/package/node-logstash-send

## 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) — 2020-09-14
- 1.1.0 — 2020-04-09
- 1.0.0 — 2019-01-20

## README

# node-logstash-send

Fast send to logstash, ignore error, bypass waiting.

[![chatoper banner][co-banner-image]][co-url]

[co-banner-image]: https://user-images.githubusercontent.com/3538629/42383104-da925942-8168-11e8-8195-868d5fcec170.png
[co-url]: https://www.chatopera.com

## Install

```
npm install -s node-logstash-send
```

## Configuration

- Logstash

Example of _logstash/pipeline/logstash.conf_.

```
input {
        tcp {
                port => 5000
        }
        http {
                host => "0.0.0.0"
                port => "4999"
        }
}

## Add your filters / logstash plugins configuration here
filter {
  if ! [lg_pattern_prefix] {
        mutate { add_field => { "[@metadata][lg_pattern_prefix]" => "logstash" } }
  } else {
        mutate { add_field => { "[@metadata][lg_pattern_prefix]" => "%{[lg_pattern_prefix]}" } }
  }
}

output {
        elasticsearch {
                hosts => "elasticsearch:9200"
                index => "%{[@metadata][lg_pattern_prefix]}-%{+YYYY.MM.dd}"
        }
}
```

[Advanced configuration Docs.](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)

- Set Environment variables.

```
export LOGSTASH_IP=xx
export LOGSTASH_PORT=1111
export LOGSTASH_QUIET=false
```

## Usage

Send your interests.

```
process.env["LOGSTASH_IP"] = "venus";
process.env["LOGSTASH_PORT"] = 49991
var logstash = require('node-logstash-send')
logstash({
    lg_pattern_prefix: "logstash",
    hello: "bar"
    })
```

| key | description |
| lg_pattern_prefix | used as index pattern prefix, the patten would be `$lg_pattern_prefix.yyyy.MM.dd` |

Note, **it would ignore the error if send failed, to see errors, set** `LOGSTASH_QUIET` **as** `true` **.**

### what you get in Kibana

![image](https://user-images.githubusercontent.com/3538629/51439851-fe939f80-1cfa-11e9-8b52-73b2fc2dceb9.png)

## ELK

Setup ELK Services with

```
https://github.com/samurais/docker-elk
```

## 开源许可协议

Copyright (2019) 北京华夏春松科技有限公司

[MIT](./LICENSE)

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