.write question


Is the following data meet the protocol?

packets,host= remote=320 1627883568357

It writes successfully but I do not see anything when I query the bucket I am writing to via python?


That does look valid. One thing that might be throwing you off is that the timestamp by default is understood to be in nanoseconds, and I think yours might be in milliseconds.

If you do something like this, I think you’ll be able to query it within the time range you are expecting:

packets,host= remote=320 1627883568357000000

Depending on how you are writing the data, it is also possible to specify the timestamp precision. There’s API docs here for this is you are using the HTTP API: InfluxDB v2.0 API documentation

1 Like

Thanks, that must be it. I am using the following code to do the same thing and it does not like it. Need to convert to nanoseconds

    dtparse = datetime.fromisoformat(re.sub(r'Z$', '+00:00:00', hit['_source']['timestamp']))
    epoch = datetime.fromisoformat(re.sub(r'Z$', '+00:00:00', '1970-01-01T00:00:00.000Z'))
    timestamp = int((dtparse- epoch).total_seconds() * 1000.0)