[SATLUG] using grep
Jose Calderon
jose.cldrn at gmail.com
Thu Sep 20 18:28:09 CDT 2007
Have you tried wildcards? Maybe something like:
$grep -c [15:**:**] tmpIEEE-17.txt
I'm not as familiar with all the options as I'd like so I don't know if this
will work but I hope this helps.
BTW, I never introduced myself properly. My name is Jose Calderon and I'm a
full-time student at UTSA and part-time lab tech at SAC. I've worked with
UNIX before and started learning Linux a few months ago.
Jose
On 9/20/07, twistedpickles <twistedpickles at gmail.com> wrote:
>
> I'm trying to figure out how to search for info I need and I am having
> some
> trouble.
> Maybe somone on the list can help.
> I am trying to get the number of ieee users permitted between certain
> times
> or hours of the day.
>
> Exceprt from my logs below.
> ...
> [2007-09-20 15:11:34] User ieee permitted in class Public
> [2007-09-20 15:12:33] User hr permitted in class Public
> [2007-09-20 15:12:46] User ieee permitted in class Public
> [2007-09-20 15:12:48] User aparras permitted in class Public
> [2007-09-20 15:12:52] User IEEE denied access
> [2007-09-20 15:13:23] User IEEE permitted in class Public
> ...
>
> I scanned some logs and grep'ed info I needed into files by date.
> $ grep '2007-09-17' mylog.log > 2007-09-17.txt
> $ grep '2007-09-18' mylog.log > 2007-09-18.txt
> ...
>
> Now I scan for the string 'User ieee permitted in class Public'
>
> $grep -i 'User ieee permitted in class Public' 2007-09-17.txt >
> tmpIEEE-17.txt
>
> now i'm trying to get the count between certain hours
>
> what I have tried and hasn't worked is:
> $grep -c 15:[0-59]:[0-59] tmpIEEE-17.txt
> above displays 0
> $grep -c [15:00:00-15:59:59] tmpIEEE-17.txt
> above counts every line in the log
>
>
> --
> ::twistedPickles:: :
> --
> _______________________________________________
> SATLUG mailing list
> SATLUG at satlug.org
> http://alamo.satlug.org/mailman/listinfo/satlug to unsubscribe
> Powered by Rackspace (www.rackspace.com)
>
More information about the SATLUG
mailing list