Update index.php#1161
Closed
santacruz-usa wants to merge 1 commit into
Closed
Conversation
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
marked this pull request as draft
July 23, 2026 08:00
santacruz-usa
marked this pull request as ready for review
July 23, 2026 08:00
santacruz-usa
marked this pull request as draft
July 23, 2026 08:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modified call to goaccess: instead of sending the entire log content to goaccess via stdin, let goaccess process the log file directly.
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