Re: probably a dumb question....getting list of unique IP addresses from apache logs

Steve Holdoway <[email protected]> Thu, 22 Dec 2011 14:26:17 +1300
Newsgroups gmane.org.user-groups.linux.new-zealand.general
Organization Green Gecko Global Ltd.
Message-ID <1324517177.23467.27.camel@steve-desktop>
--===============1074344230==
Content-Type: multipart/signed; micalg="sha1";
	protocol="application/x-pkcs7-signature";
	boundary="=-mb0WRZlf0rhSW2INY7KJ"


--=-mb0WRZlf0rhSW2INY7KJ
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I pipe that through sort -nr to get an idea of the most commonly used
addresses. Some sort of geiop will also help you decide how useful the
visitor may be.

You may also need to look at the archived files ( the
access_log.1, .2.gz, etc ), expand the zipped ones and cat them all into
that command line to get a sample over a longer timespan. In addition if
there are multiple sites on the server, they  may be logging access to
alternate ( but hopefully obvious ) log files. In that case, just add
them to the list of files you're cat'ing in the first step of the pipe.

Hope that makes sense.

Steve
On Thu, 2011-12-22 at 12:06 +1300, Tim McNamara wrote:
> cat /var/log/apache/access.log | awk '{ print $1 }' | sort -n | uniq -c
>=20
>=20
> On 22 December 2011 12:00, Robin Paulson <[email protected]> wrote:
> > i'm hosting a site who's domain is due for renewal. i'd like to know ho=
w
> > many people have visited it in the last year, so i can judge if it's wo=
rth
> > keeping. i realise using IP addresses isn't great, but it is the best i
> > have. is there any way to check this via the apache logs? even for the =
last
> > few months, i'm not sure how far back my logs go, it's a default ubuntu
> > 10.04 setup
> >
> > cheers,
> >
> > --
> > robin
> >
> > http://fu.ac.nz - Auckland's Free University
> >
> > _______________________________________________
> > NZLUG mailing list [email protected]
> > http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
>=20
> _______________________________________________
> NZLUG mailing list [email protected]
> http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug

--=20
Steve Holdoway BSc(Hons) MNZCS <[email protected]>
http://www.greengecko.co.nz
MSN: [email protected]
Skype: sholdowa

--=-mb0WRZlf0rhSW2INY7KJ--



--===============1074344230==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
NZLUG mailing list [email protected]
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug

--===============1074344230==--