From 2e08bd47bd3f75c40d54b335e9f09ceecdca32fe Mon Sep 17 00:00:00 2001 From: mluu12 <87089043+mluu12@users.noreply.github.com> Date: Fri, 20 Aug 2021 16:22:37 -0700 Subject: [PATCH] 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 Co-authored-by: Scott Anderson --- .../write_protocols/line_protocol_tutorial.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/content/influxdb/v1.8/write_protocols/line_protocol_tutorial.md b/content/influxdb/v1.8/write_protocols/line_protocol_tutorial.md index 5e00721bf..0d17b9068 100644 --- a/content/influxdb/v1.8/write_protocols/line_protocol_tutorial.md +++ b/content/influxdb/v1.8/write_protocols/line_protocol_tutorial.md @@ -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_ * | _Limited_ * | +| Tag key | _Limited_ * | _Limited_ * | +| Tag value | _Limited_ * | _Limited_ * | +| Field key | _Limited_ * | _Limited_ * | +| Field value | **Strings only** | Never | +| Timestamp | Never | Never | + +\* _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