Giter Site home page Giter Site logo

Comments (6)

allinurl avatar allinurl commented on May 24, 2024

Please try:

goaccess access.log --log-format='%^ %v %h %^[%x] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z'

from goaccess.

pmetras avatar pmetras commented on May 24, 2024

Your log-format and datetime-format work from the command line. If I put these formats in my configuration file, it does not work.

I tried with a minimal configuration file:

#time-format %H:%M:%S
#date-format %d/%b/%Y
datetime-format %d/%b/%Y:%H:%M:%S %z
log-format %^ %v %h %^[%x] "%r" %s %b "%R" "%u" %^

It works, but as soon as I uncomment the time-format specification, goaccess does not recognize the log format.

And if I uncomment both lines, time-format and date-format, I get the following format error:

goaccess -p ./goaccess.conf2 ./access-a.log.1
Cleaning up resources...
==4486== GoAccess - version 1.8.1 - Nov  1 2023 00:19:32
==4486== Config file: ./goaccess.conf2
==4486== https://goaccess.io - <[email protected]>
==4486== Released under the MIT License.
==4486==
==4486== FILE: ./access-a.log.1
==4486== Parsed 10 lines producing the following errors:
==4486==
==4486== Token '02/Nov/2023:00:00:11 +0000' doesn't match specifier '%x'
==4486== Token '02/Nov/2023:00:00:14 +0000' doesn't match specifier '%x'
...

I'm using a configuration file as I set many options and don't want to enter them on the command line. But the following line also shows the error: goaccess access-a.log.1 --log-format='%^ %v %h %^[%x] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --time-format='%H:%M:%S' --date-format='%d/%b/%Y'

from goaccess.

allinurl avatar allinurl commented on May 24, 2024

I will have to verify this, but you can always:

log-format %^ %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u" %^
date-format %d/%b/%Y
time-format %T

from goaccess.

pmetras avatar pmetras commented on May 24, 2024

I continued tests to be sure that goaccess recognize all the fields in our log format. This works:

goaccess access-a.log.1 --log-format='FORWARD: %v ~h{, } - %e-%^[%d:%t %^] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --time-format='%H:%M:%S' --date-format='%d/%b/%Y'

This does not work:

goaccess access-a.log.1 --log-format='FORWARD: %v ~h{, } - %e- [%d:%t %^] "%r" %s %b "%R" "%u" %^' --datetime-format='%d/%b/%Y:%H:%M:%S %z' --time-format='%H:%M:%S' --date-format='%d/%b/%Y'

The difference is ...%e-%^[%d... instead of ...%e- [%d....

from goaccess.

allinurl avatar allinurl commented on May 24, 2024

Happy to hear it works for you. For me, the one I posted works fine:

2023-11-21-101455_591x291_scrot

from goaccess.

allinurl avatar allinurl commented on May 24, 2024

This is now closed - feel free to reopen it if necessary.

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.