Running through InfluxDB Essentials and various examples don't work

Hi, I’m new to InfluxDB (coming from an Aveva PI background) and running through the Essentials course on InfluxDB university, and various examples from the course are not working for me.

I have set up a local instance and I’m trying the WebAPI Post and CLI Write methods for inserting data, as per the examples in the course videos.

WebAPI POST gives me this

PS D:\Transfer\influxdb2-client-2.7.5-windows-amd64> curl --method POST "http://localhost:8086/api/v2/write?org=AlistairsTestOrg&bucket=AlistairsTestBucket" \
>> --header "authorization: Token [my token]" \
>> --data-binary "mydata,mytag=foo myfield=1"
At line:2 char:3
 --headers "authorization: Token [my token]
Missing expression after unary operator '--'.
At line:2 char:3
 --header "authorization: Token [my token]
Unexpected token 'header' in expression or statement.
At line:3 char:3
 --data-binary "mydata,mytag=foo myfield=1"
Missing expression after unary operator '--'.
At line:3 char:3
 --data-binary "mydata,mytag=foo myfield=1"
Unexpected token 'data-binary' in expression or statement.
     CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
     FullyQualifiedErrorId : MissingExpressionAfterOperator

The InfluxDB CLI route gives me this:

PS D:\Transfer\influxdb2-client-2.7.5-windows-amd64> echo "mydata,mytag=foo myfield=1" | .\influx.exe write --bucket "AlistairsTestBucket"
': invalid numberwrite data: 400 Bad Request: unable to parse 'mydata,mytag=foo myfield=1

PS D:\Transfer\influxdb2-client-2.7.5-windows-amd64> echo "#datatype measurement,tag,field,datetime:RFC3339
>> measurement,mytag,myfield,time
>> mydata,foo,6,2024-09-02T15:31:00Z" > mydata.csv
PS D:\Transfer\influxdb2-client-2.7.5-windows-amd64> .\influx.exe write --bucket "AlistairsTestBucket" --file mydata.csv --format csv
2024/09/03 11:43:31 line 2: no measurement column found
2024/09/03 11:43:31 line 3: no measurement column found
2024/09/03 11:43:31 Unable to batcher to error-file: invalid argument
2024/09/03 11:43:31 line 4: no measurement column found
2024/09/03 11:43:31 Unable to batcher to error-file: invalid argument

What am I doing wrong here?

All the above questions are still valid: the examples in the course still don’t work. But I have finished the Essentials course and I’m on to another one about the user interface. In there, the video shows the text
test, test=1
being entered in the ‘Line Protocol’ page on the InfluxDB Cloud screen, and it being accepted.

Of course when I do the exact same thing, I get
Failed to write data - Invalid line protocol submitted

This does not give me confidence! What gives? Why do so many of these examples and demos not work?

Hello @Alistair,
Hmm are you able to write through the UI?

You can see I’m able to write that line through the UI:

And that the CSV is also possible through the docs:

Using the CLI also works for me:

influx write --bucket example-bucket "mydata,mytag=foo myfield=1"

I just had to create a CLI config first:

cURL is also working:

curl --request POST \
"http://localhost:8086/api/v2/write?org=9c2a84885dbca853&bucket=anais&precision=ns" \
  --header "Authorization: Token xxx" \
  --header "Content-Type: text/plain; charset=utf-8" \
  --header "Accept: application/json" \
  --data-binary 'mydata,mytag=foo myfield=1'