-
Notifications
You must be signed in to change notification settings - Fork 521
(latest version) write method does not work #467
Comments
It is really weird that if protocol == 'json':
data = make_lines(data, precision).encode('utf-8') where for point in data['points']: If I would only want to write 1 single point, then my json(dict) shall naturally look like: json_body = {
"measurement": "message",
"tags": {
"tag1": "99999",
"tag2": "99999"
},
"fields": {
"field1": 9999,
"field2": 99999
},
"time": 1496625370893587000
} |
Thanks for raising this, and sorry for the delay in getting back to you. Will look at this and address ASAP. |
Thanks, Currently, for your
Then in |
For sanity, can you please confirm the version of the app you're using? I've dug into this some more and the main issue is the order of your data entry...to be fair, this is not documented properly at the moment, sorry! :/ The new syntax is expected as follows, where the
Also, you don't need to specify the Do you want to give this another shot with the revised format and let us know? |
I think I am using the latest version of the client. (apt-get install). IMO, the best format shall be:
just like a normal json (dict). And therefore we can use To be frankly speaking, the design of
is confusing since in InfluxDB, we only have |
The standard, supported method for writing data to InfluxDB (and the TICK stack) is to write line protocol. The JSON endpoint is deprecated, but support remains in clients like influxdb-python to help users seamlessly cut over. This is why you see the client calling In either scenario you should not need to pass your json_body as a list. The default expectation is json and will parse the data accordingly (provided it's valid syntax and matches the new structure). |
Hi, May I ask that,
Thanks, |
We've actually added the instructions to update in the README, but you can also do it as listed here. For your second question, the connections that are established are not long-running TCP connections. Instead you're creating an Here is an example:
|
@aviau READY TO CLOSE |
Hello, I'v tried a lot of times but I still get error Below. Could you please help me about that? Here is code and error
} Traceback (most recent call last): |
Same problem here at latest version. No fix yet. |
I have the issue here..
I only would like to write single point, so I may need the
write
method. (instead ofwrite_points
)And my JSON body is like:
With calling method:
And I got error:
The text was updated successfully, but these errors were encountered: