allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
https://goaccess.io
MIT License
17.88k stars 1.09k forks source link

Docker Goaccess #1751

Closed Davidffry closed 3 years ago

Davidffry commented 4 years ago

For long time i don't succed to run container goaccess, I use this command :

docker run --restart=always -d -p 7890:7890 -v "$PWD:/goaccess" -v "$PWD/html/index.html:/goaccess/index.html" -v "/var/log/nginx/access.log:/goaccess/access.log" --name=goaccess allinurl/goaccess goaccess --no-global-config --config-file=/goaccess/goaccess.conf --ws-url http://raspberrypi:7890

No output : image

to add

image

I've been working on it for several days and I can't find the solution

docker version :

pi@rpi:~/Desktop/goacess $ docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:35:24 2020
 OS/Arch:           linux/arm
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:22 2020
  OS/Arch:          linux/arm
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Raspberry pi : Raspbian - rpi4

allinurl commented 4 years ago

Did you follow this readme? From the command you posted, you are including http. Please just specify the host without http. e.g., --ws-url raspberrypi:7890.

Also, are you able to telnet to the websocket server? e.g., telnet raspberrypi 7890

Davidffry commented 4 years ago

Hey! thanks for your reply I restarted the docker container and telnet with this : image

and, for sure, I followed the given link for long time ;)

BUT I always have : image

Davidffry commented 4 years ago

in addition, I would like see the goaccess trace but it seems the debug option doesn't work for your information, this is my goaccess.conf: image

allinurl commented 4 years ago

Let me try to reproduce on my end, I just need to get my hands on my other machine with docker on it. I'll post back asap.

Davidffry commented 4 years ago

@allinurl, have you test it? thanks for the consideration ;)

allinurl commented 4 years ago

Sorry for the delay on this. Finally got the change to look into it, I updated the README.md.

Here's how I got it to run in real-time:

cat access.log | docker run -p 7890:7890 --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format COMBINED --real-time-html - > report.html

Let me know how it goes.

Davidffry commented 4 years ago

Thanks, I have another issue with the docker container, refers to : #1774 a simple launch cause me this error

allinurl commented 4 years ago

Did it work what I posted before?

vlauciani commented 3 years ago

Hi I've the same problem:

$ cat /var/log/nginx/access.log | docker run -p 7890:7890 --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --ws-url caravel:7890 --log-format COMBINED --real-time-html - > report.html
 [PARSING -] {3594} @ {0/s}
WebSocket server ready to accept new client connections

opening the link: http://caravel:7890 it returns 400.

Testing the port with telnet, works:

$ telnet caravel 7890
Trying 192.168.0.236...
Connected to caravel.
Escape character is '^]'.
allinurl commented 3 years ago

@vlauciani shouldn't you need to open http://caravel/report.html instead of http://caravel:7890?

vlauciani commented 3 years ago

ops, sorry! You are right 🤦🏻‍♂️

Thank you fro your support and time.

allinurl commented 3 years ago

@vlauciani np :) happy to help!

allinurl commented 3 years ago

Closing this as it should be fixed or user/config error.