Giter Site home page Giter Site logo

Comments (3)

allinurl avatar allinurl commented on June 26, 2024

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

2023-10-26-173327_478x154_scrot

from goaccess.

Urvika-gola avatar Urvika-gola commented on June 26, 2024

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:

  1. Running awk on all the logs per line introduces additional overhead.
  2. 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.
  3. 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.

allinurl avatar allinurl commented on June 26, 2024

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)

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.