fix(influxdb3): Get-started write data: headings, link, and sample code
parent
6caffd5bfb
commit
568883b935
|
@ -139,7 +139,7 @@ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
|
|||
|
||||
{{% /influxdb/custom-timestamps %}}
|
||||
|
||||
## Write data using the CLI
|
||||
## Write data using the CLI
|
||||
|
||||
To quickly get started writing data, use the
|
||||
[`influxdb3 write` command](/influxdb3/version/reference/clis/influxdb3/write/).
|
||||
|
@ -148,13 +148,16 @@ Include the following:
|
|||
- `--database` option that identifies the target database
|
||||
- `--token` option that specifies the token to use _(unless the `INFLUXDB3_AUTH_TOKEN`
|
||||
environment variable is already set)_
|
||||
- Quoted line protocol via standard input (stdin)
|
||||
- Quoted line protocol data via standard input (stdin) or a file
|
||||
|
||||
### Write data via standard input (stdin)
|
||||
|
||||
{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN" %}}
|
||||
```bash
|
||||
influxdb3 write \
|
||||
--database DATABASE_NAME \
|
||||
--token AUTH_TOKEN \
|
||||
--precision s \
|
||||
'home,room=Living\ Room temp=21.1,hum=35.9,co=0i 1641024000
|
||||
home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000
|
||||
home,room=Living\ Room temp=21.4,hum=35.9,co=0i 1641027600
|
||||
|
@ -192,10 +195,10 @@ In the code samples, replace the following placeholders with your values:
|
|||
your {{% token-link "database" %}}{{% show-in "enterprise" %}} with permission
|
||||
to write to the specified database{{% /show-in %}}
|
||||
|
||||
##### Write data from a file
|
||||
### Write data from a file
|
||||
|
||||
Pass the `--file` option to write line protocol you have saved to a file--for example, save the
|
||||
[sample line protocol](#write-data-in-line-protocol-syntax) to a file named `server_data`
|
||||
[sample line protocol](#home-sensor-data-line-protocol) to a file named `sensor_data`
|
||||
and then enter the following command:
|
||||
|
||||
{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN" %}}
|
||||
|
@ -203,9 +206,9 @@ and then enter the following command:
|
|||
influxdb3 write \
|
||||
--database DATABASE_NAME \
|
||||
--token AUTH_TOKEN \
|
||||
--precision ns \
|
||||
--precision s \
|
||||
--accept-partial \
|
||||
--file path/to/server_data
|
||||
--file path/to/sensor_data
|
||||
```
|
||||
{{% /code-placeholders %}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue