{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • General
    • Edge/API Management
    • Developer Portal
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
0
Question by Krish · Nov 07, 2018 at 10:15 PM · 78 Views message logging policyassignmessagesumologicflow variable

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...

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

· Add your answer
  • Sort: 
avatar image
1

Answer by Dino-at-Google   · Nov 08, 2018 at 01:12 AM

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.

Comment
Add comment Show 4 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Krish · Nov 09, 2018 at 05:08 PM 0
Link

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.

testloging-rev1-2018-11-09.zip (3.1 kB)
testloggingsharedflow-rev2-2018-11-09.zip (2.3 kB)
avatar image Dino-at-Google ♦♦ Krish   · Nov 10, 2018 at 12:48 AM 0
Link

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.

apiproxy-assignment-for-logging-20181211.zip (5.0 kB)
avatar image Krish Dino-at-Google ♦♦ · Dec 11, 2018 at 07:43 PM 0
Link
@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

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 5 attachments (including images) can be used with a maximum of 5.0 MB each and 25.0 MB total.

Follow this Question

Answers Answers and Comments

47 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Assigning a JSON to a variable using assign message. 2 Answers

Sumologic syslog connection from apigee 1 Answer

Post Client Flow and System Variables 2 Answers

Possible to assign ScriptOutput in Execution phase to a variable? 0 Answers

MessageLogging Policy - Logstash 5 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • General
  • Edge/API Management
  • Developer Portal
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges