I need to grab each line between the lines "HEADER" and "TRAILER"
Each line contains two timestamps(Timestamp1) and (Timestamp2). I need to create two variables TIME_SUBSTRCT and TIME_ADD and
then recalculate the two timestamps using this logic:
START_TIME=Timestamp1 - ${TIME_SUBSTRACT}
END_TIME=Timestamp2 + ${TIME_ADD}
The final output should be each line with its new adjusted timestamps in place of the original timestamps.
eg. If timestamp1=09:17:00 and TIME_SUBSTRACT=10 , the START_TIME to be 09:07:00
If timestamp2=10:15:00 and TIME_ADD=15, the END_TIME to be 10:30:00
Expected output:
Few issues 1) Not getting correct start time and end time. 2) while replacing the older timestamp with new timestamp last part of columns 3 and 5 are missing(Ex:000,011). Tried using substr and its not working.
Thanks for your help in advance.
---------- Post updated 03-15-16 at 09:45 AM ---------- Previous update was 03-14-16 at 02:09 PM ----------
I'm getting correct start time and end time. I should be able to fix the code.
Hi RudiC,
after spending so much of time i am unable to understand the function used in code.
till here i can discern that you got date value in T as 02/10/2016 1013 and -10 in D
.Could you please explain how cmd is being calculated specially -d and min in -d\"" T D "min\"". And here | is operating as OR or passing value from cmd to getline. Why we need to close cmd, because close is used to close file but cmd holds some value here.
Yes, T is the time, and D is the delta. In awk, the | pipes the cmd command's result to getline. And, whatever the cmd is, it can and should be closed whenever the max open files is exceeded.
Why don't you print the cmd in the function just to see what's in there?
I am creating log monitoring script and stuck up to get the logs between two time stamp.
can you please help me to create the script to get the logs between two time stamp, for example, I need the complete logs between # Time: 150328 1:30:10 and # Time: 150328 19:10:57
OS : Cent OS 6.x... (8 Replies)
hi all
find /folder1 -mtime 1 >folder1
with the above command , I can get the output of all the files which are modified(within folders and sub folders of folder1) in the last 24 hours.
but the listed files output , does not contain the time stamp with it.
I request you to give... (4 Replies)
I have a log file which wrote time stamp like this
2013-02-11 00:46:40.389037
2013-02-12 11:46:40.197045
can any one help me to get the time stamp difference of these two line in seconds. (4 Replies)
On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help
here is what i get when i check for system date
infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date
Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Hi,
I want to convert normal time stamp to unix time stamp to a filename.
coz our ssytem will pick depends on unix timestamp format .
the filenames are as shown below fie names are stored in file say temp.txt.
MLFG2_cDomHTTPstats_SAB15-1_1318482447.dat... (2 Replies)
Here is two time I have:
Jul 12 16:02:01
Jul 13 01:02:01
and how can I do a simple match to get difference between two time which is 09:00:00
Thanks in advance. (3 Replies)
hi everyone
i am facing a strange problem here
suppose content of my file is
a=1,2,3
b=2,3,4
c=4,5,6
time=
now the problem is i want to add value in front of time variable
and the value should be i format only "HHMMSS"
so it should be like this
a=1,2,3
b=2,3,4
c=4,5,6... (3 Replies)
Hi all;
I'm relatively new to scripting,I am working on a monitoring script.....where in i have to write subroutine
which does the follows:
It will check the time stamp of a file ( Oracle remarchive files) and compare it with existing time.If the time difference happen to be more than 90... (6 Replies)
Hi,
I am having a script in which I am again calling a script, but before calling that script I need to perform a time check (say 1 - 2 am i.e. I would be able to call that script if time is between 1:00 am and 2:00 am) but this time stamp needs to be configurable.
can anybody suggest me how... (7 Replies)
Hi all,
I want to grep a file name with time stamp as 30 minutes how can i??.
Ex
I will getting outputs in a file every minutes
I want to grep it by a time intervals of 30 and show it . Any help will be great !
Thanks,
Arun. (1 Reply)