How to create a json object with array

asked 2020-06-04 09:40:10 -0500

anonymous user


updated 2020-06-04 10:02:54 -0500

I want to create json array object.

I am using java script processor, expression evaluator.

input fields are host, metric,point,tags,type.

` { "series": [ { "host": "myhost", "metric": "test.metric", "points": [ 1 ], "tags": "source:Postman,test", "type": "gauge" } ] }

output am getting is {"series":{"metric":"records","type":"count","points":1,"tags":{"source":"test"}}}

edit retag flag offensive close merge delete


Pl update your question and clearly state what the input field or record looks like and which processors are you currently using.

iamontheinet gravatar imageiamontheinet ( 2020-06-04 09:43:20 -0500 )edit

Can you add more details? What do your expressions look like in Expression Evaluator? What does your script in JS look like? And you didn't specify what the desired output is.

iamontheinet gravatar imageiamontheinet ( 2020-06-09 10:05:42 -0500 )edit