hslogstash-0.4.2: A library to work with, or as, a logstash server

Safe HaskellNone
LanguageHaskell2010

Logstash.Message

Description

Datatypes, helper functions, and JSON instances for Logstash messages.

Synopsis

Documentation

data LogstashMessage Source

The Logstash message, as described in https://github.com/logstash/logstash/wiki/logstash's-internal-message-format. Please note that it is good practice to forget about the timestamp when creating messages (set logstashTime to Nothing), as it should be a responsability of the Logstash server to add it.

emptyLSMessage :: Text -> LogstashMessage Source

As the name implies, this creates a dummy Logstash message, only updating the message field.

logstashTimestamp :: UTCTime -> Text Source

This formats an UTCTime in what logstash expects

parseLogstashTime :: Text -> Maybe UTCTime Source

This parses the logstash time format.

value2logstash :: Value -> Maybe LogstashMessage Source

This will try to convert an arbitrary JSON value into a LogstashMessage.

addLogstashTime :: LogstashMessage -> IO LogstashMessage Source

Adds the current timestamp if it is not provided.

addLogstashTag Source

Arguments

:: Text

The tag to add

-> LogstashMessage 
-> LogstashMessage 

Adds a tag to a logstash message.