logspout
logspout copied to clipboard
How to use httpstream with multiline?
Could anyone explain to me how to use httpstream with multiline support? As far as I understand httpstream is not considered as an adapter, but the docs say we need to prefix "an adapter" with multiline. I've tried to use it in combination with raw, guessing this might be the default adapter, but raw won't work without ip and port. To be honest, I've no idea which ip and port I should provide. I just want to use the httpstream with multiline support.
FYI: I've asked the same question at StackOverflow.
Hey! @stphngrtz
I guess you can just use it like how you would run logspout, but make sure to publish the port logspout listens on:
docker run -d --name="logspout" \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--publish=127.0.0.1:8000:80 \
gliderlabs/logspout
And then to stream logs, just curl the endpoint:
curl http://127.0.0.1:8000/logs
If you are using a custom logspout build with an extended adapter, make sure to add:
_ "github.com/gliderlabs/logspout/httpstream"
to the imports in modules.go
Since httpstream is a built-in module, you don't need to specify it when running logspout via docker run as above.
Hope that helps!