Module logstasher

Behaviours: gen_server.

Data Types

state()

state() = #{transport := module(), host := string() | binary() | tuple(), port := pos_integer(), socket => gen_udp:socket() | gen_tcp:socket() | undefined}

Function Index

handle_call/3
handle_cast/2
init/1
send/1Send an encoded JSON message to logstash.
send_message/2Send a custom message with fields to logstash.
start_link/0
terminate/2

Function Details

handle_call/3

handle_call(X1::{send, binary()}, X2::term(), State::state()) -> {reply, ok | {error, atom() | {timeout, binary()}}, state()}

handle_cast/2

handle_cast(X1::term(), State::state()) -> {noreply, state()}

init/1

init(X1::term()) -> {ok, state()}

send/1

send(Data::binary()) -> ok | {error, atom()}

Send an encoded JSON message to logstash.

send_message/2

send_message(Message::binary(), Fields::map()) -> ok | {error, atom()}

Send a custom message with fields to logstash. The fields must be valid input for the json encoder.

start_link/0

start_link() -> {ok, pid()} | {error, term()}

terminate/2

terminate(X1::term(), X2::state()) -> ok


Generated by EDoc