Just found this tool, looks brilliant!
I was hoping to use this along with Caddy to watch the access logs in my docker-compose stack. I found there was a couple very outdated third party implementations.
https://github.com/diyan/goaccess-docker
https://github.com/joelchen/goaccess
Both of these are pre-1.0.0. I was hoping for an official Docker image with support for running and watching the Caddy logs in realtime.
Thanks
I did build myself a Dockerfile which works fine for just processing one-off files for now, but I can't get realtime working. I'm not sure how to make the goaccess command run in the foreground as docker requires it, as PID 1.
FROM alpine:3.4
MAINTAINER Francis Lavoie <[email protected]>
ENV goaccess_version=1.0.2
ENV build_deps='go build-base ncurses-dev'
RUN set -x && \
apk add --update ncurses $build_deps && \
wget -O /tmp/goaccess.tar.gz http://tar.goaccess.io/goaccess-$goaccess_version.tar.gz && \
tar -xzvf /tmp/goaccess.tar.gz -C /tmp && \
cd /tmp/goaccess-$goaccess_version && \
./configure --enable-utf8 && \
make && \
make install && \
apk del $build_deps && \
rm -rf /var/cache/apk/* /tmp/goaccess*
ADD ./goaccess.conf /usr/local/etc/goaccess.conf
EXPOSE 7890
ENTRYPOINT ["goaccess"]
Usage:
Make sure you have a goaccess.conf file in the same dir, it gets copied into the container.
Build with $ docker build -t goaccess .
Do stuff $ cat access.log | docker run -i goaccess > access.html
Edit: Okay, so I figured out that the service is actually just for the websocket after some digging... that wasn't obvious.
Run this first to generate the html file so it's somewhere you can access
docker run --rm -v "/absolute/path/to/access.log:/usr/logs/access.log" goaccess -f /usr/logs/access.log > goaccess/access.html
Then kill it with Ctrl+C.
Then run this (note the -d to daemonize) to run the websocket server
docker run -d --name goaccess -p "7890:7890" -v "/absolute/path/to/access.log:/usr/logs/access.log" goaccess -f /usr/logs/access.log
And the following to stop it
docker stop goaccess && docker rm goaccess
Thanks for sharing this! Were you able to get the real-time report working?
Yeah - see the edit at the bottom. Problem is though, I need to generate
the HTML somewhere on the host first right now with this setup. I'll
probably expand on it and make a repo with Caddy to serve the HTML and
proxy the websockets.
On Sep 17, 2016 11:53 AM, "Gerardo O." [email protected] wrote:
Thanks for sharing this! Were you able to get the real-time report working?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/allinurl/goaccess/issues/520#issuecomment-247784048,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACA41W10EPGppZBZIaT_GG6pQqYUo4Ppks5qrAzbgaJpZM4J_SKC
.
One of the things I need to do is to daemonize a process so it won't stick to a TTY as it is right now.
I'll play with the docketfile you posted here. Also, I didn't know about Caddy, look pretty interesting :+1:
@allinurl or @francislavoie: Any progress on this, or need any help testing? I've got a Docker-Compose stack as well that I'd like to include GoAccess with 😃
@brandon099 are you asking about the docker file? I have not had the chance to look at daemonizing a process, but I can bump this up in the to-do list, it shouldn't be to bad though. Any help is always welcome :)
I haven't touched this since either, I ended up just setting up netdata and not doing anything with my logs for this project. Still interested in a proper solution but I don't have much time to allocate to it.
Yeah I was asking about the Dockerfile. If you could bump up the daemonized process functionality on the to-do list, I can certainly work on the Dockerfile piece when that's done!
Thanks for your work on this, it's an awesome project!
@brandon099 I just added --daemonize command line option to run goaccess as a daemon (if --real-time-html enabled). It will be shipped in the upcoming version. See #660.
Most helpful comment
@brandon099 I just added
--daemonizecommand line option to run goaccess as a daemon (if--real-time-htmlenabled). It will be shipped in the upcoming version. See #660.