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

Safe HaskellNone

Data.Conduit.FireHose

Description

A firehose conduit, spawning a web server that will allow for the observation of the messages.

Synopsis

Documentation

fireHoseSource

Arguments

:: MonadIO m 
=> Int

Port

-> Int

Buffer size for the fire hose threads

-> IO (Conduit LogstashMessage m LogstashMessage) 

A web server will be launched on the specified port. Clients can request URLs of the form /type1,type2,type3. They will be fed all LogstashMessage matching one of the given types.

Here is a sample usage :

 -- run the fire hose on port 13400
 fh <- fireHose 13400 10
 logstashListener lport (printErrors =$ CL.mapM (liftIO . addLogstashTime) -- add the time
                                     =$ fh
                                     =$ CL.map (BSL.toStrict . encode) -- turn into a bytestring
                                     =$ redisSink host port queue (Just logfunc)) -- store to redis