Add notes about double quotes in line protocol for tag and field values (#3044)

* add in notes about double quotes - draft.

* Update content/influxdb/v1.8/write_protocols/line_protocol_tutorial.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
pull/3057/head
mluu12 2021-08-20 16:22:37 -07:00 committed by GitHub
parent 04b9a7f192
commit 2e08bd47bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -88,6 +88,29 @@ Adding another tag (`season=summer`) to the example looks like this:
weather,location=us-midwest,season=summer temperature=82 1465839830100400200
```
When using quotes in tag sets, line protocol supports single and double quotes as described in the following table:
| Element | Double quotes | Single quotes |
| :------ | :------------: |:-------------: |
| Measurement | _Limited_ <sup class="required">*</sup> | _Limited_ <sup class="required">*</sup> |
| Tag key | _Limited_ <sup class="required">*</sup> | _Limited_ <sup class="required">*</sup> |
| Tag value | _Limited_ <sup class="required">*</sup> | _Limited_ <sup class="required">*</sup> |
| Field key | _Limited_ <sup class="required">*</sup> | _Limited_ <sup class="required">*</sup> |
| Field value | **Strings only** | Never |
| Timestamp | Never | Never |
<sup class="required">\*</sup> _Line protocol accepts double and single quotes in
measurement names, tag keys, tag values, and field keys, but interprets them as
part of the name, key, or value._
{{% note %}}
_Always double quote string field values._
```sh
measurementName fieldKey="field string value" 1556813561098000000
```
{{% /note %}}
For best performance you should sort tags by key before sending them to the
database.
The sort should match the results from the