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

Nick Rout <[email protected]> Thu, 22 Dec 2011 15:02:53 +1300
Newsgroups gmane.org.user-groups.linux.new-zealand.general
Message-ID <CALmzFLZ7SPBvDVXf-he05JctuydqpPwH=QE6majLoqsjpNTJoA@mail.gmail.com>
On Thu, Dec 22, 2011 at 2:26 PM, Steve Holdoway <[email protected]> wr=
ote:
> 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

zcat can also work for this, and leaves the original file compressed
on the disk. there are all sorts of useful commands to work on
compressed files that simply have z prepended to the name

zcat, zless, zgrep, zdiff

> 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 =A0may 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
>>
>>
>> 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 h=
ow
>> > many people have visited it in the last year, so i can judge if it's w=
orth
>> > 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 ubunt=
u
>> > 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
>>
>> _______________________________________________
>> NZLUG mailing list [email protected]
>> http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
>
> --
> Steve Holdoway BSc(Hons) MNZCS <[email protected]>
> http://www.greengecko.co.nz
> MSN: [email protected]
> Skype: sholdowa
>
> _______________________________________________
> NZLUG mailing list [email protected]
> http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
>

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