When I analyze my Apache access logs, I want to exclude my own visits from that analysis.

The problem with that is, that I have a dynamic IP, and I don't want to have to watch and note down my IP whenever I work on my sites. Also, excluding different IPs for different periods of time is certainly going to be a hassle when I process my logs.

I would therefore like to leave some kind of "footprint" in my own visits to my site. I thought about changing my user agent string (e.g. replace it completely or add something to it), but I don't know how that will affect my experience on other websites. Also, I might forget to do this when I switch browsers.

So what is a good method to leave a trace in one's own access log entries?

  • There are extensions you can add to Chrome that will change the user agent string for specific websites only. You can also have a secret URL that you access to enter into the site. This will give you a way to find all the IPs you've been using. You could also connect via SSH and create a local tunnel so that the client IP address is
    – Reactgular
    Commented Jun 18, 2018 at 17:07
  • Thank you, @cgTag. Could you explain the second method? The third doesn't allow me to view the site (as a visitor would), if I understand correctly.
    – user89960
    Commented Jun 18, 2018 at 17:10
  • 1
    Add a URL to your website that redirects to the home page and only you use it. Keep it hidden from search engines by not having any URLs link to it. Only you use it so if you grep that URL it lists all your IP addresses. You have to remember to use that URL from now on. For the SSH tunnel. This lets you connect directly to the server and your desktop's browser uses to browse the website. howtogeek.com/168145/how-to-use-ssh-tunneling
    – Reactgular
    Commented Jun 18, 2018 at 17:14
  • 1
    You can also add a bogus parameter ?its=me to your first or all requests. It should be ignored and still logged.
    – closetnoc
    Commented Jun 18, 2018 at 17:16

1 Answer 1


To identify my own visits in my logfiles, I have added a recognizable string to the user agent request header that is sent by my browser.

For example, when using Firefox on a Mac, the user agent looks like this:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:84.0) Gecko/20100101 Firefox/84.0

In the Firefox configurations (about:config) I set general.useragent.override to:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:84.0; somestring) Gecko/20100101 Firefox/84.0

Now Firefox sends this user agent request header to all websites I visit. Parsers that read the user agent header ignore the added part of the string ("somestring" in my example), so my browsing experience and their statistics sill look the same. But when analysing my logfiles, I can easily exclude all lines containing this string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.