@@ -139,7 +139,7 @@ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
139
139
140
140
{{% /influxdb/custom-timestamps %}}
141
141
142
- ## Write data using the CLI
142
+ ## Write data using the CLI
143
143
144
144
To quickly get started writing data, use the
145
145
[ ` influxdb3 write ` command] ( /influxdb3/version/reference/clis/influxdb3/write/ ) .
@@ -148,13 +148,16 @@ Include the following:
148
148
- ` --database ` option that identifies the target database
149
149
- ` --token ` option that specifies the token to use _ (unless the ` INFLUXDB3_AUTH_TOKEN `
150
150
environment variable is already set)_
151
- - Quoted line protocol via standard input (stdin)
151
+ - Quoted line protocol data via standard input (stdin) or a file
152
+
153
+ ### Write data via standard input (stdin)
152
154
153
155
{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN" %}}
154
156
``` bash
155
157
influxdb3 write \
156
158
--database DATABASE_NAME \
157
159
--token AUTH_TOKEN \
160
+ --precision s \
158
161
' home,room=Living\ Room temp=21.1,hum=35.9,co=0i 1641024000
159
162
home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000
160
163
home,room=Living\ Room temp=21.4,hum=35.9,co=0i 1641027600
@@ -192,20 +195,20 @@ In the code samples, replace the following placeholders with your values:
192
195
your {{% token-link "database" %}}{{% show-in "enterprise" %}} with permission
193
196
to write to the specified database{{% /show-in %}}
194
197
195
- ##### Write data from a file
198
+ ### Write data from a file
196
199
197
200
Pass the ` --file ` option to write line protocol you have saved to a file--for example, save the
198
- [ sample line protocol] ( #write- data-in- line-protocol-syntax ) to a file named ` server_data `
201
+ [ sample line protocol] ( #home-sensor- data-line-protocol ) to a file named ` sensor_data `
199
202
and then enter the following command:
200
203
201
204
{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN" %}}
202
205
``` bash
203
206
influxdb3 write \
204
207
--database DATABASE_NAME \
205
208
--token AUTH_TOKEN \
206
- --precision ns \
209
+ --precision s \
207
210
--accept-partial \
208
- --file path/to/server_data
211
+ --file path/to/sensor_data
209
212
```
210
213
{{% /code-placeholders %}}
211
214
0 commit comments