A little scripting help..
Hello all, been gathering a lot of info from here for the past couple of years, its been very invaluable.
My problem. We have an application that generates log files, on multiple machines, that I need to monitor on a daily basis. These machines also do not have access to the internet, so no email. The log files roll over to new ones when they reach a certain size, and have a time stamp of when they were created, but will have multiple days inside it. I need to monitor the last 24 hours for certain strings (ERROR and Exception). I figured out how multiple ways to pull these out and place them into another file, but I am having a problem just getting the last 24 hours.. Here is what I am using, which was taken from the internet from a couple different places and modified to fit what I need. Code:
#!/bin/bash Code:
2012-06-06 17:30:04,675 INFO [org.springframework.integration.handler.LoggingHandler] - <JobExecution: id=15137, startTime=Wed Jun 06 17:30:04 EDT 2012, endTime=Wed Jun 06 17:30:04 EDT 2012, lastUpdated=Wed Jun 06 17:30:04 EDT 2012, status=COMPLETED, exitStatus=exitCode=COMPLETED;exitDescription=, job=[JobInstance: id=14931, JobParameters=[{INPUT_FILE_NAME=REVERSE_DRAFT5_FILE_2012-06-06-17-30-00, input.file.name=REVERSE_DRAFT5_FILE_2012-06-06-17-30-00}], Job=[reverseDraft5MessageProcessingJob]]> |
Seeing as you are familiar with the data cmd, use that to generate yesterday's date in the matching format to the log file, and then grep that eg (simple example)
Code:
x@x> cat t.t You may find these useful http://rute.2038bug.com/index.html.gz http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ |
Quote:
Anyone else have some insight? |
All times are GMT -5. The time now is 03:07 AM. |