1

I have seen someone use this command -- and it works where it pulls back all the IPS in a list/group:

cat access.* | awk '{ print $1 }' | sort | uniq -c | sort -n

However, I want to choose the past 2 days; how can I do that?

1
  • so before issuing the above coomand u need to filter the access log and get the entries for last two days , and pipe the output to the above command , to get the entries in a timespan see this stackoverflow.com/questions/7706095/… Commented Jul 13, 2016 at 22:56

1 Answer 1

1
tail -100 access.* | awk '{ print $1 }' | sort | uniq -c | sort -n

or

awk '/28\/Mar\/2016/ { print $1 }' access.* | sort | uniq -c | sort -n

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.