Author |
Message
|
AkankshA |
Posted: Mon Aug 25, 2008 8:14 pm Post subject: ' in Trace node |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
I have trace ndoe in between my flow to log the message in a file..
The concern i am facing is that a pattern of
TRACING INPUT ${Body} and environment ${..... }
outputs the message in file as
'TRACING INPUT' ${Body} 'and environment' ${..... }
Is there a way to get rid of these ' in the flie.. [/b] _________________ Cheers |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Mon Aug 25, 2008 10:43 pm Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
Perhaps you could try something like below with trim -function:
PATTERN
firstname = ${Root.MRM.etunimi}, surname = ${Root.MRM.sukunimi} and timestamp was ${current_timestamp}
firstname = ${trim(both '''' from Root.MRM.etunimi)}, surname = ${trim(both '''' from Root.MRM.sukunimi)} and timestamp was ${current_timestamp}
OUTPUT
firstname = 'marko', surname = 'pitkanen' and timestamp was 2008-08-26 09:38:51.250
firstname = marko, surname = pitkanen and timestamp was 2008-08-26 09:38:51.250
Marko |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Aug 25, 2008 11:50 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
In my case the text i write in pattern (the words which would be printed as is) gets included in quotes
I am at MB 6.00 _________________ Cheers |
|
Back to top |
|
 |
mgk |
Posted: Wed Aug 27, 2008 7:21 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
No, there is no way to remove the ' (single quote) characters from the output of the trace node that is placed around literals in the pattern. Why would you want to? _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Aug 27, 2008 7:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mgk wrote: |
No, there is no way to remove the ' (single quote) characters from the output of the trace node that is placed around literals in the pattern. Why would you want to? |
Perhaps marko is attempting to use Trace node to perform file output functions, instead of the file output node.
Perhaps marko is merely attempting to use Trace node to generate machine consumable traces that can be handled without significant extra munging. |
|
Back to top |
|
 |
broker_new |
Posted: Wed Aug 27, 2008 6:16 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
In either of the cases very well explained by mqjeff have to be handled using Java Compute Node and write the payload into a file...  |
|
Back to top |
|
 |
AkankshA |
Posted: Thu Aug 28, 2008 8:19 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
mgk wrote: |
No, there is no way to remove the ' (single quote) characters from the output of the trace node that is placed around literals in the pattern. Why would you want to? |
well.. i have found a workaround for the same..
store the literals in environment tree..
SET Environment.Var.test = 'TEST' ;
${trim(both '''' from Environment.Var.test)},
result in file is just TEST without any quotes...
now the issue i am facing is my log file has data printed in ANSI encoding standard but i want the same in UTF 8..
nyone knows the value for that.. _________________ Cheers |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Aug 28, 2008 8:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You should not be using a trace node for this.
Typically the trace node output would be $Root, $Environment, $ExceptionList and any separators you would want....and leave the formating as it is...
The node is really meant to look at the data and help figure out why the message went to the exception node....
For formated output you can use either a JCN or a java callout.
Look at the java.logging API.....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Aug 28, 2008 10:14 pm Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Quote: |
For formated output you can use either a JCN or a java callout |
Or send them as a messages to the q and read them to the file system with separate process..
Marko |
|
Back to top |
|
 |
AkankshA |
Posted: Thu Aug 28, 2008 11:27 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
well i am using env variable to specify the header tags of log file/msg and my entire message is followed by the tag... along with exception.. _________________ Cheers |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Aug 29, 2008 3:32 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should be using FileOutput, and not Trace. |
|
Back to top |
|
 |
|