04-23-2009
Quote:
Originally Posted by
vgersh99
Well.... then you'd need to identify the 'desired' fields somehow differently.
is this possible?
awk -F '([[]|[|]|:|,)' 'NF>=11 && substr($0,$32,$4)=="name" {print $4, $9, $11}' myfile.log
because unfortunately there are two lines that have greater than 11 lines, so the script also prints out the other lines.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I'm deffently not a Unix specialist so be Gentel.
I need to parse a Log file that looks like that:
2006-06-12 01:00:00,463 ERROR {cleanLoggersFiles} General Error
comverse.compas.shared.exceptions.SystemParametersException: Error in reading parameter FileLocation
at... (4 Replies)
Discussion started by: tbirenzweig
4 Replies
2. Shell Programming and Scripting
I have a large log file, which I want to first use grep to get the specific lines then send it to awk to print out the specific column and if the result is zero, don't do anything. What I have so far is:
LOGDIR=/usr/local/oracle/Transcription/log
ERRDIR=/home/edixftp/errors
#I want to be... (3 Replies)
Discussion started by: mevasquez
3 Replies
3. UNIX for Dummies Questions & Answers
Hi Experts,
Im a new bee for scripting,
I would ned to do the following via linux shell scripting, I have an application which throws a log file, on each action of a particular work with the application, as sson as the action is done, the log file would vanish or stops updating there, the... (2 Replies)
Discussion started by: pingnagan
2 Replies
4. Shell Programming and Scripting
I'm new to scripting and was wondering if there was a way to accomplish what I want below using shell script(s).
If there is a log file as follows, where the id is the unique id of a process, with the timestamp of when the process began and completed displayed, would it be possible to find the... (3 Replies)
Discussion started by: dizydolly
3 Replies
5. UNIX for Dummies Questions & Answers
Hi
i have a log file, which keeps appending, i want to find "exceptions" in that log file and copy those exceptions to another file.
i am using
grep exception filename >> location where to copy
but as the file is appending, am not able to view.
i am using
tail -f command ,
... (5 Replies)
Discussion started by: rchaitanya
5 Replies
6. Shell Programming and Scripting
Working on a script that inputs an IP, parses and outputs to another file.
A Sample of the log is as follows:
I need the script to be able to input IP and print the data in an output file in the following format or something similar:
Thanks for any help you can give me! (8 Replies)
Discussion started by: Winsarc
8 Replies
7. Shell Programming and Scripting
Hello all,
I am new to scripting and I have written a script that performs an Rsync on my NAS and then moves on to send me an email with the status etc. The problem is that I think Rsync is taking to long to complete and the IF statement is timing out, as it doesn't appear to move on.
Here... (1 Reply)
Discussion started by: Mongrel
1 Replies
8. Shell Programming and Scripting
Hi,
I am a newbie to scripting.
I have multiple log files (saved as .gz) in a directory that looks like this
01-01-2013 10:00 pn: 123
01-01-2013 10:00 sn: 987
01-01-2013 10:00 Test1
01-01-2013 10:00 Result: Pass
01-01-2013 10:00 Time: 5:00
01-01-2013 10:00 Test2
01-01-2013 10:00... (3 Replies)
Discussion started by: linuxnew
3 Replies
9. Shell Programming and Scripting
I want to parse a log file which i am grepping root user connection but is showing whole day and previous day detail as well.
First i want to see last 2 hours log file then after that i want to search particular string. Lets suppose right now its 5:00PM, So i want to see the log of 3:00PM to... (6 Replies)
Discussion started by: learnbash
6 Replies
10. Shell Programming and Scripting
Hi,
I have a log file that looks like below and I am wanting to know if there is a better way of parsing it from how I am doing it right now.
I am looking for when an application service is OFFLINE and ONLINE. This log file is getting written into every 30 minutes
... (1 Reply)
Discussion started by: newbie_01
1 Replies
LEARN ABOUT X11R4
ncab2clf
ncab2clf(1) User Commands ncab2clf(1)
NAME
ncab2clf - convert binary log file to Common Log File format
SYNOPSIS
/usr/bin/ncab2clf [-Dhv] [-i input-file] [-o output-file] [-b size] [-n number] [-s datetime]
DESCRIPTION
The ncab2clf command is used to convert the log file generated by the Solaris Network Cache and Accelerator ("NCA") from binary format, to
Common Log File ("CLF") format. If no input-file is specified, ncab2clf uses stdin. If no output-file is specified, the output goes to std-
out.
OPTIONS
-b Specifies the binary-log-file blocking in kilobytes; the default is 64 Kbyte.
-D Specifies that direct I/O be disabled.
-h Prints usage message.
-i input-file Specifies the input file.
-n number Output number CLF records.
-o output-file Specifies the output file.
-s datetime Skip any records before the date and time specified in datetime. You can specify the date and time in CLF format or in the
format specified by the touch(1) utility. CLF format is the dominant format, so ncab2clf first analyzes datetime assuming
CLF.
-v Provides verbose output.
EXAMPLES
Example 1: Converting a Binary File to a Common Log File Format
The following example converts the binary file /var/nca/logs/nca.blf to a file /var/nca/logs/nca.clf, which is in Common Log File format.
example% ncab2clf -D -i /var/nca/logs/nca.blf -o /var/nca/logs/nca.clf
Example 2: Converting Multiple Log Files
The following script may be used to convert multiple log files. The directory designated by "*" must only contain log files.
!/bin/ksh
for filename in *
do
ncab2clf -D < $filename > $filename.clf
done
Example 3: Using -s and -n on a Raw Device
The following example shows how ncab2clf can be used on a raw device. If not using the -n option, the default is to convert all records
from the starting location to the end of the file. The date and time specified with -s, below, is in CLF format.
example% ncab2clf -s '10/Apr/2001:09:23:13' -n 100 < /dev/dsk/c2t1d0s6
EXIT STATUS
The following exit values are returned:
0 The file converted successfully
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWncau |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
nca(1), ncakmod(1), nca.if(4), ncakmod.conf(4), ncalogd.conf(4), attributes(5)
System Administration Guide: IP Services
NOTES
The binary log files generated by NCA can become very large. When converting these large binary files, use the -b option to the ncab2clf
command to help performance.
Direct I/O is a benefit to the user if the data being written does not come in as large chunks. However, if the user wishes to convert the
log file in large chunks using the -b option, then direct I/O should be disabled by using the -D option.
SunOS 5.10 28 Sep 2001 ncab2clf(1)