Comments (6)
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.
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.
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.
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.
Happy to hear it works for you. For me, the one I posted works fine:
from goaccess.
This is now closed - feel free to reopen it if necessary.
from goaccess.
Related Issues (20)
- Ability to filter by DATA (URL) on REQUESTED FILES panel HOT 1
- Token '- [03/Apr/2024' doesn't match specifier '%d' HOT 1
- Docker - build development binary in isolated container: error while loading shared libraries: libcrypto.so.1.1 HOT 4
- Restore the capability to modify log/date/time formats in the TUI format dialog HOT 1
- How to hide paths duplicated based on protocol HOT 7
- Feature request: Report should contain histogram of countries requests are comming from HOT 1
- Visitors geolocation map in v.1.9.2: numbers format on the scale bar under the map HOT 4
- memory usage limit HOT 5
- How to respect Licensing terms of db-ip.com? HOT 1
- TX and Requests wrong with incremental processing HOT 26
- Question about --enable-panel HOT 5
- 'Error opening terminal: xterm' using docker image HOT 2
- Incremental processing of piped data HOT 4
- Unique AppPrefs for different html files
- Trying to figure out " Token for '%s' specifier is NULL."
- deb.goaccess.io for Ubuntu 24.04 noble fails HOT 2
- Nginx log format not working in Goaccess HOT 3
- Can't implement GoAccess with Zeek. Wrong format. HOT 2
- Logging Format Question - HAProxy
- Browsers an operating systems aren't recognized HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goaccess.