goaccess-for-nginxproxymanager icon indicating copy to clipboard operation
goaccess-for-nginxproxymanager copied to clipboard

Adding Virtual Hosts to NPM parsing

Open robertalexa opened this issue 1 year ago • 8 comments

Hi,

Firstly, thank you for your project, just having a play with it.

Was wondering if you would be able to include Virtual Hosts, especially important on the Requested Files table. The reason for this is that in my case, NPM is proxying multiple domains/subdomains.

Looking at the documentation this seems to be possible: image

In case it is needed, here is a line of my NPM logs:

[02/Jan/2024:01:42:36 +0000] - 101 101 - GET https REDACTED_DOMAIN "/api/websocket" [Client 192.168.10.89] [Length 413201] [Gzip -] [Sent-to 192.168.10.11] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "-"

Thank you in advance!

robertalexa avatar Jan 02 '24 02:01 robertalexa

@robertalexa my understanding from NPM is that the logs for each individual host is in a different file, proxy-host-*_access.log. The above log sample doesn't have a virtual host. Other logs like NGINX or Apache your able to add that Virtual Host.

I'm not an expert of course. Correct me if I'm wrong.

xavier-hernandez avatar Jan 21 '24 03:01 xavier-hernandez

The log does contain the virtual host, marked as " REDACTED_DOMAIN" for privacy reasons. I am not currently around my pc to give more info about the logs but once i do i will get back to you with regards to file names.

robertalexa avatar Jan 21 '24 08:01 robertalexa

Maybe we're talking about two different things; however, there is a panel named "VIRTUAL HOSTS". It lists the domains.

image

xavier-hernandez avatar Jan 21 '24 20:01 xavier-hernandez

As mentioned in my original post, i am referring to Requested Files table image

Knowing how many requests in total for a Virtual Host is great, but brings not value when you want to investigate the actual requests. And that is even more important when multiple virtual hosts might have the same resource file.

Same applies for 404s image

PS: Virtual hosts is populated as expected image

robertalexa avatar Jan 21 '24 20:01 robertalexa

It makes sense, but this is out-of-the-box from goaccess. I think this is what your referring too, https://github.com/allinurl/goaccess/issues/1185 ?

I can try some things.

xavier-hernandez avatar Jan 21 '24 21:01 xavier-hernandez

Yes that is right. I believe the feature set is available in goaccess, based on documentation i have provided, which is also referenced in the thread you've provided.

The "feature" however would be on your software to actually include the extra params and display them in tables.

I appreciate your help!

robertalexa avatar Jan 21 '24 21:01 robertalexa

Looks like I'm left with gibberish in the output... I guess it doesn't work in Docker or at least I don't know how to get it to work. That file continually changes.

The last comment says:

... Though, to be honest, I'm not entirely sure how you would pipe data to the volume. Sorry, you would have to find out how docker gets that data in. Let me know if you have any other questions.

xavier-hernandez avatar Jan 22 '24 04:01 xavier-hernandez

If you have any idea how to implement it feel free to put in a pull request with the modified code.

xavier-hernandez avatar Jan 22 '24 04:01 xavier-hernandez