Skip to content

Update index.php#1161

Closed
santacruz-usa wants to merge 1 commit into
linuxserver:swag-dashboardfrom
santacruz-usa:patch-1
Closed

Update index.php#1161
santacruz-usa wants to merge 1 commit into
linuxserver:swag-dashboardfrom
santacruz-usa:patch-1

Conversation

@santacruz-usa

Copy link
Copy Markdown

Modified call to goaccess: instead of sending the entire log content to goaccess via stdin, let goaccess process the log file directly.

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Modified call to goaccess: instead of sending the entire log content to goaccess via stdin, let goaccess process the log file directly. This change allows goaccess to use built-in efficiencies for parsing: by using a file, goaccess will persist statistics regarding any already-parsed data from the file. Using stdin instead means that goaccess must rely on timestamp comparisons and discard rows that are earlier than the latest parse timestamp. As the log file grows (until logrotation), we can avoid sending already-parsed data repeatedly for every call by having goaccess keep track of its own state.

Benefits of this PR and context:

The benefit of accepting this PR is reduced overhead and improved processing efficiency for the dashboard.

How Has This Been Tested?

Testing was performed by using docker compose with bind mount for "/custom-cont-init.d", in which a custom script modified 'index.php' to reflect the intended change:

 
declare PHPFILE="/dashboard/www/index.php"
if [ ! -f "${PHPFILE}" ]; then
    echo "**** '${PHPFILE}' is not in default location; skipping ****"
    exit 0
fi
sed -i -r 's/(shell_exec\(")(cat \$access_log \| )(\/usr\/bin\/goaccess)(.*asndb)( -)/\1\3 $access_log\4/' "${PHPFILE}"

For both the original code and the proposed code, dashboard load timings were captured for a series of increasingly larger 'access.log' files. The proposed code showed an improvement in processing efficiency.

Source / References:

See the documentation for goaccess here, specifically the section "Processing Logs Incrementally": https://goaccess.io/man#examples

Modified call to goaccess: instead of sending the entire log content to goaccess via stdin, let goaccess process the log file directly.  

Signed-off-by: santacruz-usa <santacruz@southalabama.edu>
@santacruz-usa
santacruz-usa marked this pull request as draft July 23, 2026 08:00
@santacruz-usa
santacruz-usa marked this pull request as ready for review July 23, 2026 08:00
@santacruz-usa
santacruz-usa marked this pull request as draft July 23, 2026 08:00
@LinuxServer-CI LinuxServer-CI moved this from PRs to Done in Issue & PR Tracker Jul 23, 2026
@santacruz-usa
santacruz-usa deleted the patch-1 branch July 23, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants