Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Log File Scripting

Status
Not open for further replies.

Daniel0122

Programmer
Jan 24, 2011
5
GB
Hello,

Let me tell you about my scenario.

Basically I have a machine that is taking in calls from an IVR (Interactive Voice Response-Unit) it rights the calls that have come in from the IVR to a log file with a time and date stamp.

The Type of calls being written are BDR,GDR,FLR (You can really call these what you want, it's not important)

We have approximately 65 IVR units and I want to extract via a clever script how many call types have been written each hour.

so for example

BDR Calls - 09:00 - 09:59 = 38
FLR Calls - 09:00 - 09:59 = 7
GDR Calls - 09:00 - 09:59 - 92

BDR Calls - 10:00 - 10:59 = 120
FLR Calls - 10:00 - 10:59 = 115
GDR Calls - 10:00 - 10:59 = 82

Get my drift? So again, in a nutshell the log file is writing all the calls it's receiving - it runs 24 hours a day and I need to write something to extract how many calls were received of each type in each 1 hour period?

Hope you can help and many thanks in advance.
 
You'll need to supply some examples of the log file(s).

The top guys on this forum are excellent, but you need to provide good information and show a willingness to try to learn as you go.

For starters, you can use "grep" as your pattern matching command, and "wc" to count how many lines match the pattern you are seeking.



"Proof that there is intelligent life in Oregon. Well, Life anyway.
 

:) The helpful but unhelpful reply - I was expecting this.

I can script, I'm too bad either - the only thing I haven't learned and having difficulty finding answers for on the net is how to do an analysis of a log file on an hour by hour basis.

Yes I can grep, Yes I can awk, yes I can output to another file and sort it.

It's just the little bit about extracting data on an hour by hour basis I'm struggling with :)

Thanks
Dan
 
Log file format:

01/24/11 | 17:59:42:883 | GDR | OK

Thanks again.
 
So, you can awk eh?

This should get you going:

awk array
array index could be [tt][ $1 "-" substr($3,1,2) "-" $5 ][/tt]
and then just start counting
in the END clause of your awk program print out the array

and remember - GIYF

HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top