-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Extracting virtual host from the file name #673
Comments
Are you looking to generate one report per domain? or one big report with a virtual host panel containing the info about all domains? As far as loading data from the disk, #334 will address the double parsing of the log. |
Well both options would be nice, the first will allow me to create a report per domain to show to domain owners (but that i think can easily be done with a script and generate an outputfile on a per domain basis). Thanks for the reference to issue #334 :) |
You probably can do some pre-processing before data is consumed by goaccess, e.g.,
and use the
|
Thanks for that, is definetely something, beside the fact that add the ".log" in the virtual host definition :) Any hint to take out the extension from the filename? It would always be a .log extension if that may help |
This should do it:
|
Thank you very much :) Now it showing better informations :) Beside that, now it's quite better :) |
Thanks, but actually i cannot find the information you're refering to in the man page, which section should i investigate deeper? Thanks again for your time and patience :) |
Assumes your log format looks like:
then
That's right, you can have live data as the demo page. Upstream added the ability to parse multiple log files in real-time. In v1.1.1 you can only display live data for one log file. For instance, for live stats you can run it as:
Take a look the FAQ for info on live stats |
Ok, thnks, the first solution for the files list worked perfectly. Too bad i cannot run the live server with multiple files but it's ok. An additional useful thing maybe would be have the ability to filter by Virutalhost in order to see the stats specific for a single domain :) For now, thanks :) |
#117 will add the filtering from the UI. Otherwise, the upcoming version will allow you to do live stats as:
Stay tuned :) |
But still from a single file :) A folder parsing (like -d /var/log/httpd/domains/*.log) would be better to parse multiple logs at once and have very rich live data (but i guess would be also resource consuming). Maybe the ability to get the info from a rsyslog MySQL DB would have on a centralized logging system environment aswell :) |
The upcoming version will allow you to do just that + live stats:
Once #117 is implemented, you should be able to filter for a particular vhost within the UI. |
Oh that's cool :) Thanks |
You should be able to find specific files, e.g.,
You may need to code something in bash and loop though the files. I don't think goaccess should be doing file processing, especially since there are a bunch of tools that can handle this pretty well. Thanks for the suggestion though. |
Sure i definetely agree but on a service using goaccess live that option shouldn't be possible i think :) |
I was able to push out a commit that implements this. For flexibility, it uses POSIX regex to extract the vhost from the filename. Here's how it works. e.g., Assuming You can use multiple log files and it will work the same the way (assumes the same pattern). Feel free to build from development and let me know how it goes. It will be deployed in the upcoming release. Stay tuned. |
Hi there,
i'm trying to implement GoAccess for monitor my server and all the hosted domains.
The only problem is that i don't have the virtual host inside the log file but in the filename itself (DirectAdmin control panel for instance).
So i have all the logs in: /var/log/httpd/domains/
And they look like this:
I've managed to create scripts to look for each file and import them, overall everything is working but i don't have a per-virtual host information, so is quite huge output more or less useful as overall, but would be nice to be able to see statistics on a per-domain (virtual-host) basis...
Anyone have any hint on how to acchieve that?
Also, i've got a question, using the options to save the db and load it to have historycal data is very useful, but what if i load multiple times the same file? Will this not be merged right increasing the visit even if those were counted before, am i right? Any way to check already processed data?
Thanks everyone
Best regards
Andrea
The text was updated successfully, but these errors were encountered: