https://github.com/chatopera/node-logstash-send
Fast send to Logstash
https://github.com/chatopera/node-logstash-send
apm elasticsearch kibana logstash monitoring nodejs
Last synced: about 2 months ago
JSON representation
Fast send to Logstash
- Host: GitHub
- URL: https://github.com/chatopera/node-logstash-send
- Owner: chatopera
- License: mit
- Created: 2019-01-20T11:59:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-22T03:43:40.000Z (over 4 years ago)
- Last Synced: 2025-03-04T17:43:39.762Z (2 months ago)
- Topics: apm, elasticsearch, kibana, logstash, monitoring, nodejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-logstash-send
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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

## ELK
Setup ELK Services with
```
https://github.com/samurais/docker-elk
```## 开源许可协议
Copyright (2019) 北京华夏春松科技有限公司
[MIT](./LICENSE)