Skip to content

Structure of an event

Fabrice Bacchella edited this page Jul 11, 2023 · 8 revisions

An event is essentially a Map, but with added elements to better fit LogHub usage.

Values

Any map entry can be access in LogHub's DSL using [key]. If the value is a map, keys can be chained, using a very simple syntax: [key1 key2].

Timestamp

Each event store a timestamp, that can be accessed using the syntax [ @timestamp ]. It's a java.util.Date object.

Meta

Each event can be decorated with some meta, that will usually not send to simple Encoder like String or terminal sender like Elastic. High level serializer like Msgpack will send them.

Values can be accessed in the DLS by prefixing the name value with a #: [#key].

Context

Each receiver create a custom context that stores specific information for this receiver like IP address for network-based socket. It's access using [@context]. The context is never serialised in senders.

For example, if the receiver use a TCP socket, [@context localAddress] will return a java.net.InetSocketAddress for the local endpoint of the connexion. The remote part can be accessed through [@context remoteAddress .

Getter can be accessed using standard bean conventions: java.net.InetSocketAddress#getAddress for the remote endpoint will be accessed using [@context remoteAddress address].

When SSL/TLS was used, the whole sessions settings can be access through [@context sslParameters]

If the connexion is authenticated, this context also provides authentication information in a java.security.Principal object. Once again, bean conventions are used: java.security.Principal#getName is read using [@context principal name]

Last exception

Defined when a processor generated an ProcessorException, it will contain the error message, only accessible from exception pipeline of a processor.

Value can be access used the syntax [@lastException].

Clone this wiki locally