I’m a new to influxdb2. I Try to understand and test the basic and I think I manage to write data in a bucket with this command.
curl --request POST "http://localhost:8086/api/v2/write?bucket=test&org=test-org" --header "Authorization: Token XCCPXumTHaG-7pOW63qjaonOZ6lzyZJICFwTeWz-ncq1hbMXuT0yJft_e2a1rQJoegLYShpu5GBejy4akjmXSQ==" \en
--data-raw "mem,host=host1 used_percent=23.43234543 1556896326"
But then I don’t find anything in the bucket with the navigator.
Is that normal? How can I find data that I upload with curl in influxdb web interface?
@philamon, Welcome to the InfluxDB community!
Try removing the timestamp part. It is optional. Server will set current time.
There two problems with this timestamp:
- Your value is in seconds, whereas the default write precision is nanoseconds. To use secs, you have to append URL param
- Even in secs, your value points to time a year back. Data Explorer probably selects data based on actual time range.
@VlastaHajek Thanks for your answer. I found my way on how to write in a bucket. I had to create a write auth token for the test bucket and then use it with the curl command
With the auth token and curl it worked. The example is just for a temperature log.
curl --request POST "http://localhost:8086/api/v2/write?bucket=trainn&org=test-org" --header "Authorization: Token JGUUwG6bP1HKfQy1-H8OND2jaacIkUyeaEhd2LfTwR0UKAx0W-8RAldgH4bo29OQN4JGRVpgY90nikuCQ9Pm8A==" \
--data-raw "temperature_in_room,room=kitchen temp=24.2"
They are probably other ways for a temperature log but it’s working.