@@ -69,13 +69,16 @@ Each line of line protocol contains the following elements:
69
69
or
70
70
[ booleans] ( /influxdb/cloud-dedicated/reference/syntax/line-protocol/#boolean ) .
71
71
- ** timestamp** :
72
- [ Unix timestamp] ( /influxdb/cloud-dedicated/reference/syntax/line-protocol/#unix-timestamp )
73
- associated with the data. InfluxDB supports up to nanosecond precision. _ If
74
- the precision of the timestamp is not in nanoseconds, you must specify the
75
- precision when writing the data to InfluxDB._
72
+ [ Unix timestamp] ( /influxdb/cloud-dedicated/reference/syntax/line-protocol/#unix-timestamp )
73
+ associated with the data. InfluxDB supports up to nanosecond precision. _ If
74
+ the precision of the timestamp is not in nanoseconds, you must specify the
75
+ precision when writing the data to InfluxDB._
76
+ <!-- vale InfluxDataDocs.v3Schema = YES -->
76
77
77
78
#### Line protocol element parsing
78
79
80
+ <!-- vale InfluxDataDocs.v3Schema = NO -->
81
+
79
82
- ** measurement** : Everything before the _ first unescaped comma before the first
80
83
whitespace_ .
81
84
- ** tag set** : Key-value pairs between the _ first unescaped comma_ and the
@@ -98,6 +101,8 @@ _For schema design recommendations, see
98
101
99
102
## Construct line protocol
100
103
104
+ <!-- vale InfluxDataDocs.v3Schema = NO -->
105
+
101
106
With a basic understanding of line protocol, you can now construct line protocol
102
107
and write data to InfluxDB.
103
108
Consider a use case where you collect data from sensors in your home.
@@ -154,7 +159,7 @@ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
154
159
155
160
## Write line protocol to InfluxDB
156
161
157
- The following examples show how to write the
162
+ The following examples show how to write the preceding
158
163
[ sample data] ( #home-sensor-data-line-protocol ) , already in line protocol format,
159
164
to an {{% product-name %}} database.
160
165
@@ -235,6 +240,9 @@ home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200'
235
240
{{% /code-placeholders %}}
236
241
{{% /influxdb/custom-timestamps %}}
237
242
243
+ If successful, the output is the success message; otherwise, error details and
244
+ the failure message.
245
+
238
246
<!-- --------------------------- END INFLUXCTL CLI CONTENT ----------------------------->
239
247
240
248
{{% /tab-content %}}
@@ -492,7 +500,8 @@ Replace the following:
492
500
a [database token](/influxdb/cloud-dedicated/admin/tokens/#database-token) with
493
501
sufficient permissions to the specified database
494
502
495
- If successful, the output is an HTTP `204 No Content` status code.
503
+ If successful, the output is an HTTP `204 No Content` status code; otherwise,
504
+ the error status code and failure message.
496
505
497
506
<!--pytest-codeblocks:expected-output-->
498
507
@@ -603,7 +612,8 @@ Replace the following:
603
612
[database token](/influxdb/cloud-dedicated/admin/tokens/#database-tokens) with
604
613
sufficient permissions to the specified database
605
614
606
- If successful, the output is an HTTP `204 No Content` status code.
615
+ If successful, the output is an HTTP `204 No Content` status code; otherwise,
616
+ the error status code and failure message.
607
617
608
618
<!--pytest-codeblocks:expected-output-->
609
619
@@ -629,17 +639,12 @@ dependencies to your current project.
629
639
630
640
1. Create a module directory and navigate into it--for example:
631
641
632
- <!--
633
- Using bash here is required when running with pytest.
634
- I don' t know why, but sh evaluates $_ to /usr/bin/pytest.
635
- -->
636
-
637
642
```bash
638
643
mkdir -p influxdb_py_client && cd influxdb_py_client
639
644
```
640
645
641
646
2. Setup your Python virtual environment.
642
- Inside of your module directory:
647
+ Inside of your module directory, enter the following command :
643
648
644
649
<!--pytest-codeblocks:cont-->
645
650
@@ -765,6 +770,9 @@ dependencies to your current project.
765
770
766
771
{{% /influxdb/custom-timestamps %}}
767
772
773
+ If successful, the output is the success message; otherwise, error details and
774
+ the failure message.
775
+
768
776
<!----------------------------- END PYTHON CONTENT ---------------------------->
769
777
770
778
{{% /tab-content %}}
@@ -940,17 +948,17 @@ To write data to {{% product-name %}} using Go, use the InfluxDB v3
940
948
}
941
949
```
942
950
943
- 6. In your terminal, enter the following command to install the packages listed
944
- in ` imports` , build the ` influxdb_go_client` module, and execute the
945
- ` main()` function:
951
+ 6. To install dependencies and write the data to your {{% product-name %}}
952
+ database, enter the following command into your terminal:
946
953
947
954
<!--pytest.mark.skip-->
948
955
949
956
```sh
950
- go mod tidy && go build && go run influxdb_go_client
957
+ go mod tidy && go run influxdb_go_client
951
958
```
952
959
953
- The program writes the line protocol to your {{% product-name %}} database.
960
+ If successful, the output is the success message; otherwise, error details and
961
+ the failure message.
954
962
955
963
{{% /influxdb/custom-timestamps %}}
956
964
@@ -1146,6 +1154,9 @@ To write data to {{% product-name %}} using Go, use the InfluxDB v3
1146
1154
1147
1155
{{% /influxdb/custom-timestamps %}}
1148
1156
1157
+ If successful, the output is the success message; otherwise, error details and
1158
+ the failure message.
1159
+
1149
1160
<!---------------------------- END NODE.JS CONTENT --------------------------->
1150
1161
1151
1162
{{% /tab-content %}}
@@ -1281,8 +1292,8 @@ To write data to {{% product-name %}} using Go, use the InfluxDB v3
1281
1292
with _write_ access to the specified database. _Store this in a secret
1282
1293
store or environment variable to avoid exposing the raw token string._
1283
1294
1284
- _Instantiating the client with the `using` statement ensures that the
1285
- client is disposed of when it' s no longer needed._
1295
+ _The ` using` statement ensures that the program disposes of the
1296
+ client when it' s no longer needed._
1286
1297
1287
1298
2. Defines an array of line protocol strings where each string represents a
1288
1299
data record.
@@ -1324,19 +1335,23 @@ To write data to {{% product-name %}} using Go, use the InfluxDB v3
1324
1335
7. To build and execute the program and write the line protocol to your
1325
1336
{{% product-name %}} database, enter the following command in your terminal:
1326
1337
1327
- <!--pytest.mark.skip-->
1338
+ < ! --pytest.mark.skip-->
1328
1339
1329
- ```sh
1330
- dotnet run
1331
- ```
1340
+ ` ` ` sh
1341
+ dotnet run
1342
+ ` ` `
1343
+
1344
+ If successful, the output is the success message; otherwise, error details and
1345
+ the failure message.
1346
+
1347
+ < ! ---------------------------- END C# CONTENT --------------------------->
1332
1348
1333
- <!---------------------------- END C# CONTENT --------------------------->
1349
+ {{% /influxdb/custom-timestamps %}}
1350
+ {{% /tab-content %}}
1351
+ {{% tab-content %}}
1352
+ {{% influxdb/custom-timestamps %}}
1334
1353
1335
- {{% /influxdb/custom-timestamps %}}
1336
- {{% /tab-content %}}
1337
- {{% tab-content %}}
1338
- {{% influxdb/custom-timestamps %}}
1339
- <!---------------------------- BEGIN JAVA CONTENT --------------------------->
1354
+ < ! -------------------------- BEGIN JAVA CONTENT --------------------------->
1340
1355
1341
1356
_The tutorial assumes using Maven version 3.9 and Java version > = 15._
1342
1357
@@ -1555,21 +1570,21 @@ _The tutorial assumes using Maven version 3.9 and Java version >= 15._
1555
1570
10. In your terminal or editor, execute `App.main()` to write to InfluxDB--for
1556
1571
example, using Maven:
1557
1572
1558
- < ! --pytest.mark.skip-->
1559
-
1560
- ` ` ` sh
1561
- mvn exec:java -Dexec.mainClass=" com.influxdbv3.App"
1562
- ` ` `
1563
-
1564
- < ! ---------------------------- END JAVA CONTENT --------------------------->
1573
+ <!--pytest.mark.skip-->
1565
1574
1566
- {{% /influxdb/custom-timestamps %}}
1567
- {{% /tab-content %}}
1568
- {{ < /tabs-wrapper > }}
1575
+ ```sh
1576
+ mvn exec:java -Dexec.mainClass="com.influxdbv3.App"
1577
+ ```
1569
1578
1570
1579
If successful, the output is the success message; otherwise, error details and
1571
1580
the failure message.
1572
1581
1582
+ <!---------------------------- END JAVA CONTENT --------------------------->
1583
+
1584
+ {{% /influxdb/custom-timestamps %}}
1585
+ {{% /tab-content %}}
1586
+ {{< /tabs-wrapper >}}
1587
+
1573
1588
{{< expand-wrapper >}}
1574
1589
{{% expand "View the written data" %}}
1575
1590
@@ -1610,4 +1625,5 @@ the failure message.
1610
1625
**Congratulations!** You' ve written data to InfluxDB.
1611
1626
Next, learn how to query your data.
1612
1627
1613
- {{< page-nav prev="/influxdb/cloud-dedicated/get-started/setup/" next="/influxdb/cloud-dedicated/get-started/query/" keepTab=true >}}
1628
+ {{< page-nav prev=" /influxdb/cloud-dedicated/get-started/setup/"
1629
+ next=" /influxdb/cloud-dedicated/get-started/query/" keepTab=true > }}
0 commit comments