eclipse / streamsheets

An open-source tool for processing stream data using a spreadsheet-like interface.
https://docs.cedalo.com/
Eclipse Public License 2.0
455 stars 54 forks source link

How to use the REQUEST function to write data into the InfluxDB #42

Closed jeanfliu closed 4 years ago

jeanfliu commented 4 years ago

Question

I tried to use HTTP.REQUEST function to insert data into InfluxDB, but I got a #INVALID_PARAM_6 message. If the Body of the HTTP.REQUEST (POST) could only be in JSON format?

Context

First, I could really connect to my DB and got all databases correctly. (As shown in the figure below)

image

Then, I had a sample string in B25 as my body, and it would get a #INVALID_PARAM_6 message.

image

However, If I turned to take JSON(A25:B25) as the body, the #INVALID_PARAM_6 would not exist. But it would show

unable to parse '{"body":"weather,region=us-west temp=64.8"}': invalid number

error message as below.

image

TizianGit commented 4 years ago

Hey jeanfliu,

To use Influx properly you will need a different function. The REQUEST() function offers more variety. We have an Influx example in our documentation. I hope this helps you.

jeanfliu commented 4 years ago

Hi TizianCedalo,

Using the REQUEST() function solved my problem. 😄 Thanks a lot!