943,582 Members | Top Members by Rank

Ad:
Sep 23rd, 2009
-1

Record too long.......

Expand Post »
Hi,
I am trying to log a portion of the log file depending upon the "WorkOrderNumber" and "level".
The shell script i've written is as follows:-
Shell Scripting Syntax (Toggle Plain Text)
  1. cat input.log | awk '/\[WorkOrderNumber/' | awk /120600012/ | awk /INFO/ | tee log.vw

For a particular WorkOrderNumber, the record is very long (4253 characters).

When I run the script I get following message:-

awk: record `[2009-09-17 08:26]IN...' too long
record number 882


How to get rid of this error?
I don't want to tamper with input.log file.

Please help.
Similar Threads
Reputation Points: 35
Solved Threads: 4
Light Poster
axeeffect2002 is offline Offline
33 posts
since Jul 2009
Sep 23rd, 2009
0

Re: Record too long.......

Is this a solaris machine? You can try using GNU's awk which won't throw this error. The name for it is "gawk". You should be able to get solaris package files for GNU utils. I think www.ibiblio.org has them on their FTP site.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 23rd, 2009
0

Re: Record too long.......

Yes!!! It's Solaris box indeed.

Will you please clarify more about how to "to get solaris package files for GNU utils"???

Please explain me thinking that you're explaining to a dimwit.
Reputation Points: 35
Solved Threads: 4
Light Poster
axeeffect2002 is offline Offline
33 posts
since Jul 2009
Sep 23rd, 2009
0

Re: Record too long.......

I don't know what version of solaris you are running. Just google "Solaris N gawk", such as "Solaris 9 gawk":

Solaris 9: http://www.sunfreeware.com/programlistsparc9.html
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 23rd, 2009
0

Re: Record too long.......

Sorry. My bad.
Here goes my Solaris version...
version 2.05.0(1)-release (sparc-sun-solaris2.9)

I have downloaded gawk-3.0.2. what next?
Reputation Points: 35
Solved Threads: 4
Light Poster
axeeffect2002 is offline Offline
33 posts
since Jul 2009
Sep 24th, 2009
0

Re: Record too long.......

Install it
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 26th, 2009
1

Re: Record too long.......

gunzip gawk-3.2.gz
pkgadd -d gawk-3.2
Reputation Points: 27
Solved Threads: 1
Newbie Poster
kranny is offline Offline
9 posts
since May 2009
Sep 26th, 2009
0

Re: Record too long.......

Thank you all for the help.
I installed gawk and it's working elegently.

Thanks again.
Reputation Points: 35
Solved Threads: 4
Light Poster
axeeffect2002 is offline Offline
33 posts
since Jul 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: Kill top 5 processes
Next Thread in Shell Scripting Forum Timeline: sed substitution with variables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC