Hello could someone help me how to remove the additional "{ and "} on the request upon using JSR223 PreProcessor, This is the syntax I use to generate the request below. Your response is highly appreciated. Thank you so much.
Screenshot:
Expected Result:
"metrics": {
"com.cixsoft.agent.metric.NetworkMetric": "NetworkMetric.json",
"com.cixsoft.agent.metric.ProcessInfoMetric": "ProcessInfoMetric.json",
"com.cixsoft.agent.metric.CpuMetric": "CpuMetric.json"
},
Actual Result:
"metrics": {
"{ -<< Remove this open curly braces
"com.cixsoft.agent.metric.NetworkMetric": "NetworkMetric.json",
"com.cixsoft.agent.metric.ProcessInfoMetric": "ProcessInfoMetric.json",
"com.cixsoft.agent.metric.CpuMetric": "CpuMetric.json"
"} -<< -<< Remove this close curly braces
},
CodePudding user response:
- Don't post code as image
- Give us a minimal reproducible example
- Follow other recommendations from How do I ask a good question? article
For example we need to know:
- The value of the
agentSimUserMetric
variable - How exactly you're using this
userMetric
variable
Looking at my crystal ball I see that you have something like:
"metrics" : {
${userMetric}
}
while you need to have just
"metrics" : ${userMetric}
so I'm 99.9% sure that it's you who is adding these curly braces and asking us for a piece of advice regarding how to remove them sounds kind of weird.
More information: