02-08-2008
need help ksh scripting for log file
I have log files that contain data generated every 5 minutes.
I want to extract data from the log files to another log file
In each 5 minute series
<log4j:event logger="VistaMonitor" timestamp="1200688175425" time="Fri Jan 18 15:29:35 EST 2008"
Generated twice (I only to get the date once)
Further in the log file I need to extract from this line:
JMS: IntegrationFrameworkJMSServer.InboundQueue: 1,1,13479,13514,1,81700
I need the third value '13479' and last value '81700'
The script I was successful in putting together a script to tail the data but I want to extract the data one line per 5 min period
from a complete file.
Any suggestions would be helpful
Current Script:
#!/bin/ksh
MONITORLOG="/opt/bea/weblogic81/config/WebCTDomain/logs/webct_monitor.log"
LOG="/export/home/oracle/lmbct.log"
#DATE=`date +%m/%d/%Y-%H:%M`
WAIT=`grep " JMS: IntegrationFrameworkJMSServer.InboundQueue: " ${MONITORLOG} |t
ail -1 |cut -d',' -f 6`
DATE=`date +%m/%d/%Y-%H:%M`
HOSTNAME=`hostname`
echo "${DATE},${HOSTNAME},${WAIT}" >> ${LOG}
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am writing this script in ksh (consisting of various functions such as -> read_file, write_file, pront_output and initialise) which basically process input files based on the parameters it contains.
My task now is to write any error conditions trapped by any of the function above to... (2 Replies)
Discussion started by: sidamin810
2 Replies
2. Shell Programming and Scripting
how can i write content of a variable to a file?
how can i read standard output into a variable? (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies
3. Shell Programming and Scripting
Hi,
Please provide your inputs..
Thanks in Advance,
Mansa (1 Reply)
Discussion started by: mansa
1 Replies
4. Shell Programming and Scripting
I have a log file like..
IMPORT from /dataserver/ftp/bits/mdr/mdr_data_discon.dat OF DEL .....
Number of rows read = 1376
Number of rows skipped = 0
Number of rows inserted = 1374
Number of rows updated = 0
Number of rows rejected = 2
Number of rows... (4 Replies)
Discussion started by: ramse8pc
4 Replies
5. Shell Programming and Scripting
Hi,
How to add trailer record at the end of the flat file in the unix ksh shell scripting
can you please let me know the procedure
Regards
Srikanth (3 Replies)
Discussion started by: srikanth_sagi
3 Replies
6. Shell Programming and Scripting
Hi,
I want to create a log file for a running ksh , and the log file absolute path I want to give in ksh itself.
To elaborate this - Say I have a ksh - timer.ksh and I want to create a log timer_log.log when I run, to trace this. I am aware of the fact that this can be done using redirection... (4 Replies)
Discussion started by: vinay4889
4 Replies
7. Shell Programming and Scripting
Hi. I am a new Unix admin and I've been tasked to write a ksh script that copies my .profile into my /home directory on all servers. I'm new to this and having a difficult time scripting it. Any ideas? (6 Replies)
Discussion started by: david_tech
6 Replies
8. Shell Programming and Scripting
I have a log file as given below
012/01/21 10:29:02 (111111) Processing Job '23_369468343464564'
2012/01/21 10:29:02 (111111)
Making Job '23_369468343464564.0'...
2012/01/21 10:29:04 (111111)
Jobnumber '23_369468343464564' was successful
2012/01/21 10:29:04 ... (12 Replies)
Discussion started by: rpm120
12 Replies
9. Shell Programming and Scripting
Hello Team-
we would like to implement an approach which has to write the log file simultaneously
when .sql file is executing by Unix process. At present,it is writing the log file
once the process is completed. I've tested the current process with the below
approaches and none of them... (1 Reply)
Discussion started by: Hima_B
1 Replies
10. Shell Programming and Scripting
Hello,
I currently have very little experience with Shell scripting and trying to create a script for the purpose of collecting the size of a couple sizes on 4 different Hosts. The Idea is to collected the information from the files in which the script is kicked off on, store the values into... (17 Replies)
Discussion started by: Abstract3000
17 Replies
LEARN ABOUT HPUX
strclean
strclean(1M) strclean(1M)
NAME
strclean - remove outdated STREAMS error log files
SYNOPSIS
logdir] age]
DESCRIPTION
cleans the STREAMS error logger directory of log files mm-dd) that contain error messages sent by the STREAMS log driver, strlog(7). If
the option is not used to specify another directory, removes error log files in the directory. If the option is not used to specify
another age, removes error log files that have not been modified in three days.
Options
recognizes the following options and command-line arguments:
Specifies a directory for the location of the
STREAMS error log files to be removed if this is not the default directory
Specifies a maximum age in days for the
STREAMS error log files if this not the default age of 3. The value of age must be an integer greater than or less than 3.
EXAMPLES
Remove day-old error log files from a directory called
FILES
One or more error log file or files on which operates. The mm-dd in the filename indicates the month and day of the messages con-
tained in the file.
NLS catalog for
SEE ALSO
strerr(1M), strlog(7).
strclean(1M)