I've tested this on my linux platform; it works fine. What system /awk version do you have? You may need to explicitly invoke e.g. nawk...
Hi RudiC,
While trying to run your code on OS/X, I got the error:
I reformatted your script and changed line 8 to the following:
That produces the output files:
b.out:
and c.out:
I would have thought that the IP addresses that appeared in the input file only once and the IP addresses where all of the timestamps of consecutive entries for that IP address were each more than 4 seconds apart should appear in b.out rather than c.out. But, I agree that the requirements are not clear.
Note also that your calculation of Delta assumes 24 hour time notation in field 4. But with field 5 being "AM" in all of the sample input, I believe the timestamps are 12 hour time notation using fields 4 and 5.
Hi Mr_47,
I am still not clear as to what output you want. Exactly what output do you want in b.out and c.out if a.out contains the following:
This User Gave Thanks to Don Cragun For This Post:
Hey Guys,
i am new into shell programming and i have to do one script which have to record all the commands entered by a specific user.
Example of that, i have a system running on unix, several users are using this system, i have to create like a databse which will record every user entered that... (5 Replies)
Hy, I have a question
I have a directory in a unix server,
Some of my files have a diffrent access time,
from the time i accessed them last,
I think some one has copied it,it's not an important file,but none the less,it is my file,It mistakenly had a 777 permission( yes ,I know it is a noob's... (1 Reply)
Hi,
I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows:
""""""""""""""""""""""""""... (3 Replies)
Hi,
I urgently need some help how to extract distinct entries from a Log file.
The Log File may have same error occuring many times so how do i count the occurance of an error in file and also extract out distinct errors in a file.
Eg:-
I have a file name A.log
it contains entries as below:-... (5 Replies)
I have hundreds of files to process. In each file
I need to look for a pattern then
extract value(s) from next line and then
search for value(s) selected from point (2) in the same file at a specific position.
HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V
TITLE CYTOCHROME... (7 Replies)
Hi Experts,
I am new to shell.How to extract logs (Web,APP,Database) using shell in performance testing?
Need for webserver logs,app server logs and d/b logs code.
Thanks in advance
Sree (3 Replies)
I want to extract the logs between the current time stamp and 15 minutes before and sent an email to the people configured. I developed the below script but it's not working properly; can someone help me?? I have a log file containing this pattern:
Constructor QuartzJob
... (3 Replies)
Appreciate help for the below issue.
Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt..............
1)if logs exist it should move the logs with extention... (1 Reply)