40
40
41
41
#### Write the home sensor data to InfluxDB
42
42
43
- Use the InfluxDB v2 or v1 API to write the home sensor sample data to {{< product-name >}}.
43
+ Use the ` influxdb3 ` CLI, InfluxDB v2 API, or InfluxDB v1 API to write the
44
+ home sensor sample data to {{< product-name >}}.
44
45
45
46
{{< code-tabs-wrapper >}}
46
47
{{% code-tabs %}}
48
+ [ influxdb3] ( # )
47
49
[ v2 API] ( # )
48
50
[ v1 API] ( # )
49
51
{{% /code-tabs %}}
50
52
{{% code-tab-content %}}
51
53
54
+ {{% influxdb/custom-timestamps %}}
55
+ {{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
56
+ ``` sh
57
+ influxdb3 write \
58
+ --token AUTH_TOKEN \
59
+ --database DATABASE_NAME \
60
+ ' home,room=Living\ Room temp=21.1,hum=35.9,co=0i 1641024000
61
+ home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000
62
+ home,room=Living\ Room temp=21.4,hum=35.9,co=0i 1641027600
63
+ home,room=Kitchen temp=23.0,hum=36.2,co=0i 1641027600
64
+ home,room=Living\ Room temp=21.8,hum=36.0,co=0i 1641031200
65
+ home,room=Kitchen temp=22.7,hum=36.1,co=0i 1641031200
66
+ home,room=Living\ Room temp=22.2,hum=36.0,co=0i 1641034800
67
+ home,room=Kitchen temp=22.4,hum=36.0,co=0i 1641034800
68
+ home,room=Living\ Room temp=22.2,hum=35.9,co=0i 1641038400
69
+ home,room=Kitchen temp=22.5,hum=36.0,co=0i 1641038400
70
+ home,room=Living\ Room temp=22.4,hum=36.0,co=0i 1641042000
71
+ home,room=Kitchen temp=22.8,hum=36.5,co=1i 1641042000
72
+ home,room=Living\ Room temp=22.3,hum=36.1,co=0i 1641045600
73
+ home,room=Kitchen temp=22.8,hum=36.3,co=1i 1641045600
74
+ home,room=Living\ Room temp=22.3,hum=36.1,co=1i 1641049200
75
+ home,room=Kitchen temp=22.7,hum=36.2,co=3i 1641049200
76
+ home,room=Living\ Room temp=22.4,hum=36.0,co=4i 1641052800
77
+ home,room=Kitchen temp=22.4,hum=36.0,co=7i 1641052800
78
+ home,room=Living\ Room temp=22.6,hum=35.9,co=5i 1641056400
79
+ home,room=Kitchen temp=22.7,hum=36.0,co=9i 1641056400
80
+ home,room=Living\ Room temp=22.8,hum=36.2,co=9i 1641060000
81
+ home,room=Kitchen temp=23.3,hum=36.9,co=18i 1641060000
82
+ home,room=Living\ Room temp=22.5,hum=36.3,co=14i 1641063600
83
+ home,room=Kitchen temp=23.1,hum=36.6,co=22i 1641063600
84
+ home,room=Living\ Room temp=22.2,hum=36.4,co=17i 1641067200
85
+ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200'
86
+ ```
87
+ {{% /code-placeholders %}}
88
+ {{% /influxdb/custom-timestamps %}}
89
+
90
+ {{% /code-tab-content %}}
91
+ {{% code-tab-content %}}
92
+
52
93
{{% influxdb/custom-timestamps %}}
53
94
{{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
54
95
``` sh
@@ -96,7 +137,7 @@ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
96
137
{{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
97
138
``` sh
98
139
curl --request POST \
99
- https ://{{< influxdb/host > }}/write? db=DATABASE_NAME& precision=s \
140
+ http ://{{< influxdb/host > }}/write? db=DATABASE_NAME& precision=s \
100
141
--header " Authorization: Bearer AUTH_TOKEN" \
101
142
--header " Content-type: text/plain; charset=utf-8" \
102
143
--data-binary "
@@ -139,12 +180,12 @@ Replace the following in the sample script:
139
180
- {{% code-placeholder-key %}}` DATABASE_NAME ` {{% /code-placeholder-key %}}:
140
181
the name of database to write to
141
182
- {{% code-placeholder-key %}}` AUTH_TOKEN ` {{% /code-placeholder-key %}}:
142
- your InfluxDB authorization token
183
+ your {{< product-name >}} authorization token
143
184
144
185
> [ !Note]
145
186
> While in alpha, {{< product-name >}} does not require an authorization token.
146
- > You can either omit the ` Authorization ` header or you can provide an
147
- > arbitrary token string.
187
+ > You can either omit the CLI ` --token ` option or the HTTP ` Authorization ` header or
188
+ > you can provide an arbitrary token string.
148
189
149
190
{{% /expand %}}
150
191
{{< /expand-wrapper >}}
186
227
187
228
#### Write the home sensor actions data to InfluxDB
188
229
189
- Use the InfluxDB v2 or v1 API to write the home sensor actions sample data
190
- to {{< product-name >}}.
230
+ Use the ` influxdb3 ` CLI, InfluxDB v2 API, or InfluxDB v1 API to write the
231
+ home sensor actions sample data to {{< product-name >}}.
191
232
192
233
{{< code-tabs-wrapper >}}
193
234
{{% code-tabs %}}
235
+ [ influxdb3] ( # )
194
236
[ v2 API] ( # )
195
237
[ v1 API] ( # )
196
238
{{% /code-tabs %}}
197
239
{{% code-tab-content %}}
198
240
241
+ {{% influxdb/custom-timestamps %}}
242
+ {{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
243
+ ``` sh
244
+ influxdb3 write \
245
+ --token AUTH_TOKEN \
246
+ --database DATABASE_NAME \
247
+ ' home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23°C). Cooling to 22°C." 1641027600
248
+ home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.3°C). Cooling to 22°C." 1641060000
249
+ home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.1°C). Cooling to 22°C." 1641063600
250
+ home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 18 ppm." 1641060000
251
+ home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 22 ppm." 1641063600
252
+ home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 26 ppm." 1641067200
253
+ home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 14 ppm." 1641063600
254
+ home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 17 ppm." 1641067200'
255
+ ```
256
+ {{% /code-placeholders %}}
257
+ {{% /influxdb/custom-timestamps %}}
258
+
259
+ {{% /code-tab-content %}}
260
+ {{% code-tab-content %}}
261
+
199
262
{{% influxdb/custom-timestamps %}}
200
263
{{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
201
264
``` sh
202
265
curl --request POST \
203
- https ://{{< influxdb/host > }}/api/v2/write? bucket=DATABASE_NAME& precision=s \
266
+ http ://{{< influxdb/host > }}/api/v2/write? bucket=DATABASE_NAME& precision=s \
204
267
--header " Authorization: Bearer AUTH_TOKEN" \
205
268
--header " Content-Type: text/plain; charset=utf-8" \
206
269
--header " Accept: application/json" \
@@ -225,7 +288,7 @@ home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monox
225
288
{{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
226
289
``` sh
227
290
curl --request POST \
228
- https ://{{< influxdb/host > }}/write? db=DATABASE_NAME& precision=s \
291
+ http ://{{< influxdb/host > }}/write? db=DATABASE_NAME& precision=s \
229
292
--header " Authorization: Bearer AUTH_TOKEN" \
230
293
--header " Content-type: text/plain; charset=utf-8" \
231
294
--data-binary '
@@ -250,12 +313,12 @@ Replace the following in the sample script:
250
313
- {{% code-placeholder-key %}}` DATABASE_NAME ` {{% /code-placeholder-key %}}:
251
314
the name of database to write to
252
315
- {{% code-placeholder-key %}}` AUTH_TOKEN ` {{% /code-placeholder-key %}}:
253
- your InfluxDB authorization token
316
+ your {{< product-name >}} authorization token
254
317
255
318
> [ !Note]
256
319
> While in alpha, {{< product-name >}} does not require an authorization token.
257
- > You can either omit the ` Authorization ` header or you can provide an
258
- > arbitrary token string.
320
+ > You can either omit the CLI ` --token ` option or the HTTP ` Authorization ` header or
321
+ > you can provide an arbitrary token string.
259
322
260
323
{{% /expand %}}
261
324
{{< /expand-wrapper >}}
@@ -291,16 +354,29 @@ series use cases that involve seasonality.
291
354
292
355
#### Write the NOAA Bay Area weather data to InfluxDB
293
356
294
- Use the InfluxDB v2 or v1 API to write the NOAA Bay Area weather sample data to
295
- {{< product-name >}}.
357
+ Use the ` influxdb3 ` CLI, InfluxDB v2 API, or InfluxDB v1 API to write the
358
+ NOAA Bay Area weather sample data to {{< product-name >}}.
296
359
297
360
{{< code-tabs-wrapper >}}
298
361
{{% code-tabs %}}
362
+ [ influxdb3] ( # )
299
363
[ v2 API] ( # )
300
364
[ v1 API] ( # )
301
365
{{% /code-tabs %}}
302
366
{{% code-tab-content %}}
303
367
368
+ {{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
369
+ ``` sh
370
+ influxdb3 write \
371
+ --token AUTH_TOKEN \
372
+ --database DATABASE_NAME \
373
+ " $( curl --request GET https://docs.influxdata.com/downloads/bay-area-weather.lp) "
374
+ ```
375
+ {{% /code-placeholders %}}
376
+
377
+ {{% /code-tab-content %}}
378
+ {{% code-tab-content %}}
379
+
304
380
{{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
305
381
``` sh
306
382
curl --request POST \
@@ -333,12 +409,12 @@ Replace the following in the sample script:
333
409
- {{% code-placeholder-key %}}` DATABASE_NAME ` {{% /code-placeholder-key %}}:
334
410
the name of database to write to
335
411
- {{% code-placeholder-key %}}` AUTH_TOKEN ` {{% /code-placeholder-key %}}:
336
- your InfluxDB authorization token
412
+ your {{< product-name >}} authorization token
337
413
338
414
> [ !Note]
339
415
> While in alpha, {{< product-name >}} does not require an authorization token.
340
- > You can either omit the ` Authorization ` header or you can provide an
341
- > arbitrary token string.
416
+ > You can either omit the CLI ` --token ` option or the HTTP ` Authorization ` header or
417
+ > you can provide an arbitrary token string.
342
418
343
419
{{% /expand %}}
344
420
{{< /expand-wrapper >}}
@@ -378,24 +454,23 @@ The Bitcoin price sample dataset provides Bitcoin prices from
378
454
379
455
#### Write the Bitcoin price sample data to InfluxDB
380
456
381
- Use the InfluxDB v2 or v1 API to write the Bitcoin price sample data to
382
- {{< product-name >}}.
457
+ Use the ` influxdb3 ` CLI, InfluxDB v2 API, or InfluxDB v1 API to write the
458
+ Bitcoin price sample data to {{< product-name >}}.
383
459
384
460
{{< code-tabs-wrapper >}}
385
461
{{% code-tabs %}}
462
+ [ influxdb3] ( # )
386
463
[ v2 API] ( # )
387
464
[ v1 API] ( # )
388
465
{{% /code-tabs %}}
389
466
{{% code-tab-content %}}
390
467
391
468
{{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
392
469
``` sh
393
- curl --request POST \
394
- http://{{< influxdb/host > }}/api/v2/write? bucket=DATABASE_NAME \
395
- --header " Authorization: Bearer AUTH_TOKEN" \
396
- --header " Content-Type: text/plain; charset=utf-8" \
397
- --header " Accept: application/json" \
398
- --data-binary " $( curl --request GET https://docs.influxdata.com/downloads/bitcoin.lp) "
470
+ influxdb3 write \
471
+ --token AUTH_TOKEN \
472
+ --database DATABASE_NAME \
473
+ " $( curl --request GET https://docs.influxdata.com/downloads/bitcoin.lp) "
399
474
```
400
475
{{% /code-placeholders %}}
401
476
@@ -420,12 +495,12 @@ Replace the following in the sample script:
420
495
- {{% code-placeholder-key %}}` DATABASE_NAME ` {{% /code-placeholder-key %}}:
421
496
the name of database to write to
422
497
- {{% code-placeholder-key %}}` AUTH_TOKEN ` {{% /code-placeholder-key %}}:
423
- your InfluxDB authorization token
498
+ your {{< product-name >}} authorization token
424
499
425
500
> [ !Note]
426
501
> While in alpha, {{< product-name >}} does not require an authorization token.
427
- > You can either omit the ` Authorization ` header or you can provide an
428
- > arbitrary token string.
502
+ > You can either omit the CLI ` --token ` option or the HTTP ` Authorization ` header or
503
+ > you can provide an arbitrary token string.
429
504
430
505
{{% /expand %}}
431
506
{{< /expand-wrapper >}}
@@ -453,16 +528,29 @@ transformation functions.
453
528
454
529
#### Write the random number sample data to InfluxDB
455
530
456
- Use the InfluxDB v2 or v1 API to write the random number sample data to
457
- {{< product-name >}}.
531
+ Use the ` influxdb3 ` CLI, InfluxDB v2 API, or InfluxDB v1 API to write the
532
+ random number sample data to {{< product-name >}}.
458
533
459
534
{{< code-tabs-wrapper >}}
460
535
{{% code-tabs %}}
536
+ [ influxdb3] ( # )
461
537
[ v2 API] ( # )
462
538
[ v1 API] ( # )
463
539
{{% /code-tabs %}}
464
540
{{% code-tab-content %}}
465
541
542
+ {{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
543
+ ``` sh
544
+ influxdb3 write \
545
+ --token AUTH_TOKEN \
546
+ --database DATABASE_NAME \
547
+ " $( curl --request GET https://docs.influxdata.com/downloads/random-numbers.lp) "
548
+ ```
549
+ {{% /code-placeholders %}}
550
+
551
+ {{% /code-tab-content %}}
552
+ {{% code-tab-content %}}
553
+
466
554
{{% code-placeholders "AUTH_TOKEN|DATABASE_NAME" %}}
467
555
``` sh
468
556
curl --request POST \
@@ -495,12 +583,12 @@ Replace the following in the sample script:
495
583
- {{% code-placeholder-key %}}` DATABASE_NAME ` {{% /code-placeholder-key %}}:
496
584
the name of database to write to
497
585
- {{% code-placeholder-key %}}` AUTH_TOKEN ` {{% /code-placeholder-key %}}:
498
- your InfluxDB authorization token
586
+ your {{< product-name >}} authorization token
499
587
500
588
> [ !Note]
501
589
> While in alpha, {{< product-name >}} does not require an authorization token.
502
- > You can either omit the ` Authorization ` header or you can provide an
503
- > arbitrary token string.
590
+ > You can either omit the CLI ` --token ` option or the HTTP ` Authorization ` header or
591
+ > you can provide an arbitrary token string.
504
592
505
593
{{% /expand %}}
506
594
{{< /expand-wrapper >}}
0 commit comments