Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caddy - GoAccess issues #2380

Closed
MehdiKammakh opened this issue Sep 12, 2022 · 7 comments
Closed

Caddy - GoAccess issues #2380

MehdiKammakh opened this issue Sep 12, 2022 · 7 comments

Comments

@MehdiKammakh
Copy link

MehdiKammakh commented Sep 12, 2022

Dear team,
I have tried to implement GoAccess to work with Caddy access logs
I have proceeded by running an apache2 docker container , and inside it running goaccess ( apt-get install goaccess )

goaccess --version

GoAccess - 1.4.
For more details visit: http://goaccess.io
Copyright (C) 2009-2020 by Gerardo Orellana

Build configure arguments:
--enable-utf8
--enable-geoip=mmdb
--with-openssl

I have followed the setup and running this command : goaccess /var/logs/caddy/site.fr-access.log -o /usr/local/apache2/htdocs/report.html --real-time-html --log-format=CADDY and I'm getting an error like this : Error occurred at: src/parser.c - parse_log - 2777 No time format was found on your conf file.

also tried this command regarding this issue : #1571 (comment)

LANG="en_US.UTF-8" bash -c 'goaccess /var/logs/caddy/site-access.log -o /usr/local/apache2/htdocs/report.html --real-time-html --log-format=CADDY' but nothing special happened

my caddy config is like this :
site.fr { handle { reverse_proxy site-hostname:80 } log { output file /var/log/caddy/site.fr-access.log format json } import common }
Please, if anyone have an idea how to fix this , I will be appreaciate it
thank you

@allinurl
Copy link
Owner

JSON support was added in 1.4.4. Please use this docker image or the official deb repo.

@MehdiKammakh
Copy link
Author

thank you ; all the commands working now correctly
we can use this for multiple logs file , correct ?

goaccess /var/logs/caddy/*-access.log -o /usr/local/apache2/htdocs/index.html --real-time-html --log-format=CADDY

@allinurl
Copy link
Owner

That's correct.

@allinurl
Copy link
Owner

Closing this. Feel free to reopen it as needed.

@MehdiKammakh
Copy link
Author

MehdiKammakh commented Sep 28, 2022

I have an issue when mapping Caddy reverse proxy to the container that GoAccess run on

my Caddy config is :

goaccess.innoyadev.fr {
        handle {
                reverse_proxy p-GoAccess-Apache:7890
                                basicauth {
        InnoyaDev JDJhJDE0JERkQ3hCbWhmemlETUdqNFg4QndhdHVIWVhXenRiRHV1enZXclBPS1VwM3o0MUkyR0RRZUFX
       }
        }
  log {
    output file /var/log/caddy/goaccess.innoyadev.fr-access.log
    format json
  }
}

running GoAccess on httpd docker container with this command
goaccess /var/logs/caddy/*-access.log -o /usr/local/apache2/htdocs/report.html --real-time-html --log-format=CADDY --daemonize

GoAccess running correctly inside the container :

root@p-GoAccess-Apache:/usr/local/apache2# lsof -i -P -n
COMMAND  PID USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
httpd      1 root    3u  IPv4 555951236      0t0  TCP *:80 (LISTEN)
goaccess  99 root    8u  IPv4 555949745      0t0  TCP *:7890 (LISTEN)

when trying accessing goaccess.innoyadev.fr , I get 400 request

@MehdiKammakh
Copy link
Author

@allinurl FYI

@allinurl
Copy link
Owner

Does this help? It seems to work for this user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants