Page 1 of 1

website usage log

Posted: Mon Mar 13, 2023 12:53 am
by racerlupine
Is there a way I can see which useragents visited a given URL? Or, put another way, can I see which URLs were visited by a given useragent?

thanks

RACER

Re: website usage log

Posted: Tue Mar 14, 2023 6:48 pm
by joemuller
racerlupine wrote:Is there a way I can see which useragents visited a given URL? Or, put another way, can I see which URLs were visited by a given useragent?
You'll need to look at the access logs for your site, as the Webalyzer stats available via Member Tools only give a breakdown of the total number and percentage of requests from a user-agents. If you have shell access enabled on your account, you can do search for a given user agent like so:

Code: Select all

$ zgrep Firefox /logs/by_user/example.com/access_log*
Here's an example of what the average entry in the log looks like:

Code: Select all

1.2.3.4 example.com - [13/Mar/2023:00:41:11 -0700] "GET /wp-login.php HTTP/1.1" 200 2974 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0"
Here's an example one-liner you can do to find all the user agents that visited a URL: (adapted from this guide)

Code: Select all

zgrep URL_GOES_HERE /logs/by_user/example.com/access_log* | awk -F\" '{print $6}' | sort | uniq -c | sort -fr
I hope the above info helps out!

-- Joe

Re: website usage log

Posted: Thu Mar 16, 2023 11:52 pm
by racerlupine
Joe,

Thanks for this! Especially for the link to the guide.

RACER