Logstash client for Erlang/OTP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src [skip ci] add hex information Sep 13, 2017
test add file as a backend for store JSON info in a file with rotate based… Sep 13, 2017
.gitignore
.travis.yml
LICENSE
Makefile bugfixes, tests, codecov and travis-ci integration Sep 11, 2017
README.md [skip ci] add hex badge Sep 15, 2017
codecov.yml
covertool
rebar.config
rebar.lock
rebar3 initial commit Sep 11, 2017

README.md

elogstash

Build Status Codecov License: LGPL 2.1 Hex

Logstash library to send information using UDP or TCP avoiding bottlenecks

Build

$ rebar3 compile

To Play

$ rebar3 shell

To Include as Dependency

In your rebar.config (rebar3):

{deps, [
    {elogstash, {git, "https://github.com/manuel-rubio/elogstash", {branch, master}}
]}

In your rebar.config (rebar2):

{deps, [
    {elogstash, ".*", {git, "https://github.com/manuel-rubio/elogstash", {branch, master}}
]}

In your Makefile (erlang.mk):

DEPS = elogstash
dep_elogstash = git https://github.com/manuel-rubio/elogstash.git master

Configuration

The configuration file only has a couple of parameters. They could be added in your code to implement the configuration from other way as well.

Using the configuration file (sys.config or app.config):

{elogstash, [
    {connection, {tcp, {"localhost", 5000}}},
    {max_worker, 10}
]},

The connection could be done using a string for the name (like in the example: "localhost") or using an IP address in the way Erlang implement them (i.e. {127,0,0,1}).

The transports available at this moment are tcp, udp or file.

In case of file you have to configure the basename of the file instead of the host and the kind of rotation you want: hourly, daily or monthly. The file could contains a path and it could be absolute or relative path but I recommend to use absolute path always.

The max_workers is the max number of workers the pool will create. The minimum is the half so, if you configure 10 workers, the start number of connections will be 5. The file backend force to use only 1 max worker.

The configuration could be done in the code configuring elogstash as a dependency but only to load and then:

application:load(elogstash),
application:set_env(elogstash, connection, {{127,0,0,1}, 5000}),
application:set_env(elogstash, max_worker, 10),
elogstash:start(),

Enjoy!