Newbie Questions: getting data into InfluxDB easily/ timestamp format

Hi All,

last weekend I learned about InfluxDB for the first time. I watched an introductory lecture on Youtube. However, it was still related to version 1.x.
Obviously, however, it makes sense to start with the current version 2 right away.
In the lecture it was shown how to load data into a database quite simply and directly via HTTP, i.e. with the tool curl. All these examples can also be found in the old documentation:

However, this is no longer found in this form in the documentation for version 2 (see linked page) Does this no longer work?
I am looking for a simple way to transfer existing measurement data (text documents) into a database using only shell tools (BASH, AWK…).

Furthermore I read that you can specify the timestamp in the “Line Protocol” in different resolutions (ns/us/ms/s) as integer. More convenient would be a representation as ISO string (“2021-04-12T20:11:22Z”), as it is used in the outputs of the database. Is this also possible when entering data points?

Thank you and many greetings!
conne914

Hello @conne914,

Welcome!!
Here’s an example with the CLI:

You’ll want to configure your CLI first. Here’s an example and useful blog:

Here’s how to write line protocol with the 2.0 api and cURL:

You might also find this thread relevant: Move data from Influx V1 to Influx V2 - #2 by Anaisdg

Line protocol requires that the timestamp be in unix timestamp. However, you can use the telegraf file plugin to help you convert data from a variety formats with different types of timestamps and convert it into line protocol telegraf/plugins/inputs/file at master · influxdata/telegraf · GitHub

Finally this resource could also be generally helpful

Hopefully I didn’t bombard you with too much information. Please give some of it a brief look and let me know if I can help you with any aspect in further detail.

Thanks :slight_smile:

Hi Anais,

that’s really a lot of information ! :sweat_smile: Thanks a lot!

I think it’s going to take me a while to digest all of this.

But I think this link gives me a good starting point for the first steps.

For now, an additional question: I assume that by specifying the timestamp you can also enter data in a different order than it was created? I mean, one could first write a script, which writes all newly arising measurement data into the database and later add offline further data from the time before the script was started (with specification of the real timestamp)?

Best,
conne914