Regarding string data in New Relic that gets escaped when it contains double quotes

I have a data that is provided to new relic in the form of synthetic,100.0,rs,synthetic,de91e948-6cfe-4fc4-b1dd-1f612a408107,stgx,TempAggregatorTest,temp-aggregator,"1"

But when this data is provided to flex using the yaml
event_type: tempServiceAvailability # Name of the event in New Relic
commands:
- run: “/tmp/metrics.sh”
set_header: [assetType,availability,category,component,entityGuid,env,name,product,version]
split: horizontal
split_by: ‘,’

I noticed that the version field that has “1” gets escaped again into “version”: "“1"” in the json that gets created . how to avoid this and get the output generated as “version”: “1”

Hello @rgururajan! it appears that essentially that flex is interpreting version to have a string value of "1" instead of a string value of 1 which is probably because that’s how the data is coming out in the script. you can either modify your script to strip this, or you can using value_parser to parse "1" with regex to just be 1 .

adding a value_parser section to your commands subsection like this should probably get you what you’re looking for.

    value_parser:
      version: "[0-9]+"
1 Like