Giter Site home page Giter Site logo

Comments (8)

allinurl avatar allinurl commented on May 25, 2024

This should do it:

# goaccess access.log --log-format='[%x] %^ %s %^ %^ %m %^ %v "%U" [Client %h] [Length %b] [%^] [%e] "%u" "%R"' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --tz=America/New_York --date-spec=min --http-protocol=no

Let me know how it goes.

2024-02-23-183653_598x349_scrot

from goaccess.

ventra007 avatar ventra007 commented on May 25, 2024

Hi,

No still doesn't work unfortunately.

I noticed you giving it to me in a CLI format, but i'm editing the goaccess.conf file, will it look the same?
I'm also getting an additional error: goaccess: unrecognized option: datetime-format

I see this when I run the docker logs goaccess command

If I start it with only adjusting the log-format then I get:
Token '21/Feb/2024:15:37:08 +0000' doesn't match specifier '%x'

Current goaccess.conf file:

time-format %H:%M:%S
date-format %d/%b/%Y
log_format [%x] %^ %s %^ %^ %m %^ %v "%U" [Client %h] [Length %b] [%^] [%e] "%u" "%R"
real-time-html true
log-file /opt/log/proxy-host-1_access.log
log-file /opt/log/proxy-host-2_access.log
log-file /opt/log/proxy-host-3_access.log
log-file /opt/log/proxy-host-4_access.log
log-file /opt/log/proxy-host-5_access.log
date-spec min
http-protocol no

from goaccess.

ventra007 avatar ventra007 commented on May 25, 2024

OK, so it turns out the docker image I have been using was actually pulled from gregyankovoy/goaccess
So I think that is my first issue?

When I tried follwing the instrucions here, to create a new image, none of it works.

If i try build from github i get errors running autoreconf -fiv as per instruction:

autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: running: autopoint --force
Can't exec "autopoint": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 293.
autoreconf: error: autopoint failed with exit status: 2

If i try compile GoAccess and run ./configure --enable-utf8 --enable-geoip=mmdb then i get errors:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking for cc... no
checking for gcc... no
checking for clang... no
configure: error: in `/opt/goaccess-1.5.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

Following the docker instructions makes no sense to me.
Do I browse to where the nginx logs are and run it from that directory?

So perhaps I just need to get it running properly from this github repository.

from goaccess.

ventra007 avatar ventra007 commented on May 25, 2024

So I finally got it installed and by compiling it through wget https://tar.goaccess.io/goaccess-1.9.1.tar.gz

used the same goaccess.conf configuration located at /usr/local/etc/goaccess/goaccess.conf

time-format %H:%M:%S
date-format %d/%b/%Y
log_format [%x] %^ %s %^ %^ %m %^ %v "%U" [Client %h] [Length %b] [%^] [%e] "%u" "%R"
real-time-html true
log-file /opt/nginxproxymanager/data/logs/proxy-host-1_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-2_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-3_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-4_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-5_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-6_access.log
date-spec min
http-protocol no

now i'm getting the errors when running ./goaccess from where i compiled it (/opt/goaccess-1.9.1)

Cleaning up resources...
==11725== GoAccess - version 1.9.1 - Feb 24 2024 10:14:31
==11725== Config file: /usr/local/etc/goaccess/goaccess.conf
==11725== https://goaccess.io - <[email protected]>
==11725== Released under the MIT License.
==11725==

==11725== Released under the MIT License.
==11725==
==11725== FILE: /opt/nginxproxymanager/data/logs/proxy-host-1_access.log
==11725== Parsed 10 lines producing the following errors:
==11725==
==11725== Token '21/Feb/2024:15:37:08 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:15:37:12 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:15:37:15 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:15:37:36 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:15:37:37 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:19:40:58 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:19:40:58 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:19:41:05 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:19:41:05 +0000' doesn't match specifier '%x'
==11725== Token '21/Feb/2024:19:41:05 +0000' doesn't match specifier '%x'
==11725==
==11725== Format Errors - Verify your log/date/time format

from goaccess.

allinurl avatar allinurl commented on May 25, 2024

Seems like your strptime/strftime version doesn't support %z (time zone). What Linux distribution and kernel are you running? You might want to give this a shot instead:

# goaccess access.log --log-format='[%d:%t %^] %^ %s %^ %^ %m %^ %v "%U" [Client %h] [Length %b] [%^] [%e] "%u" "%R"' --datetime-format=%d/%b/%Y --time-format=%T --date-spec=min --http-protocol=no

from goaccess.

ventra007 avatar ventra007 commented on May 25, 2024

I’m running Ubuntu server 22.04 LTS
I’ll try the format and let you know.
Appreciate the assist.

from goaccess.

ventra007 avatar ventra007 commented on May 25, 2024

This brings me back to my original issue:

Cleaning up resources...
==11970== GoAccess - version 1.9.1 - Feb 24 2024 10:14:31
==11970== Config file: /usr/local/etc/goaccess/goaccess.conf
==11970== https://goaccess.io - <[email protected]>
==11970== Released under the MIT License.
==11970==
==11970== FILE: /opt/nginxproxymanager/data/logs/proxy-host-1_access.log
==11970== Parsed 20 lines producing the following errors:
==11970==
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970== Token '-' doesn't match specifier '%s'
==11970==
==11970== Format Errors - Verify your log/date/time format

Linux version:
Linux ubuntu 5.15.0-97-generic #107-Ubuntu SMP Wed Feb 7 13:26:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

from goaccess.

ventra007 avatar ventra007 commented on May 25, 2024

OK, so I finally got it running.

goaccess.conf:

datetime-format %d/%b/%Y:%H:%M:%S %z
log_format [%x] %^ %s %^ %^ %m %^ %v "%U" [Client %h] [Length %b] [%^] [%e] "%u" "%R"
real-time-html true
log-file /opt/nginxproxymanager/data/logs/proxy-host-1_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-2_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-3_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-5_access.log
log-file /opt/nginxproxymanager/data/logs/proxy-host-6_access.log
date-spec min
http-protocol no

For this to work I had to edit my /usr/share/i18n/locales/en_US and match it with the format used by %x

Under LC_TIME:

% Appropriate date representation (%x)
d_fmt   "%d//%b//%Y"

Hope this helps someone else.

from goaccess.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.