Problem with input x-www-form-urlencoded data

hi
we have problem with input x-www-form-urlencoded
i use this config in telegraf

> [[inputs.http_listener_v2]]
>   name_override = "mymetric2"
>   service_address = ":8080"
>   data_source = "query"
>   data_format = "form_urlencoded"
>   form_urlencoded_tag_keys = ["tag1"]     

my data is

messages=%5B%7B%22values%22%3A+%7B%22momentum%22%3A+%220.00%22%7D%2C+%22exchange%22%3A+%22binance%22%2C+%22market%22%3A+%22BCH%2FBTC%22%2C+%22base_currency%22%3A+%22BCH%22%2C+%22quote_currency

i think it need to convert to json first
but i dont know how ?
any solution ? thanks

Hi,

The problem is your URL encoded data is JSON. This is what it looks like decoded:

messages=[{"values":+{"momentum":+"0.00"},+"exchange":+"binance",+"market":+"BCH/BTC",+"base_currency":+"BCH",+"quote_currency

I’d suggest you have your code send the JSON as is, without the encoding and use data_format = "json"

thanks but we dont access to change data-format
i just recive this data

I agree it would be ideal to update the way the data is sent, but it may be able possible to handle it as-is using form_urlencoded to grab the data into a single string field containing the JSON, and then using the parser processor as a second pass to expand out the JSON.