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

how to show only one requests #1623

Open
vitaocode opened this issue Dec 5, 2019 · 3 comments
Open

how to show only one requests #1623

vitaocode opened this issue Dec 5, 2019 · 3 comments

Comments

@vitaocode
Copy link

@vitaocode vitaocode commented Dec 5, 2019

good afternoon,
How can I only show a single address on my dashboard?
I have these other_vhost_accesslog lines:
www.domain.com.br:443 IPVISITOR - - [05/Dec/2019:16:57:37 -0300] "GET /portalclaro/img/image.png HTTP/1.1" 200 192898 "**https://domain.com.br/folder1/**" "Mozilla/5.0 (Linux; Android 9; SM-A505GT) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36"
and
www.domain.com.br:443 IPVISITOR - - [05/Dec/2019:16:57:37 -0300] "GET /portalclaro/img/image.png HTTP/1.1" 200 86365 "**https://domain.com.br/folder2/**" "Mozilla/5.0 (Linux; Android 9; SM-A505GT) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36"

note that the requests field is the same domain but different folders.

I want to create a dashboard for each request but I can't do the proper preprocessing.
like a
dashboard1 = https://domain.com.br/folder1/
dashboard2 = https://domain.com.br/folder2/

Can Geraldo please help me?

@vitaocode

This comment has been minimized.

Copy link
Author

@vitaocode vitaocode commented Dec 5, 2019

I think I could do it this way:
ssh -i /root/chave.pem ubuntu@IPREMOTESERVER 'tail -f /var/log/apache2/other_vhosts_access.log' | grep 'domain/folder1\|www.domain.com.br/folder1'| goaccess -p /usr/local/etc/goaccess/goaccess.conf -o /var/www/dashboard.com.br/goaccess.html --real-time-html --fifo-in=/tmp/portalnet.in --fifo-out=/tmp/portalnet.out --port=7891
this way I was able to create a dashboard for each folder but I don't know if this is the best way to do this ...
remembering that I read remote logs from another server
** posted only the folder 1 code

I already thank you for the great help and the great project that goaccess is.
I hope one day to reach your programming level

@allinurl

This comment has been minimized.

Copy link
Owner

@allinurl allinurl commented Dec 13, 2019

So basically you want to create a different report for each unique request?

@vitaocode

This comment has been minimized.

Copy link
Author

@vitaocode vitaocode commented Dec 13, 2019

Good afternoon, Geraldo.
sorry not to post before, but I solved the problem as follows:
ssh -i /root/chave.pem ubuntu@IPADDRESS "tail -f -n +1 /var/log/apache2/other_vhosts_access.log" | grep "domain/FOLDER1" | goaccess -p /usr/local/etc/goaccess/goaccesscontrole.conf -o /var/www/dashboard-dkvox.com.br/FOLDER1.html --real-time-html --fifo-in=/tmp/ceo.in --fifo-out=/tmp/ceo.out --port=7896
AND
ssh -i /root/chave.pem ubuntu@IPADDRESS "tail -f -n +1 /var/log/apache2/other_vhosts_access.log" | grep "domain/FOLDER1" | goaccess -p /usr/local/etc/goaccess/goaccesscontrole.conf -o /var/www/dashboard-dkvox.com.br/FOLDER2.html --real-time-html --fifo-in=/tmp/controle.in --fifo-out=/tmp/contole.out --port=7895

this way I have two different dashboards and each one with a different grep, just taking the url of the folder I want.
even more, I managed to solve one more problem.
The problem was:
as I do tail for ssh from another server, when closing putty goaccess was still active but SSH disconnected ... causing the data not to be updated ....
To solve this I did as follows:
I installed the screen package and run each command on a different screen.
and as you can see it allows me not to use the --daemon option

Before this solution I was using:
SSH with NOHUP and goaccess with --daemon.
however from what I understand I could not have more than one SSH with NOHUP.

So I could not leave more than one active dashboard in real time.

When you generally read this solution do you think it is the best? or if you have any other way?

because nowadays my difficulty is not being able to automate it,
because every morning I have to kill all the processes
and start again every day manually.

because I couldn't find a way to use screen next to cron ...
actually not being able to automate even when using NOHUP and --daemon.
 
I need to automate because when apache rotates the log my tail no longer works.

thanks again for the beautiful work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.