Safe Haskell | None |
---|---|
Language | Haskell2010 |
A firehose conduit, spawning a web server that will allow for the observation of the messages.
- fireHose :: MonadIO m => Int -> Int -> IO (Conduit LogstashMessage m LogstashMessage)
Documentation
:: 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