Home » Infrastructure » Unix » Shell Script (Unix (Ubuntu 10.0.4))
Shell Script [message #471855] Tue, 17 August 2010 11:03 Go to previous message
Ricky_1362002
Messages: 111
Registered: February 2009
Senior Member
Hi everyone,

I need to write an automated shell program 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'

Thank you,
Munna
 
Read Message
Read Message
Read Message
Previous Topic: Performance issue in reading file in unix
Next Topic: Automation script
Goto Forum:
  


Current Time: Fri Apr 19 03:37:04 CDT 2024