Write an automated shell program(s) that can create, monitor the log files and report the issues for

Hi ,

Please help me getting this done.

Write an automated shell program(s) that can create, monitor the log files and report the issues for matching pattern.

(i) Conditions for creating log files.
Log file is created with date (example 2010_03_27.log). If the log file size is 10 Mb for a particular day then automatically the log file will be rotated with sequence number (example, on a particular day if the log file crossed 10 MB while the data insert ii n progress, the program should rotate the log file with a sequence number YYYY_MM_DD_sequence_number.log)

(ii) Condition for reading the data for pattern matching
The report with matched pattern should be reported at the earliest for effective business decision. The data that is already processed shouldn't be considered for analysis for pattern matching.

Example file with sample data and mattching patterns

file01.log

2010-03-18 24:50:50:500: WorkingThread-1:User_Authorization_Failed session-id-10002033
2010-03-18 24:50:50:550: WorkingThread-1:User_Authentication_Failed session-id-10002033
2010-03-18 24:52:50:500: WorkingThread-1:User_Access_Locked session-id-10002033

Analyze the log for following pattern's:

  1. Report number of 'User_Authorization_Failed'
  2. Report number of 'User_Authentication_Failed'
  3. Report number of 'User_Access_Locked'

Thanks
itian2010

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.