Sponsored Content
Top Forums Shell Programming and Scripting counting word xx referred to a time period, like minute or hour Post 302507964 by maluca68 on Friday 25th of March 2011 09:28:08 AM
Old 03-25-2011
counting word xx referred to a time period, like minute or hour

Hello,
I try to insert a post because I've got a trouble to perform a unix job. But I didn't found which steps (procedure) I should follow. Could you help me?

I got a log by my Application box, like following:

Code:
gbosmam037:test >view Log_Server.csv 
    MSG_ID|TRANS_ID|CLIENT_ID|REQUEST_TYPE|SPCLASS|SPSERVICE|ID_TEMPLATE|REQUEST_DATE|ANSWER_DATE
  98891142418714|98891142418714|108114|MT|000|C06 SintaxERR||2011-02-20 00:00:00,003|2011-02-20 00:00:00,033
  98881142418715|98881142418715|108114|MT|000|C06 SintaxERR||2011-02-20 00:00:00,159|2011-02-20 00:00:00,163
  98891142418716|98891142418716|108114|MT|075|Voting||2011-02-20 00:00:00,313|2011-02-20 00:00:00,317
  98881142418717|98881142418717|108114|MT|075|Voting||2011-02-20 00:00:00,439|2011-02-20 00:00:00,442
  98891142418718|98891142418718|108114|MT|075|Voting||2011-02-20 00:00:00,570|2011-02-20 00:00:00,583
  98881142418719|98881142418719|108114|MT|075|Voting||2011-02-20 00:00:00,699|2011-02-20 00:00:00,708
  98891142418720|98891142418720|108114|MT|075|Voting||2011-02-20 00:00:00,781|2011-02-20 00:00:00,785
  98881142418721|98881142418721|108114|MT|075|Voting||2011-02-20 00:00:00,910|2011-02-20 00:00:00,915
  98891142418722|98891142418722|108114|MT|075|Voting||2011-02-20 00:00:01,600|2011-02-20 00:00:01,607
  98881142418723|98881142418723|108114|MT|075|Voting||2011-02-20 00:00:01,732|2011-02-20 00:00:01,737
  98891142418724|98891142418724|108114|MT|075|Voting||2011-02-20 00:00:01,859|2011-02-20 00:00:01,863
  98881142418725|98881142418725|108114|MT|075|Voting||2011-02-20 00:00:01,995|2011-02-20 00:00:02,009
  98891142418726|98891142418726|108114|MT|075|Voting||2011-02-20 00:00:02,139|2011-02-20 00:00:02,145
  98881142418727|98881142418727|108114|MT|075|Voting||2011-02-20 00:00:02,270|2011-02-20 00:00:02,274
  98891142418728|98891142418728|108114|MT|075|Voting||2011-02-20 00:00:02,402|2011-02-20 00:00:02,407
  98881142418729|98881142418729|108114|MT|075|Voting||2011-02-20 00:00:02,529|2011-02-20 00:00:02,533
  98881142418730|98881142418730|108083|MT|000|C06 SintaxERR||2011-02-20 00:00:02,660|2011-02-20 00:00:02,665
  98891142418731|98891142418731|108114|MT|075|Voting||2011-02-20 00:00:02,670|2011-02-20 00:00:02,674
  98881142418732|98881142418732|108114|MT|075|Voting||2011-02-20 00:00:02,831|2011-02-20 00:00:02,835
  98891142418733|98891142418733|108083|MT|000|C06 SintaxERR||2011-02-20 00:00:02,833|2011-02-20 00:00:02,837
  98881142418734|98881142418734|108083|MT|000|C06 SintaxERR||2011-02-20 00:00:02,962|2011-02-20 00:00:02,969
  98891142418735|98891142418735|108114|MT|075|Voting||2011-02-20 00:00:02,965|2011-02-20 00:00:02,970
  ....

I tried to write a unix script to: counting how many time log files contain the same 'word' referred on a time period (time period can be like minute or hour).
The word could be '108114' and the program could permit to insert the time-period search parameter.
Thanks,

Luca
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 03-25-2011 at 12:23 PM.. Reason: code tags, please!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

record wc -l over 24 hour period

I need to keep track of this output echo "dis chs(*)" | runmqsc | grep RUNNING | wc -l I need to record that count once an hour 24 hours a day and write to a file with the date and time it was run. Any idea on how to do this. (5 Replies)
Discussion started by: csaunders
5 Replies

2. Shell Programming and Scripting

Time difference in Minute in UNIX

is there any ways to get the time difference between 2 dates in UNIX? for example, For below date the outut should come 22 minutes startdate enddate ========= ======= 06/17/2008 13:25 06/17/2008 13:47 For, below date, the output should come 1462 minutes ... (5 Replies)
Discussion started by: Amit.Sagpariya
5 Replies

3. Shell Programming and Scripting

Counting average data per hour

Hi i have log like this : Actually i will process the data become Anybody can help me ? (6 Replies)
Discussion started by: justbow
6 Replies

4. Shell Programming and Scripting

Crontab for every minute or every hour

How to set crontab for every minute or every hour (1 Reply)
Discussion started by: kaushik02018
1 Replies

5. Shell Programming and Scripting

Trim the sentence containing colon and period to extract a word in between

Hello All , i am a newbie in korn shell scripting trying to trim a sentence that is parsed into a variable . The format of the sentence has three words that are separated from other by a " : " colon and "." period . Format of the sentence looks like ... (5 Replies)
Discussion started by: venu
5 Replies

6. UNIX for Dummies Questions & Answers

How to add an hour or a minute to a time?

Hi, The timestamp is June 06 2011 11:05AM i need 2 results. first, an hour added to it, June 06 2011 12:05AM second, a minute added to it, June 06 2011 11:06AM How can i do this? Also when it reaches 12:59, it needs to start from 1 again without giving the output as 13:00. it... (17 Replies)
Discussion started by: irudayaraj
17 Replies

7. Shell Programming and Scripting

return counting per hour percentage

We have a monitoring process for a load in unix box, during this process we are writing logs statements for each record, and during this process we are showing the counts per hour. Here is that how we are following log files statements: (just two lines printed here), these statements logged at... (1 Reply)
Discussion started by: skkuchipudi
1 Replies

8. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

9. Shell Programming and Scripting

[solved] Awk/shell question to parse hour minute from text

Hi, I have a quick question on parsing the hour/minute and value from a text file and remove the seconds portion. For example in the below text file: 20:26:01 95.83 20:27:01 96.06 20:28:01 95.99 20:29:01 7.11 20:30:01 5.16 20:31:01 8.27 20:32:02 9.79 20:33:01 11.27 20:34:01 7.83... (2 Replies)
Discussion started by: satishrao
2 Replies
All times are GMT -4. The time now is 03:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy