elogstash

Logstash library to send information using UDP or TCP avoiding bottlenecks


Keywords
erlang, logstash
License
Other

Documentation

elogstash

Build Status Codecov License: LGPL 2.1

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, {"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 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 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!