Get parametar values from log files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Get parametar values from log files
# 1  
Old 03-21-2012
Get parametar values from log files

Hi,

I need help to write generic shell script for 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 like Table name, Output Rows, Affected Rows, Applied Rows, Rejected Rows. Here the values will be one table, sometimes many different tables.
3. Last line will need to capture time which is end time of the job.
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 so i can insert them into the table.
Values need for:
Starttime
job name
sub job name
Location
Table name,
Output Rows,
Affected Rows,
Applied Rows,
Rejected Rows.

I need help to write this shell script as this is the first time i am working on unix. Please help to write scripts.

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].
# 2  
Old 03-21-2012
Needing help with, and expecting delivery of, a script are not the same things.

What have you done so far?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Replace Stub Values In One Group Of Files With Actual Values From Another Group Of Files

I have two directories of files (new-config-files and old-config-files): new-config-files/this-db/config.inc.php new-config-files/that-db/config.inc.php new-config-files/old-db/config.inc.php new-config-files/new-db/config.inc.php new-config-files/random-database/config.inc.php etc. ... (4 Replies)
Discussion started by: spacegoose
4 Replies

2. Shell Programming and Scripting

Redirecting log files to null writing junk into log files

Redirecting log files to null writing junk into log files. i have log files which created from below command exec <processname> >$logfile but when it reaches some size i am redirecting to null while process is running like >$logfile manually but after that it writes some junk into... (7 Replies)
Discussion started by: greenworld123
7 Replies

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

4. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 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

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... (0 Replies)
Discussion started by: siria
0 Replies

7. Shell Programming and Scripting

Cat Values from Several files if it meets criteria for column values

I have results from some statistical analyses. The format of the results are as given below: I want to select lines that have a p-value (last column) less than 0.05 from all the results files (*.results) and cat to a new results file. It would be very nice if a new column is added that tells... (2 Replies)
Discussion started by: genehunter
2 Replies

8. Shell Programming and Scripting

How can view log messages between two time frame from /var/log/message or any type of log files

How can view log messages between two time frame from /var/log/message or any type of log files. when logfiles are very big and especially many messages with in few minutes, I would like to display log messages between 5 minute interval. Could you pls give me the command? (1 Reply)
Discussion started by: johnveslin
1 Replies

9. Shell Programming and Scripting

different files for different values

Hi I am writng a script to spool some account nos information to .txt file but wants that information for each and every account no to be written in a different .txt file with account no as part of the file name of its associated file. Thanks (32 Replies)
Discussion started by: ss_ss
32 Replies

10. Shell Programming and Scripting

how to sum values from 2 different files?

Hi I am trying to add count values from two different files into one file. Could any body please suggest me best command to do this? My problem was as follows: a.txt b.txt c.txt 10 20 30(needed) i tried cat a.txt b.txt > c.txt (its not adding the values) Thanks in advance.. Praveen (8 Replies)
Discussion started by: npk2210
8 Replies
Login or Register to Ask a Question