Newbie to perl - Help with stats script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Newbie to perl - Help with stats script
# 1  
Old 03-25-2009
Newbie to perl - Help with stats script

Hi, this is my first post so here goes.....

I need help... I am trying to write a script to produce some stats based on a number of searches in a log file. Now i know how to do this using multiple variables which are really just greps, but I want a more efficent way of doing this as my poor server will probably explode.

So I was thinking perl and arrays etc, but after reading and trying im not getting anywhere fast....help please

The stats files I have produced before basically look like this

Hour Item 1 Item 2 Item 3 Item 4
00:00 2 3 5 6

Where each "item" is a variable doing a grep for a specific string (see below)

So the log file is produced in the /myserver/logs directory.

I need to search for multiple strings which are

"POST/ data/queue/scannerfeed/"
"POST/ information/list/printerfeed/"
"POST/ resource/devinfo/productqueue/"
"POST/ effort/devinfo/listqueue/"

I would handle the hour by running the script each hour at hh:59 from the cron

Is there any easy way of doing this in perl? Hints, tips welcome.
# 2  
Old 03-25-2009
Post what code you have written so far and post some real sample lines from the log file
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Hidden Characters in Regular Expression Matching Perl - Perl Newbie

I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense. ... (4 Replies)
Discussion started by: kittyluva2
4 Replies

2. Shell Programming and Scripting

perl script to print file information - newbie

Hi I have a perl script that prints all the video and audio file information(playing duration). It works fine in one of my friends linux laptop. But it doesn't work in my both windows and linux. My friend told me I have to do install some module ( ppm instal ...... ) but I have no... (1 Reply)
Discussion started by: srijith
1 Replies

3. Shell Programming and Scripting

Using perl to obtain stats instead of grep

Evening all, i hope you guys can help !! I'm working on a pass purchase system and would like to run a script every day from cron which looks at the previous day log files and produce some kind of stats for passes purchased / success / failures. Issues. I have around 25 passes and for each... (13 Replies)
Discussion started by: jeffersno1
13 Replies

4. Shell Programming and Scripting

script to update the stats

Hi, I am using the below shell script to update the webalizer stats: #!/bin/bash username='elogic1' domain='abcd.com' path_to_webalizer='/hsphere/shared/bin/webalizer' path_to_logs='/hsphere/local/home/elogic1/logs/abcd.com'... (4 Replies)
Discussion started by: gsiva
4 Replies

5. Shell Programming and Scripting

Perl newbie questions!

Hi, So I started to learn perl a few days ago, and I have some problems... One of my problems... #!C:\Perl64\bin\perl.exe -w use LWP::Simple; print "Content-Type: Text/Plain\n\n"; sub pagelinks { return @all = get($_) =~ /href\s*=\s*"?(+)/gis; } @a =... (5 Replies)
Discussion started by: byte1918
5 Replies

6. Shell Programming and Scripting

perl newbie . &&..programming newbie

Hi, I am new to programming and also to perl..But i know 'perl' can come to my rescue, But I am stuck at many places and need help..any small help is much appreciated... below is the description of what i intend to acheive with my script. I have a files named in this format... (13 Replies)
Discussion started by: xytiz
13 Replies

7. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

8. Shell Programming and Scripting

script for taking the stats from a file

i have file which contains data like this every day.i need to pull up a report for counting the 203's in that file for each subscriber id.there are around 200 subscriber id's. all ths Y's which i have written in the script are the subscriber id's.could some one give me an idea as to how do it in... (22 Replies)
Discussion started by: archana234
22 Replies

9. Shell Programming and Scripting

perl newbie

what is the difference in regexes using symbols like ^NAME$|^SELF$ and \bNAME\b \bSELF\b (1 Reply)
Discussion started by: Sgiri1
1 Replies

10. Shell Programming and Scripting

Perl Newbie - help!

Hi All, newbie-ish question here. I have this script: foreach $test (@num) { foreach $record (@neet) { if ($record =~ /$test/){ print "$record \n"; print $test; } } } For some reason, the $test variable doesn't seem to be carrying into the second "foreach" loop. Does anyone know why... (1 Reply)
Discussion started by: Khoomfire
1 Replies
Login or Register to Ask a Question