SEARCH

How-To Geek

Finding RSS Subscriber Counts Through Apache Logs

If you’ve declined to use a service like FeedBurner to handle your RSS feeds, you might wonder how many subscribers you actually have. This also works well for finding subscriber counts to specific categories or comment posts on your site, which you typically wouldn’t run through FeedBurner.

It turns out that most of the bigger feed readers like Google Reader and Netvibes will actually show you the count during the request for your feed. All you have to do is take a peek inside your access log files.

First you’ll need to locate your apache logfile, which is normally called access_log or access.log. The location for this file will vary greatly based on distribution and your hosting provider. Here’s a couple of places to start, but you might have to look around.

Ubuntu default:

   /var/log/apache2/access.log

MediaTemple DV default:

   /var/www/vhosts/<hostname>/statistics/logs/access_log

Dreamhost default:

   ~/logs/<hostname>/http/access.log

Now that you’ve found the logfile, it’s a simple matter of running it through grep for the keyword “subscribers”, which most of the feed readers use to show the subscriber count. You could just use the simplest command:

grep -i subscribers access_log

Or, if you wanted to find the subscribers for a particular feed, you could run it through a second grep to restrict to just that rss feed.

grep -i subscribers access_log | grep -i ‘/howtogeek/feed/’

Here’s an example of what that brings back on my personal blog (which I should really update more)

209.85.238.9 – - [28/Aug/2007:06:08:23 -0700] “GET /howtogeek/feed/ HTTP/1.1″ 302 572 “-” “Feedfetcher-Google; (+http://www.google.com/feedfetcher.html; 52 subscribers; feed-id=13671896334760112923)”
193.189.143.237 – - [28/Aug/2007:06:12:32 -0700] “GET /howtogeek/feed/ HTTP/1.0″ 302 535 “-” “Netvibes (http://www.netvibes.com/; 2 subscribers)”
64.78.155.100 – - [28/Aug/2007:06:14:40 -0700] “GET /howtogeek/feed/ HTTP/1.1″ 302 535 “-” “NewsGatorOnline/2.0 (http://www.newsgator.com; 2 subscribers)”

Note the bolded text that shows I have all of 56 subscribers from those three online feed readers. Mysticgeek has a lot more from Google alone:

209.85.238.9 – - [28/Aug/2007:05:57:25 -0700] “GET /mysticgeek/feed/ HTTP/1.1″ 302 568 “-” “Feedfetcher-Google; (+http://www.google.com/feedfetcher.html; 111 subscribers; feed-id=5433036316661303107)”

Perhaps I should take a cue from him and start updating my personal blog… but then I would have less time for writing articles.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 08/29/07

Comments (7)

  1. Leonardo Fontenelle

    Nice tip! I found a command line to print nicely how many users are subscribing with Google Reader (in Portuguese). I wrote a more generic script:

    awk ‘/subscriber/ {print $12,$14,$7}’ my_log | \
    sort -nr | uniq | \
    cut -c 2- | tr ‘ ‘ ‘\t’

  2. The Geek

    That’s an awesome script… really nice tool.

  3. Bárbara

    How i could do this if don’t have shell access to my domain?

  4. Binny V A

    @Leonardo
    Great script!

    A better way to do this is FeedBurner. But if you are using the feedburner service, you will not be able to do get the data from the server log.

  5. Leonardo Fontenelle

    @Barbara: I don’t have shell access either. From time to time, I download the log file and run the script on my own machine.

  6. Barbara Weibel

    Terrific post. Do you have a particular web log analyzer that you like to use, one that will specifically allow this type of search? Thanks for any help you can provide.

  7. Ken Varnum

    I built a tool that does something similar — except that it also counts the number of times web browsers request the RSS feeds and estimates a few other mechanisms. Try out http://www.rss4lib.com/feedstats/yourstats.pl . (You need to have a copy of your server’s log file. And for now, the tool only handles Apache logs, but that will soon change.)

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!