Sponsored Content
Full Discussion: parsing a log file
Top Forums UNIX for Dummies Questions & Answers parsing a log file Post 302310143 by izuma on Thursday 23rd of April 2009 09:59:59 PM
Old 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

Parsing a Log file

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

Help with script parsing a log file

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

Script for parsing details in a log file to a seperate file

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

Log file text parsing

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

Parsing log file continuously

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

Script for Parsing Log File

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

Help Parsing a Log File

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

Parsing Log File help

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

Parsing log file for last 2 hours

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

HELP on parsing this log file

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
W3C_EXTENDED2DLF.IN(1)					  LogReport's Lire Documentation				    W3C_EXTENDED2DLF.IN(1)

NAME
w3c_extended2dlf - convert W3C Extended Log file as used by MS IIS to DLF SYNOPSIS
w3c_extended2dlf file DESCRIPTION
w3c_extended2dlf converts web server log files in the W3C Extended Log Format to the www DLF. This log format is defined at http://www.w3.org/TR/WD-logfile.html It is used by IIS 4.0 and IIS 5.0. This is a customizable format which contains an header specifying which information is present in the log. Some documenation on these log file formats is available in the section on "Analyzing Log Files (IIS 6.0)" in the "IIS 6.0 Documentation" at the "Microsoft Windows Server 2003 TechCenter" at http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/ Library/IIS/610b7d2c-90d6-4e40-be79-aaf88a283f03.mspx?mfr=true . The newer IIS 7.0 product is documented at http://www.iis.net/. To have the maximum information in you reports, we suggests that you log the following fields : date, time, c-ip, c-dns, cs-uri, cs-method, sc-bytes, sc-status, cs(User-Agent), cs(Referer) and cs-username We also support the cs-uri-stem field. Other fields will be ignored. LIMITATIONS
The converter doesn't handle aggregation (record with count field) and will refuse to process those logs. Also it doesn't support changing the fields in the middle of the log file. It will ignore records that don't have the same schema than the first one defined. EXAMPLES
To process a log as produced in the W3C Extended Log Format: $ w3c_extended2dlf < extended.log w3c_extended2dlf will be rarely used on its own, but is more likely called by lr_log2report: $ lr_log2report w3c_extended < /var/log/httpd/extended.log AUTHORS
Francis J. Lacoste <flacoste@logreport.org> VERSION
$Id: w3c_extended2dlf.in,v 1.17 2009/03/15 08:10:55 vanbaal Exp $ COPYRIGHT
Copyright (C) 2001, 2002 Stichting LogReport Foundation LogReport@LogReport.org This program is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2009-03-15 W3C_EXTENDED2DLF.IN(1)
All times are GMT -4. The time now is 01:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy