Sponsored Content
Top Forums Shell Programming and Scripting Extract all ERROR's on LOG File Post 302559153 by Aswex on Monday 26th of September 2011 10:22:18 AM
Old 09-26-2011
Extract all ERROR's on LOG File

Hello,

As I am still in trouble to easly extract all error's by date in log file, I am deply requesting your help ...

Here is an example of one error (the log file may contain a huge amont of error's, I must be able to extract all error for a day in parameter):

Code:
***** L1 FILE TEX_SAP4_ITD2_E_MU20060518004324 - CPU TIME 2010-06-09T09:54:53
GMT_PRODUCT_CREATION_TIME = 2010-06-09T09:54:53
Execution OK
***** L1 FILE TEX_SAP4_ITD2_E_MU20060518004335 - CPU TIME 2010-06-09T09:54:59
 Input file is empty or contains only comments
ERROR : Cannot open attitude binary file ATNV_FDLVMA_DAP051109051109_00302.BIN with initAttJ2000 : ier= 1
GMT_PRODUCT_CREATION_TIME = 2010-06-09T09:54:59
Bad Execution. See /DATA/SATURN1//DATA/SPD_TEX_FILES/LOGS/TEX.log or /DATA/SATURN1//DATA/SPD_TEX_FILES/TMP//JDB_SPD_NPD_20051109_20060831_20100609074221_stat_specc.
5+2010/06/09-09:55:03+produire_fichier_SPD.ksh+Erreur lors du lancement de l'executable : /DATA/SATURN1//SOFT/SPD_TEX/SPD_L1/bin//generer_SPD_ITD2.exe
***** L1 FILE TEX_SAP4_ITD2_E_MU20060518112848 - CPU TIME 2010-06-09T09:55:03
GMT_PRODUCT_CREATION_TIME = 2010-06-09T09:55:03
Execution OK

As if I use grep I can only see the line with error, I need help for a command line that will extract by DATE all error found like this :

Code:
***** L1 FILE TEX_SAP4_ITD2_E_MU20060518004335 - CPU TIME 2010-06-09T09:54:59
 Input file is empty or contains only comments
ERROR : Cannot open attitude binary file ATNV_FDLVMA_DAP051109051109_00302.BIN with initAttJ2000 : ier= 1
GMT_PRODUCT_CREATION_TIME = 2010-06-09T09:54:59
Bad Execution. See /DATA/SATURN1//DATA/SPD_TEX_FILES/LOGS/TEX.log or /DATA/SATURN1//DATA/SPD_TEX_FILES/TMP//JDB_SPD_NPD_20051109_20060831_20100609074221_stat_specc.
5+2010/06/09-09:55:03+produire_fichier_SPD.ksh+Erreur lors du lancement de l'executable : /DATA/SATURN1//SOFT/SPD_TEX/SPD_L1/bin//generer_SPD_ITD2.exe

I need to be able to filter all error's by date like :

grep 2010-06-09 | command ....


Thanks in advanced for your help .. I am completly lost on this. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract a portion of log file

hello, I want to grep the log file according to time and get the portion of log from one particular time to other. I can grep for individual lines by time but how should I print lines continuously from given start time till end till given end time. Appreciate your ideas, Thanks chandra (8 Replies)
Discussion started by: chandra004
8 Replies

2. Shell Programming and Scripting

Extract values from log file

I would like to write a shell script that will parse through a file similar to the sample below. The data in the file is redirected from rsync into a log file. I would like to call a shell script to parse through and pick out the number beside the percent sign inside the parentheses in the last... (5 Replies)
Discussion started by: wdympcf
5 Replies

3. Shell Programming and Scripting

How to extract certain part of log file?

Hi there, I'm having some problem with UNIX scripting (ksh), perhaps somebody can help me out? For example: ------------ Sample content of my log file (text file): -------------------------------------- File1: .... info_1 ... info_2 ... info_3 ... File2: .... info_1 ... info_2 ...... (10 Replies)
Discussion started by: superHonda123
10 Replies

4. Shell Programming and Scripting

Script extract from log file

Hi i new to scripting and am trying to create a script to pull my current of logs from /var/logs/secure and name it securelog-Month-Day-Hour.txt example: grep 'Mar 5 11' /var/logs/secure > /home/(user)/Documents/Logs/mylog-02-1-11 How do i set the targeted strings to be the current... (2 Replies)
Discussion started by: M47H415
2 Replies

5. Shell Programming and Scripting

Extract various information from a log file

Hye ShamRock If you can help me with this difficult task for me then it will save my day Logs : ================================================================================================================== ... (4 Replies)
Discussion started by: SilvesterJ
4 Replies

6. Shell Programming and Scripting

Extract IP Address from Log File

I have a log file with several IP addresses in it:- 2012-12-06 16:05:05,885 NOTICE **SNMP** Alarm was created: (LicenseClientRejected) Client Remote Peer /125.111.64.125:2573 was Rejected Property=/125.111.64.125:2573, Client Remote Peer /125.111.64.125:2573 was Rejected **SNMP**.... (5 Replies)
Discussion started by: BHM
5 Replies

7. Shell Programming and Scripting

Need to extract a String from log file

Hi i am having a logfile which contain lot of entires, but i need extract a word after if i found a line that contains a particular string as "ENROLLMENT_EXCEPTION - Exception". please help me in getting a script to do this. Regards C. Suresh (5 Replies)
Discussion started by: sumeeva1907
5 Replies

8. UNIX for Dummies Questions & Answers

Extract Numbers from a log file

Hi, I am trying to grep/extract the number list from this log file, can I get some help on this. I can grep the word 'href' to see the numbers, but it is resulting with the complete line. Content of my file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head>... (4 Replies)
Discussion started by: Sajjadmehdi
4 Replies

9. Shell Programming and Scripting

How to extract start/end times from log file to CSV file?

Hi, I have a log file (log.txt) that which contains lines of date/time. I need to create a script to extract a CSV file (out.csv) that gets all the sequential times (with only 1 minute difference) together by stating the start time and end time of this period. Sample log file (log.txt) ... (7 Replies)
Discussion started by: Mr.Zizo
7 Replies

10. Shell Programming and Scripting

Extract data from a log file and put it in a file

Hi, I would like to seek your help for a script that will extract data from log file and put it in a file. Sample log file 2018-10-23 12:33:21 AI ERROR -- tpid: SAMPLE_TH account: 123456789 aiSessionNumber: 660640464 mapName: xxx to yyy errorDesc: Translation Error:ErrorNumber : 993 ... (2 Replies)
Discussion started by: neverwinter112
2 Replies
DOVEADM-LOG(1)							      Dovecot							    DOVEADM-LOG(1)

NAME
doveadm-log - Locate, test or reopen Dovecot's log files SYNOPSIS
doveadm [-Dv] log errors doveadm [-Dv] log find [directory] doveadm [-Dv] log reopen doveadm [-Dv] log test DESCRIPTION
The doveadm log commands are used to locate and reopen the log files of dovecot(1). It's also possible to test the configured targets of the *log_path settings. OPTIONS
Global doveadm(1) options: -D Enables verbosity and debug messages. -v Enables verbosity, including progress counter. COMMANDS
log errors doveadm log errors The log errors command is used to show the last - up to 1,000 - errors and warnings. If no output is generated, no errors have occurred since the last start. log find doveadm log find [directory] The log find command is used to show the location of the log files, to which dovecot(1) sends its log messages. If dovecot(1) logs its messages through syslogd(8) and doveadm(1) could not find any log files, you can specify the directory where your syslogd writes its log files. log reopen doveadm log reopen This command causes doveadm to reopen all log files, configured in the log_path, info_log_path and debug_log_path settings. These settings are configured in /etc/dovecot/conf.d/10-logging.conf. This is for example useful after manually rotating the log files. log test doveadm log test This command causes doveadm to write the message "This is Dovecot's priority log (timestamp)" to the configured log files. The used prior- ities are: debug, info, warning, error and fatal. EXAMPLE
This example shows how to locate the log files used by dovecot(1). doveadm log find Looking for log files from /var/log Debug: /var/log/dovecot.debug Info: /var/log/mail.log Warning: /var/log/mail.log Error: /var/log/mail.log Fatal: /var/log/mail.log REPORTING BUGS
Report bugs, including doveconf -n output, to the Dovecot Mailing List <dovecot@dovecot.org>. Information about reporting bugs is avail- able at: http://dovecot.org/bugreport.html SEE ALSO
doveadm(1) Dovecot v2.1 2012-02-22 DOVEADM-LOG(1)
All times are GMT -4. The time now is 10:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy