Json message logging using flow variable

Hi,

I have a flow variable which has value in json format, example contrivedMessage= {"test":"blah", .....}, now i want to use this variable to log in sumo logic

In the message logging policy,

If i use

<Message>{contrivedMessage.content} </Message>

message is coming without starting {. If i use

<Message>\{contrivedMessage.content} </Message>

message is coming \{ "test":"value"}.

As it is coming with \ sumologic could not parse it as json.

Before when i used to formed the json log in the message logging policy as below, message used to come to sumo as json message.

<Message> \{"test":"{system.time.year}"...}</Message>

I have a reason why i am not doing it anymore...

1 5 864
5 REPLIES 5

I suspect that contrivedMessage.content lacks the leading curly.

Check the logic that you use to create that thing.

I guess it is an AssignMessage.

show it here if you want assistance in examining it.

testloging-rev1-2018-11-09.ziptestloggingsharedflow-rev2-2018-11-09.zip

I am using a shared flow and a message logging policy in the proxy. Please find the attached files. I couldn't find any issue my assign message policy.

I see Double curlies.

 <Message>{{errorLogMessage.content}}</Message>

Is this your intent?

I put together an API Proxy that shows, I think, what you are trying to accomplish. It assigns a payload in one assignmessage, and then uses the payload in a second policy.

apiproxy-assignment-for-logging-20181211.zip

I don't know why you're not having success. I think you need to break things down. Verify that the assignment policies in Apigee Edge are working as expected. Then... check that the file log is getting what you expect.

If the assignments look right, and the logging isn't right... then.... check the logging piece. Simplify what you're doing. Test. Expand the complexity, then test again. Diagnose each thing, step by step.

@Dino-at-Google

I was trying with Double curlies to check if it works...but it didn't. Single curly also didn't work.

I am getting 403 while accessing the attachment, logging-assignment-example-apiproxy.zip.

Can you please open it up for me?

Thanks,

Krish

hmmm, me too. Not sure why that is happening. It's a broken link. Let me fix it.

EDIT: ok try now.

Also, I think it's funny that there was a 1-month delay between me posting the ZIP originally and you trying to download it!