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?