Hi, please help me to collect the entire log files between two time stamp.
for example,
I am looking script to collect the entire log between "2015-03-27 15:59" to "2015-03-27 16:15" in the below sample log file.
OS : RHEL 6.3
Date/Time : 24 hours format, the time is printing each log file but the date won't print all the log entry. Also time printing starting and middle (after the date)
Most log files have dates and times in monotonically non-decreasing order. Yours does not.
Most log files have timestamps in a consistent format. Yours does not.
Assuming that comma and space are field delimiters, is the date field on lines that contain dates always field 9?
Since timestamps aren't in order, how are we supposed to guess what date should apply to a line that does not have a date?
What is supposed to happen to log file lines that do not have a date or timestamp?
What output are you hoping to produce for the sample input you provided?
Thank you for responding.
In my previous post, I asked four questions. You answered one of them.
If you choose not to answer the other three questions I asked in my previous post, I can't determine how to guess correctly at what you should be done.
And, for the record, greping won't work for what you're asking for. The grep utility uses regular expressions to look for certain patterns. It is not suitable for performing alphanumeric range comparisons.
Assuming that comma and space are field delimiters, is the date field on lines that contain dates always field 9?
Ans: The date's are printing always the same field.Sorry, is that 9 or 10?
Since timestamps aren't in order, how are we supposed to guess what date should apply to a line that does not have a date?
Ans: It seems like, the data is printing the first paragraph and time alone is printing the remaining lines so I can get all middle lines which doesn't have date if I collect the logs between two date and time.
What is supposed to happen to log file lines that do not have a date or timestamp?
Ans: Those are printing between two different date (or) timestamp. If that possible to collect all the logs lines between two different date or timestamp? For example, past 20 mins logs.
What output are you hoping to produce for the sample input you provided?
Ans:
Also, can you please explain me the below script.
What has this
to do with your problem resp. the sample given?
Be aware that mktime is not available in all awk versions.
You could use this snippet for your problem if you use [ ,] for the field separator and apply it to $10 instead of $1. It would not print the last line in your desired output, though.
Hi,
I need help on syslog-ng on RHEL 7.2. It is working as expected.
As per configuration, it is supposed to create authlog, messages and xymessages daily in respective folder of date. But I can see only messages file and that is also not updating well.
# ps -ef | grep -i syslog
root 22954... (1 Reply)
I've installed cygwin_openssh on Windows 2012 R2 and it's working great. My issue is when a file is uploaded say from a different timezone, when it is uploaded, it doesnt pick up the sftp servers time.. Is there a way to fix that?
i.e. When someone in PST uploads a file to this server in EST,... (0 Replies)
Hi,
I have been working on the error Log script, where errors are pulled from server.
I need to pull the data of the error logs between two dates & time, for example :
22/12/2014 20:00:00
22/12/2014 22:00:00
Whatever error have came during this duration.
Now the question is the record... (6 Replies)
Hi Gents.
Please can you help me to solve a problem.
I have a long list of files, which I need to change the time stamp.
-r--r--r-- 1 geo2 geovect 47096216 Feb 8 10:40 00000009.segd
-r--r--r-- 1 geo2 geovect 47096216 Feb 8 10:40 00000010.segd
-r--r--r-- 1 geo2 geovect 47096216 Feb ... (11 Replies)
I'm looking for a way to have the "date" command output the date in a specific format.
I'm not familiar with the different ways to use the date command at all. i read up on it, but i dont get how to manipulate it.
i know that i can get the date format to give me a format like:
2012-10-13... (6 Replies)
Hi Friends,
I have 2 varaibles which contain
START=`date '+ %m/%d/%y %H:%M:%S'`
END=`date '+ %m/%d/%y %H:%M:%S'`
i want the time difference between the two variables in Seconds.
Plz help. (2 Replies)
Hi, i am a general user of linux but we work mostly on windows next i am moving full time on linux.
here is my question:
We have product which consist or several subsystem each subsystem has one module to create logs file dump. and i am going to write that support dump tool.
we need to... (3 Replies)
Hello All,
I'm generating timestamps (file creation timestamps) for all the files in a directory. I need to compare all the timestamps.
for example if i have 4 files and their timestamps are 20091125114556,
20091125114556,20091125114556,20091125114556 respectively.
I need to differentiate... (9 Replies)
Hello All,
I'm generating timestamps (file creation timestamps) for all the files in a directory. I need to compare all the timestamps.
for example if i have 4 files and their timestamps are 20091125114556,
20091125114556,20091125114556,20091125114556 respectively.
I need to differentiate... (1 Reply)