Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External logs (cloudfront) #2

Open
doncabreraphone opened this issue Jul 28, 2020 · 7 comments
Open

External logs (cloudfront) #2

doncabreraphone opened this issue Jul 28, 2020 · 7 comments

Comments

@doncabreraphone
Copy link

Hi again!

Two questions.

  1. Can I ssh to my DH directory and see the goaccess terminal dashboard with this script?

  2. Could somehow this script read external logs? I'm thinking it will be cool to use my Dreamhost installation to read my Amazon Cloudfront logs.

@chuckhoupt
Copy link
Owner

chuckhoupt commented Jul 28, 2020

On # 1, Yes, the pre-built goaccess can be invoked from a terminal shell. The goaccess binary is in the bin directory and can be run as follows (of course, there are lots of command-line options to set, if desired):

$ example.com/goaccess-dh/bin/goaccess ~/logs/example.com/https/access.log

@chuckhoupt
Copy link
Owner

On # 2, the goaccess-dh scripts have a little flexibility. For example, one can set a different logs directory by setting LOGS in a goaccess-dh/.env file. I use this to collect log files from several DH users/accounts (via cron, rsync, etc) into one directory, so they can be analyzed together.

More flexibility would be needed to handle CloudFront. I haven't used CloudFront, so in what form would you access the logs? I gather Cloudfront periodically places them in an S3 bucket. If so, you could periodically sync the log files to DH, and then a modified version of goaccess-dh could read them from there...

@doncabreraphone
Copy link
Author

doncabreraphone commented Jul 28, 2020 via email

@doncabreraphone
Copy link
Author

doncabreraphone commented Jul 28, 2020 via email

@chuckhoupt
Copy link
Owner

On #1, I couldn't get it to work. When I do goaccesd --version, says goaccess dosen't exist :_(

Right, the goaccess binary isn't on your shell's PATH list (i.e. not in /usr/bin, etc), so it can't be run with just goaccess. To run it you'll need to specify a full or relative path to the goaccess-dh bin directory. For example, if you've put goaccess-dh under the example.com site in the user account, then this full path invocation should work:

/home/user/example.com/goaccess-dh/bin/goaccess --version

@chuckhoupt
Copy link
Owner

Another alternative to using a long path to the goaccess binary is to put the goaccess-dh/bin directory on the shell's path list. I.e. execute the following or to make it permanent, add it to .bashrc and re-login:

PATH=/home/user/example.com/goaccess-dh/bin:$PATH

Then a plain goaccess --version should work.

@doncabreraphone
Copy link
Author

On # 2, the goaccess-dh scripts have a little flexibility. For example, one can set a different logs directory by setting LOGS in a goaccess-dh/.env file.

Really interested in how this would work. Could you give me an example? (keep in mind, I'm HALF tech-savvy, and I'm being quite generous with myself here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants