Comments (3)
Excellent question. The suggested workaround won't be effective because there's a function called set_default_static_files() that utilizes default static extensions in cases where the user hasn't provided a goaccess.conf file. To address this issue without the need to introduce an additional option, the simplest solution would be to append a character to the end of the request, using awk to preprocess the log should solve the issue, e.g.,
First find your request field with:
$ awk '{ print $8 }' access.log
then you can run something like:
$ awk '{if ($8 ~ /\.[^ ]+$/) { $8 = $8 "^" } print}' access.log
website.com:443 192.168.23.27 - - [26/Oct/2023:17:19:32 -0500] "GET /notes.jpg^ HTTP/2.0" 200 23808 "-" "Tiny Tiny RSS/23.10-03e956132 (Unsupported) (https://tt-rss.org/)"
website.com:443 192.168.23.27 - - [26/Oct/2023:17:19:32 -0500] "GET /notes-clean HTTP/2.0" 200 23808 "-" "Tiny Tiny RSS/23.10-03e956132 (Unsupported) (https://tt-rss.org/)"
then you can pass that to goaccess as:
$ awk '{if ($8 ~ /\.[^ ]+$/) { $8 = $8 "^" } print}' access.log | goaccess - --log-format=COMBINED -o output.html
Should output
from goaccess.
Thank you for pointing out set_default_static_files(), I now have a better understanding of what was happening.
I tried your suggestion, it works. Thank you. It was the 7th field in the CLF log file with the path. However, I would like to discuss a few concerns about this suggestion:
- Running awk on all the logs per line introduces additional overhead.
- While I am indeed using a configuration file, I have commented out or deleted the
static-file
tags. I believe GoAccess should automatically detect that a config file is being used but no static-file tags are present. And this is what the expected configuration is, and it should not be overridden with default values. - Adding a caret (^) at the end of the path in the dashboard is not visually appealing. It might lead to errors if we copy the path from the dashboard, as we would then need to manually remove the caret.
(Updated to GoAccess 1.8)
from goaccess.
Thanks for bringing this up! I completely agree with you on this. As you mentioned, if it detects the presence of a config file and no static-file options were used, it shouldn't default to the hard-coded options.
Would you be able to push a PR for this change? It doesn't seem like a particularly difficult change, and most of the adjustments would likely happen within the same function, especially focusing on the index of static-file
using conf.static_file_idx
.
from goaccess.
Related Issues (20)
- Parsing Nginx Log to Goaccess HOT 2
- neither --hide-referrer nor --ignore-referrer work HOT 2
- A long time ago in a galaxy far, far away... HOT 1
- Empty "ENCRYPTION SETTINGS" panel with --log-format=CADDY and Caddy v2.7.4 HOT 2
- Goaccess Cant Parsing error.log Nginx HOT 2
- mixed JSON access log - conflict `%r` and `%C` HOT 4
- [Question] How to filter crawlers/spiders from the unique visitors per day count ? HOT 3
- GoAccess Parsing Log File HOT 1
- Tables after the first fail to render properly HOT 5
- json log file with an array of json log - parse HOT 3
- goaccess-close-visitors HOT 9
- Token doesn't match specifier '%h' HOT 1
- Token doesn't match specifier '%h' HOT 1
- Help with log/date/time format? HOT 2
- Can't see tables on mobile device? HOT 2
- Real time stopped working HOT 6
- Parse SEARCH method HOT 1
- HTML real-time report can't be loaded due to insecure WebSocket connection HOT 1
- Token '[02/Nov/2023' doesn't match specifier '%d' HOT 6
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.