Sponsored Content
Top Forums Shell Programming and Scripting Help with using awk for the file Post 302761477 by aroragaurav.84 on Friday 25th of January 2013 04:27:53 PM
Old 01-25-2013
Help with using awk for the file

INPUT FILE1:
Code:
Fri Jan 25 12:13:59 EST 2013:threadWebContainer : 624:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelMakeNewReservation response:  
{Header}{version=5.1}{requestType=hotelMakeNewReservation}{resultCode=1}{sessionID=285076295965823743626150999413479632915}
  {Error}{errorCode=9002}{errorMessage=The transaction failed with link HBS_SANDALS. It returned the following error instead of the normal expected response. Failed! Please report.}

Fri Jan 25 12:18:15 EST 2013:threadThread-174156:com.travimp.hotelierlinks.abba.service.CommunicationHandler$CommunicateWithExternalLinkService.run(): Received message from [https://www.demandmatrix.net/app/
dm/xml] in [2011] milliseconds.
Fri Jan 25 12:18:15 EST 2013:threadWebContainer : 588:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelMakeNewReservation response:  
{Header}{version=5.1}{requestType=hotelMakeNewReservation}{resultCode=0}{sessionID=66250060096521179319873899081858860792}
  {Confirmation}{totalNetPrice=69062}{totalSellPrice=69062}{roomOfferID=169810864490756661075630431568511157029}{roomPrice=69062}{svcChargeIncluded=false}{linkConfID=CysuoWm}{currencyCode=USD}{linkVersion=0}

Fri Jan 25 12:13:59 EST 2013:threadWebContainer : 624:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelMakeNewReservation response:  
{Header}{version=5.1}{requestType=hotelMakeNewReservation}{resultCode=1}{sessionID=285076295965823743626150999413479632915}
  {Error}{errorCode=1008}{errorMessage=The transaction failed with link HBS_SANDALS. It returned the following error instead of the normal expected response. Failed! Please report.}

Fri Jan 25 12:13:59 EST 2013:threadWebContainer : 624:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelMakeNewReservation response:  
{Header}{version=5.1}{requestType=hotelMakeNewReservation}{resultCode=1}{sessionID=285076295965823743626150999413479632915}
  {Error}{errorCode=2674}{errorMessage=The transaction failed with link HBS_SANDALS. It returned the following error instead of the normal expected response. Failed! Please report.}

IN INPUT FILE1 need to grep "errorCode=" and increment the counter each time in file "errorCode=" occurs and send an email when counter reaches the max value 10. then again reset the counter to 0(zero) and start again.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with awk - how to read a content of a file from every file from file list

Hi Experts. I need to list the file and the filename comes from the file ListOfFile.txt. Basicly I have a filename "ListOfFile.txt" and it contain Example of ListOfFile.txt /home/Dave/Program/Tran1.P /home/Dave/Program/Tran2.P /home/Dave/Program/Tran3.P /home/Dave/Program/Tran4.P... (7 Replies)
Discussion started by: tanit
7 Replies

2. Shell Programming and Scripting

Read a file and search a value in another file create third file using AWK

Hi, I have two files with the format shown below. I need to read first field(value before comma) from file 1 and search for a record in file 2 that has the same value in the field "KEY=" and write the complete record of file 2 with corresponding field 2 of the first file in to result file. ... (11 Replies)
Discussion started by: King Kalyan
11 Replies

3. Shell Programming and Scripting

Parse file using awk and work in awk output

hi guys, i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 this the file raw format: Number of... (6 Replies)
Discussion started by: dagigg
6 Replies

4. Shell Programming and Scripting

write awk command into file using awk

hi, i want to write my nawk command into a file. i want to write: awk 'NR==14 && $NF!="Set."{print "l ./gcsw "r" '"'"'lt all;"p"'"'"'"} NR==5{r=$2} NR==3{p=$2 FS $3 FS $4 FS $5}' $logfile > /home/gc_sw/again.mos'"'"' into gc.mos file. this is my code: awk '{print "awk 'NR==14 &&... (6 Replies)
Discussion started by: gc_sw
6 Replies

5. Shell Programming and Scripting

Converting an scim .bin.user file to a stardict tab file possible with awk?

Hi all, Here is a scim sample.bin.user file a string1 0 a string2 0 a string3 63 b string4 126 c string5 315 d string6 0 e string7 63 e string8 126 f string9 0 I like to convert this into a dict.tab file to be compiled by the ... (4 Replies)
Discussion started by: hk008
4 Replies

6. Shell Programming and Scripting

Split File by Pattern with File Names in Source File... Awk?

Hi all, I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example: ... (2 Replies)
Discussion started by: cul8er
2 Replies

7. Shell Programming and Scripting

awk command to compare a file with set of files in a directory using 'awk'

Hi, I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files. To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies

8. Shell Programming and Scripting

Awk: Print count for column in a file using awk

Hi, I have the following input in a file & need output as mentioned below(need counter of every occurance of field which is to be increased by 1). Input: 919143110065 919143110065 919143110052 918648846132 919143110012 918648873782 919143110152 919143110152 919143110152... (2 Replies)
Discussion started by: siramitsharma
2 Replies

9. UNIX for Beginners Questions & Answers

awk to update file with partial matching line in another file and append text

In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
Discussion started by: cmccabe
4 Replies
sip_sendmsg(3SIP)				   Session Initiation Protocol Library Functions				 sip_sendmsg(3SIP)

NAME
sip_sendmsg - send an outbound SIP message to the SIP stack for processing SYNOPSIS
cc [ flag ... ] file ... -lsip [ library ... ] #include <sip.h> int sip_sendmsg(sip_conn_object_t obj, sip_msg_t sip_msg, sip_dialog_t dialog, uint32_t flags); DESCRIPTION
The sip_sendmsg() function is used to send an outbound SIP message sip_msg to the SIP stack on its way to the peer. The connection object for the SIP message is passed as obj. The caller also provides the dialog associated with the message, if one exists. The value of flags is the result of ORing the following, as required: SIP_SEND_STATEFUL Send the request or response statefully. This results in the stack creating and maintaining a transaction for this request/response. If this flag is not set transactions are not created for the request/response. SIP_DIALOG_ON_FORK When this flag is set, the stack may create multiple dialogs for a dialog completing response. This may result due to forking of the dialog creating request. If this flag is not set, the first response to a dialog creating request cre- ates a dialog, but subsequent ones do not. It is only meaningful if the stack is configured to maintain dialogs. RETURN VALUES
The sip_sendmsg() function returns 0 on success and the appropriate error on failure. The value of errno is not changed by these calls in the event of an error. ERRORS
The sip_sendmsg() function can return one of the following errors on failure: EINVAL If a message is being statefully sent and the branchid in the VIA header does not conform to RFC 3261 or when accessing CSEQ header while creating a transaction. ENOENT If a message is being statefully sent, error getting the CSEQ header while creating a transaction. EPROTO If a message is being statefully sent, error getting the CSEQ value while creating a transaction. ENOMEM If the message is being statefully sent, error allocating memory for creating or adding a transaction or during transaction related processing. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
libsip(3LIB) SunOS 5.11 25 Jan 2007 sip_sendmsg(3SIP)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy