Get some values from log file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Get some values from log file
# 1  
Old 03-21-2012
Get some values from log file

Hi
I need some help to write generic shell script for the below log file
Requirement : Get some values from this log file and load them into one stats tables
1. Initializing session time (it will be available in first line) it is start time of the the job.
2. Target Load Summary variables like Table name, Output Rows, Affected Rows, Applied Rows, Rejected Rows. These values need to be loaded one table, Here sometimes Load Summary will be one time or many times as it depends on the job.
3. Endtime of the job it will be available in last line.
4. I want to pass 3 variables to this script
a. job name
b. sub jobname
3. location where the log file stores.
finally i want few parametars like below mentioned so i can insert them into table.
Values need for:
Starttime
job name
sub job name
Location
Table name,
Output Rows,
Affected Rows,
Applied Rows,
Rejected Rows.

-----
log file
------

DIRECTOR> TM_6014 Initializing session [s_LoadPaymethod] at [Tue Mar 20 11:02:00 2012].
ANAGER> PETL_24005 Starting post-session tasks. : (Tue Mar 20 11:02:05 2012)
MANAGER> PETL_24029 Post-session task completed successfully. : (Tue Mar 20 11:02:05 2012)
MAPPING> TM_6018 The session completed with [0] row transformation errors.
MANAGER> TE_7216 Deleting cache files [/devl/infa/v9/Cache/PMJNR15328_10_0_387389.dat] for transformation [JNRTRANS].
MANAGER> TE_7216 Deleting cache files [/devl/infa/v9/Cache/PMJNR15328_10_0_387389.idx] for transformation [JNRTRANS].
MANAGER> PETL_24002 Parallel Pipeline Engine finished.
DIRECTOR> PETL_24012 Session run completed successfully.
DIRECTOR> TM_6022
SESSION LOAD SUMMARY
================================================
DIRECTOR> TM_6252 Source Load Summary.
DIRECTOR> CMN_1740 Table: [SQ_Shortcut_to_SBL_PAY_METHODS_VW] (Instance Name: [SQ_Shortcut_to_SBL_PAY_METHODS_VW])
Output Rows [33341], Affected Rows [33341], Applied Rows [33341], Rejected Rows [0]
DIRECTOR> CMN_1740 Table: [S_ORG_EXT_BU_C] (Instance Name: [S_ORG_EXT_BU_C])
Output Rows [28464], Affected Rows [28464], Applied Rows [28464], Rejected Rows [0]
DIRECTOR> TM_6253 Target Load Summary.
DIRECTOR> CMN_1740 Table: [R_ORG_EXT_XM] (Instance Name: [Shortcut_to_R_ORG_EXT_XM])
Output Rows [33300], Affected Rows [33300], Applied Rows [33300], Rejected Rows [0]
DIRECTOR> CMN_1740 Table: [R_ORG_EXT_XM1] (Instance Name: [Shortcut_to_R_ORG_EXT_XM])
Output Rows [31000], Affected Rows [31000], Applied Rows [31000], Rejected Rows [0]
DIRECTOR> TM_6023
===================================================
DIRECTOR> TM_6020 Session [s_LoadPaymethod] completed at [Tue Mar 20 11:02:05 2012].

Highly appreciated your help.
Thanks,

---------- Post updated at 11:44 AM ---------- Previous update was at 10:03 AM ----------

Hi,

Please let me know incase of any further details are needed for this request.

Thanks,

Last edited by Scott; 03-21-2012 at 02:05 PM.. Reason: Double post, bumped post and probably homework too. Closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Taking key values from one file and extracting values from another file

Hi, I have two files with values in both. File1: cat 2 3 dog 4 5 elephant 6 7 camel 2 3 File2: ----+--gkf;ajf= ---+---- +----- cat -------=----+ 3 | 4 ----- dog ------++-- 5 | 9 ----++-- elephant | 5 | 7 ---++ camel ------ ++++_---- || 8 | 9 I want the final file as: cat 4... (1 Reply)
Discussion started by: npatwardhan
1 Replies

2. UNIX for Dummies Questions & Answers

Read in Multiple log files and output selected variables and values to cvs file

I have several problems with my problems: I hope you can help me. 1) the If else statement I am getting an error message. My syntax must be incorrect because the entire statement is throwing an error. For example in filew.log if these items don't exist Memsize, SASFoundation and also if... (0 Replies)
Discussion started by: dellanicholson
0 Replies

3. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies

4. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

5. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

6. Shell Programming and Scripting

remove values of a file one by one from 2nd file and then print the remaining values of 2nd file

Hi all, I have 2 files. One contains only 1 column and other one contains 2 columns, let say 1_col.txt and 2_col.txt respectively. Here, I will try to explain with an example. Input files : 1_col.txt 2_col.txt a a b x a c p ... (5 Replies)
Discussion started by: AshwaniSharma09
5 Replies

7. Shell Programming and Scripting

Replacing values in a file based on values in another file

Hi I have 2 files:- 1. List of files which consists of names of some output files. 2. A delimited file; delimted by "|" I want to replace the value of the $23 (23rd column) in the delimited file with name in the first file. It is always position to position. Meaning first row of the first... (5 Replies)
Discussion started by: pparthiv
5 Replies

8. Shell Programming and Scripting

Read the error and its values from log file

Using informatica tool am loding records from source DB to target DB. While loading some records getting rejected due to some reason. Informatica will capture those rejected records in session log file.now the session log ll be available with rejected records and the reason for the rejection as... (1 Reply)
Discussion started by: Gopal_Engg
1 Replies

9. 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

10. Shell Programming and Scripting

Null values after emptying a log file

Hi, I have a log file which is constantly being written to by some process. I need to clear that log file on a daily basis. The problem is that when I issue this command: echo "" > logfile.log the file gets filled with nulls thus increasing the size of the file. Is there a way to... (2 Replies)
Discussion started by: kasie4life
2 Replies
Login or Register to Ask a Question