From b9aba1b4ecf7cd49e0afa43c0be7df366ddb179b Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 1 May 2019 17:15:41 -0600 Subject: [PATCH 01/14] added client library reference doc --- content/v2.0/reference/client-libraries.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 content/v2.0/reference/client-libraries.md diff --git a/content/v2.0/reference/client-libraries.md b/content/v2.0/reference/client-libraries.md new file mode 100644 index 000000000..194a3c1aa --- /dev/null +++ b/content/v2.0/reference/client-libraries.md @@ -0,0 +1,22 @@ +--- +title: InfluxDB client libraries +description: > + InfluxDB client libraries are language-specific tools that integrate with the InfluxDB v2 API. + View the list of available client libraries. +weight: 6 +menu: + v2_0_ref: + name: Client libraries +v2.0/tags: [client libraries] +--- + +InfluxDB client libraries are language-specific tools that integrate with the InfluxDB v2 API. +The following **InfluxDB v2** client libraries are available: + +{{% note %}} +These client libraries are in active development and are not feature-complete. +This list will continue to grow as more client libraries are released. +{{% /note %}} + +- [JavaScript/Node.js](https://github.com/influxdata/influxdb-client-js) +- [Go](https://github.com/influxdata/influxdb-client-go) From 4c1db98aaea674ca27946c565f156528b899999e Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 2 May 2019 08:12:37 -0600 Subject: [PATCH 02/14] minor wording change in client libraries reference --- content/v2.0/reference/client-libraries.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/v2.0/reference/client-libraries.md b/content/v2.0/reference/client-libraries.md index 194a3c1aa..8ae9e1186 100644 --- a/content/v2.0/reference/client-libraries.md +++ b/content/v2.0/reference/client-libraries.md @@ -10,11 +10,11 @@ menu: v2.0/tags: [client libraries] --- -InfluxDB client libraries are language-specific tools that integrate with the InfluxDB v2 API. +InfluxDB client libraries are language-specific packages that integrate with the InfluxDB v2 API. The following **InfluxDB v2** client libraries are available: {{% note %}} -These client libraries are in active development and are not feature-complete. +These client libraries are in active development and may not be feature-complete. This list will continue to grow as more client libraries are released. {{% /note %}} From 26f5240a70b13ad96e3ed80f1eeae230a621855a Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 2 May 2019 16:58:59 -0600 Subject: [PATCH 03/14] new line protocol reference --- content/v2.0/reference/line-protocol.md | 268 ++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 content/v2.0/reference/line-protocol.md diff --git a/content/v2.0/reference/line-protocol.md b/content/v2.0/reference/line-protocol.md new file mode 100644 index 000000000..a7866cae9 --- /dev/null +++ b/content/v2.0/reference/line-protocol.md @@ -0,0 +1,268 @@ +--- +title: Line protocol reference +description: > + Line Protocol is a text based format for writing data points to InfluxDB. + It provides InfluxDB the measurement, tag set, field set, and timestamp of a data point. +menu: + v2_0_ref: + name: Line protocol +weight: 6 +v2.0/tags: [write, line protocol] +--- + +Line Protocol is a text based format for writing data points to InfluxDB. +It provides InfluxDB the measurement, tag set, field set, and timestamp of a data point. + +- [Elements of Line Protocol](#elements-of-line-protocol) +- [Data types and format](#data-types-and-format) +- [Quoting](#quoting) +- [Special characters](#special-characters) +- [Comments](#comments) +- [Naming restrictions](#naming-restrictions) +- [Duplicate points](#duplicate-points) + +```js +// Syntax +[,=[,=]] =[,=] [] + +// Example +myMeasurement,tag1=value1,tag2=value2 fieldKey="fieldValue" 1556813561098000000 +``` + +Lines separated by the newline character `\n` represent a single point +in InfluxDB. Line Protocol is whitespace sensitive. + +{{% note %}} +Line protocol does not support the newline character `\n` in tag or field values. +{{% /note %}} + +## Elements of Line Protocol + +``` +measurementName,tagKey=tagValue fieldKey="fieldValue" 1465839830100400200 +--------------- --------------- --------------------- ------------------- + | | | | + Measurement Tag set Field set Timestamp +``` + +### Measurement +Required – +The measurement name. +InfluxDB accepts one measurement per point. +_Measurement names are case sensitive and are subject to [naming restrictions](#naming-restrictions)._ + +_**Data type:** [String](#string)_ + + +### Tag set +_**Optional**_ – +All tag key-value pairs for the point. +Key-value relationships are denoted with the `=` operand. +Multiple tag key-value pairs are comma-delimited. +_Tag keys and values are case sensitive. +Tag keys are subject to [naming restrictions](#naming-restrictions)._ + +_**Key data type:** [String](#string)_ +_**Value data type:** [String](#string)_ + +_See [naming restrictions](#naming-restrictions)_ + +### Field set +Required – +All field key-value pairs for the point. +Points must have at least one field. +_Field keys and string values are case sensitive. +Field keys are subject to [naming restrictions](#naming-restrictions)._ + +_**Key data type:** [String](#string)_ +_**Value data type:** [Float](#float) | [Integer](#integer) | [String](#string) | [Boolean](#boolean)_ + +_See [naming restrictions](#naming-restrictions)_ + +{{% note %}} +_Always double quote string field values. More on quoting [below](#quoting)._ + +```sh +measurementName fieldKey="field string value" 1556813561098000000 +``` +{{% /note %}} + +### Timestamp +_**Optional**_ – +The Unix nanosecond timestamp for the data point. +InfluxDB accepts one timestamp per point. +If no timestamp is provided, InfluxDB uses the system time (UTC) of its host machine. + +_**Data type:** [Unix timestamp](#unix-timestamp)_ + +{{% note %}} +_InfluxDB expects a nanosecond precision timestamp, but you can specify +alternative precisions with the [InfluxDB API](#)._ +{{% /note %}} + +### Whitespace +Whitespace in line protocol determines how InfluxDB interprets the point data. +InfluxDB uses the **first unescaped space** to delimit the measurement and the tag set from the field set. +It uses the **second unescaped space** to delimit the field set from the timestamp. + +``` +measurementName,tagKey=tagValue fieldKey="fieldValue" 1465839830100400200 + ┬ ┬ + 1st space 2nd space +``` + + +## Data types and format + +### Float +IEEE-754 64-bit floating-point numbers. +This is the default numerical type. +_InfluxDB supports field values specified in scientific notation._ +Examples: `1`, `1.0`, `1.e+78`, `1.E+78`. + +##### Float field value examples +```js +myMeasurement fieldKey=1.0 +myMeasurement fieldKey=1 +myMeasurement fieldKey=-1.234456e+78 +``` + +### Integer +Signed 64-bit integers. +Specify an integer with a trailing `i` on the number. +Example: `12i`. + +| Minimum integer | Maximum integer | +| --------------- | --------------- | +| `-9223372036854775808i` | `9223372036854775807i` | + +##### Integer field value examples +```js +myMeasurement fieldKey=1i +myMeasurement fieldKey=12485903i +myMeasurement fieldKey=-12485903i +``` + +### String +Plain text string. +Length limit 64KB. + +##### String example +```sh +# String measurement name, field key, and field value +myMeasurement fieldKey="this is a string" +``` + +### Boolean +Stores `true` or `false` values. + +| Boolean value | Accepted syntax | +|:-------------:|:--------------- | +| True | `t`, `T`, `true`, `True`, `TRUE` | +| False | `f`, `F`, `false`, `False`, `FALSE` | + +##### Boolean field value examples +```js +myMeasurement fieldKey=true +myMeasurement fieldKey=false +myMeasurement fieldKey=t +myMeasurement fieldKey=f +myMeasurement fieldKey=TRUE +myMeasurement fieldKey=FALSE +``` + +{{% note %}} +Do not quote boolean field values. +Quoted field values are interpreted as strings. +{{% /note %}} + +### Unix timestamp +Unix nanosecond timestamp. + +| Minimum timestamp | Maximum timestamp | +| ----------------- | ----------------- | +| `-9223372036854775806` | `9223372036854775806` | + +##### Unix timestamp example +```js +myMeasurementName fieldKey="fieldValue" 1556813561098000000 +``` + +## Quoting +Line Protocol supports single and double quotes in specific contexts. +The table below provides quote usage recommendations for each element of Line Protocol. + +| 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._ + +## Special Characters +Line Protocol supports the use of special characters in [string elements](#syntax). +Escape the following special characters with a backslash (`\`) when used in specific contexts: + +| Element | Escape characters | +|:------- |:----------------- | +| Measurement | Comma, Space | +| Tag key | Comma, Equals Sign, Space | +| Tag value | Comma, Equals Sign, Space | +| Field key | Comma, Equals Sign, Space | +| Field value | Double quote, Backslash | + +You do not need to escape other special characters. + +##### Examples of special characters in Line Protocol +```sh +# Measurement name with spaces +my\ Measurement fieldKey="string value" + +# Double quotes in a string field value +myMeasurement fieldKey="\"string\" within a string" + +# Tag keys and values with spaces +myMeasurement,tag\ Key1=tag\ Value1,tag\ Key2=tag\ Value2 fieldKey=100 + +# Emojis +myMeasurement,tagKey=🍭 fieldKey="Launch 🚀" 1556813561098000000 +``` + +### Escaping backslashes +Line Protocol supports both literal backslashes and backslashes as an escape character. +With two contiguous backslashes, the first is interpreted as an escape character. +For example: + +| Backslashes | Intepreted as | +|:-----------:|:-------------:| +| `\` | `\` | +| `\\` | `\` | +| `\\\` | `\\` | +| `\\\\` | `\\` | +| `\\\\\` | `\\\` | +| `\\\\\\` | `\\\` | + +## Comments +Line protocol interprets `#` at the beginning of a line as a comment character +and ignores all subsequent characters until the next newline `\n`. + +```sh +# This is a comment +myMeasurement fieldKey="string value" 1556813561098000000 +``` + +## Naming restrictions +Measurement names, tag keys, and field keys cannot begin with an underscore `_`. +The `_` namespace is reserved for InfluxDB system use. + +## Duplicate points +A point is uniquely identified by the measurement name, tag set, and timestamp. +If you submit Line Protocol with the same measurement, tag set, and timestamp, +but with a different field set, the field set becomes the union of the old +field set and the new field set, where any conflicts favor the new field set. From 3ae02136d05211a535f33c1aa8cdfbb5938676e7 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 2 May 2019 17:01:11 -0600 Subject: [PATCH 04/14] listed client libraries in alphabetical order --- content/v2.0/reference/client-libraries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v2.0/reference/client-libraries.md b/content/v2.0/reference/client-libraries.md index 8ae9e1186..9e8c62f99 100644 --- a/content/v2.0/reference/client-libraries.md +++ b/content/v2.0/reference/client-libraries.md @@ -18,5 +18,5 @@ These client libraries are in active development and may not be feature-complete This list will continue to grow as more client libraries are released. {{% /note %}} -- [JavaScript/Node.js](https://github.com/influxdata/influxdb-client-js) - [Go](https://github.com/influxdata/influxdb-client-go) +- [JavaScript/Node.js](https://github.com/influxdata/influxdb-client-js) From df1de1d65a8cd026131bdd8fef7aa9af750eceaa Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 3 May 2019 08:49:35 -0600 Subject: [PATCH 05/14] WIP writing data --- content/v2.0/collect-data/write-data.md | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 content/v2.0/collect-data/write-data.md diff --git a/content/v2.0/collect-data/write-data.md b/content/v2.0/collect-data/write-data.md new file mode 100644 index 000000000..b93556bf6 --- /dev/null +++ b/content/v2.0/collect-data/write-data.md @@ -0,0 +1,56 @@ +--- +title: Write data to InfluxDB +description: > + placeholder +weight: 100 +menu: + v2_0: + name: Write data + parent: Collect data +v2.0/tags: [write, line protocol] +--- + +## Line Protocol +Write data to InfluxDB using Line Protocol, InfluxDB's text-based format for writing data points. +Each line in Line Protocol represents a data point. +Each point requires a [measurement](/v2.0/reference/line-protocol/#measurement) +and [field set](/v2.0/reference/line-protocol/#field-set) but can also include +a [tag set](/v2.0/reference/line-protocol/#tag-set) and a [timestamp](/v2.0/reference/line-protocol/#timestamp). +If data point does not include a timestamp, InfluxDB uses the system time (UTC) +of its host machine when it receives the data point. + +##### Example line protocol +```sh +mem,host=host1 used_percent=23.43234543 1556892576842902000 +cpu,host=host1 usage_user=3.8234,usage_system=4.23874 1556892726597397000 +mem,host=host1 used_percent=21.83599203 1556892777007291000 +``` + +_See the [Line Protocol reference](/v2.0/reference/line-protocol) for detailed information about writing Line Protocol._ + +## Write data using the InfluxDB v2 API +Use the `/write` API + +- Specify your organization and bucket. +- For timestamp precisions other than nanoseconds (ns), specify the precision with the `precision` query parameter. +- Authorization header with authentication token. + +```sh +curl http://localhost:9999/api/v2/write?org=033a3f2c708aa000&bucket=033a3f2c710aa000&precision=s \ + -H "Authorization: Token $INFLUX_TOKEN" \ + --data-raw "myMeasurement fieldKey=2 $(date +%s)" +``` + +## Write data using the influx CLI +The + +- Authorization header with authentication token. +- Specify your organization and bucket. +- For timestamp precisions other than nanoseconds (ns), specify the precision with the `--precision` flag + +```sh +influx write -o myOrg -b myBucket -p ms +``` + +## Dashboard +- Line protocol From 6940667e3200e5b34fdaad1eb6bf0cc62c38b7a6 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 3 May 2019 11:43:07 -0600 Subject: [PATCH 06/14] finished write data doc --- content/v2.0/collect-data/write-data.md | 116 ++++++++++++++++++++---- 1 file changed, 97 insertions(+), 19 deletions(-) diff --git a/content/v2.0/collect-data/write-data.md b/content/v2.0/collect-data/write-data.md index b93556bf6..884e8516e 100644 --- a/content/v2.0/collect-data/write-data.md +++ b/content/v2.0/collect-data/write-data.md @@ -10,14 +10,51 @@ menu: v2.0/tags: [write, line protocol] --- -## Line Protocol -Write data to InfluxDB using Line Protocol, InfluxDB's text-based format for writing data points. +Write time series data to InfluxDB using [Line Protocol](/v2.0/reference/line-protocol) +and the InfluxDB v2 API, the `influx` command line interface (CLI), or the InfluxDB +user interface (UI). + +- [Write requirements](#write-requirements) +- [Write data using the InfluxDB v2 API](#write-data-using-the-influxdb-v2-api) +- [Write data using the influx CLI](#write-data-using-the-influx-cli) +- [Write data in the InfluxDB UI](#write-data-in-the-influxdb-ui) + +## Write requirements +InfluxDB requires the following to write data. + +### Organization +The organization in which to write data. +Use your organization name or ID. + +### Bucket +The bucket in which to write data. +Use the bucket name or ID. +The bucket must belong to the specified organization. + +### Precision +_Optional_ – If the precision of the timestamps in your [Line Protocol](#line-protocol) +is anything other than nanoseconds (ns), specify the precision. +InfluxDB accepts the following precisions: + +- `ns` - Nanoseconds +- `us` - Microseconds +- `ms` - Milliseconds +- `s` - Seconds + +### Authentication token +All requests to the InfluxDB API require an [authentication token](http://localhost:1313/v2.0/security/tokens/). + +### Line protocol +Line Protocol InfluxDB's text-based format for writing data points. Each line in Line Protocol represents a data point. Each point requires a [measurement](/v2.0/reference/line-protocol/#measurement) and [field set](/v2.0/reference/line-protocol/#field-set) but can also include a [tag set](/v2.0/reference/line-protocol/#tag-set) and a [timestamp](/v2.0/reference/line-protocol/#timestamp). -If data point does not include a timestamp, InfluxDB uses the system time (UTC) -of its host machine when it receives the data point. + +{{% note %}} +_If a data point does not include a timestamp, InfluxDB uses the system time (UTC) +of its host machine when it receives the data point._ +{{% /note %}} ##### Example line protocol ```sh @@ -26,31 +63,72 @@ cpu,host=host1 usage_user=3.8234,usage_system=4.23874 1556892726597397000 mem,host=host1 used_percent=21.83599203 1556892777007291000 ``` -_See the [Line Protocol reference](/v2.0/reference/line-protocol) for detailed information about writing Line Protocol._ +_See the [Line Protocol reference](/v2.0/reference/line-protocol) for detailed information about writing Line Protocol._ + ## Write data using the InfluxDB v2 API -Use the `/write` API +Use the InfluxDB API `/write` endpoint to write data to InfluxDB. +Include [write requirements](#write-requirements) in your request: -- Specify your organization and bucket. -- For timestamp precisions other than nanoseconds (ns), specify the precision with the `precision` query parameter. -- Authorization header with authentication token. +| Requirement | Inclusion method | +|:----------- |:---------------- | +| Organization | Use the `org` query parameter in your request URL. | +| Bucket | Use the `bucket` query parameter in your request URL. | +| Precision | Use the `precision` query parameter in your request URL. | +| Authentication token | Use the `Authorization: Token` header. | +| Line protocol | Pass as plain text in your request body. | +###### Example API write request ```sh -curl http://localhost:9999/api/v2/write?org=033a3f2c708aa000&bucket=033a3f2c710aa000&precision=s \ - -H "Authorization: Token $INFLUX_TOKEN" \ - --data-raw "myMeasurement fieldKey=2 $(date +%s)" +curl "http://localhost:9999/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \ + --header "Authorization: Token YOURAUTHTOKEN" \ + --data-raw "mem,host=host1 used_percent=23.43234543 1556896326" ``` ## Write data using the influx CLI -The +Use the [`influx write` command](/v2.0/reference/cli/influx/write/) to write data to InfluxDB. +Include the [write requirements](#write-requirements) in your command: -- Authorization header with authentication token. -- Specify your organization and bucket. -- For timestamp precisions other than nanoseconds (ns), specify the precision with the `--precision` flag +| Requirement | Inclusion method | +|:----------- |:---------------- | +| Organization | Use the `-o`,`--org`, or `--org-id` flags. | +| Bucket | Use the `-b`, `--bucket`, or `--bucket-id` flags. | +| Precision | Use the the `-p`, `--precision` flag. | +| Authentication token | Set the `INFLUX_TOKEN` environment variable or use the `t`, `--token` flag. | +| Line protocol | Write a single line as a string or pass a file path prefixed with `@`. | + +##### Example influx write commands ```sh -influx write -o myOrg -b myBucket -p ms +# Write a single data point +influx write -b bucketName -o orgName -p s 'myMeasurement,host=myHost testField="testData" 1556896326' + +# Write line protocol from a file +influx write -b bucketName -o orgName -p s @/path/to/line-protocol.txt ``` -## Dashboard -- Line protocol +## Write data in the InfluxDB UI +1. Click on the **Settings** icon in the left navigation menu. + + {{< nav-icon "settings" >}} + +2. Select the **Buckets** tab. +3. Hover over the bucket into which you want to write data and click **{{< icon "plus" >}} Add Data**. +4. Select **Line Protocol**. + _You can also [use Telegraf](/v2.0/collect-data/use-telegraf/) or + [scrape data](/v2.0/collect-data/scrape-data/)._ +5. Select **Upload File** or **Enter Manually**. + + - **Upload File:** + Select the time precision of your data. + Drag and drop the Line Protocol file into the UI or click to select the + file from your file manager. + - **Enter Manually:** + Select the time precision of your data. + Manually enter Line Protocol. + +6. Click **Continue**. +7. You will receive a success or failure message depending on whether or not the data was written. +8. Click **Previous** to return to the previous dialog and add more data or correct + errors in the Line Protocol. +9. Click **Finish** to close the window. From 43468daa8f76ee71b71baee843f18c4031c190a9 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 3 May 2019 13:23:37 -0600 Subject: [PATCH 07/14] added page description to write data doc --- content/v2.0/collect-data/write-data.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/v2.0/collect-data/write-data.md b/content/v2.0/collect-data/write-data.md index 884e8516e..6bd78edcf 100644 --- a/content/v2.0/collect-data/write-data.md +++ b/content/v2.0/collect-data/write-data.md @@ -1,8 +1,10 @@ --- title: Write data to InfluxDB +list_title: Write data description: > - placeholder -weight: 100 + Write time series data to InfluxDB using Line Protocol and the InfluxDB v2 API, + the `influx` CLI, or the InfluxDB UI. +weight: 104 menu: v2_0: name: Write data From 599f3722a56ad66d724a52f5fd6ec28d8dc544b2 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 3 May 2019 13:43:28 -0600 Subject: [PATCH 08/14] renamed collect data to write data --- content/v2.0/cloud/get-started.md | 2 +- content/v2.0/collect-data/_index.md | 17 ----------------- content/v2.0/get-started.md | 4 ++-- content/v2.0/query-data/_index.md | 2 +- .../write-data.md => write-data/_index.md} | 18 ++++++++++++------ .../quick-start.md | 3 ++- .../scrape-data/_index.md | 3 ++- .../scrape-data/manage-scrapers/_index.md | 2 ++ .../manage-scrapers/create-a-scraper.md | 2 ++ .../manage-scrapers/delete-a-scraper.md | 2 ++ .../manage-scrapers/update-a-scraper.md | 4 +++- .../scrape-data/scrapable-endpoints.md | 2 ++ .../use-telegraf/_index.md | 3 ++- .../use-telegraf/auto-config/_index.md | 6 ++++-- .../auto-config/delete-telegraf-config.md | 2 ++ .../auto-config/update-telegraf-config.md | 2 ++ .../auto-config/view-telegraf-config.md | 2 ++ .../use-telegraf/manual-config.md | 4 +++- layouts/_default/version-landing.html | 4 ++-- 19 files changed, 48 insertions(+), 36 deletions(-) delete mode 100644 content/v2.0/collect-data/_index.md rename content/v2.0/{collect-data/write-data.md => write-data/_index.md} (90%) rename content/v2.0/{collect-data => write-data}/quick-start.md (97%) rename content/v2.0/{collect-data => write-data}/scrape-data/_index.md (93%) rename content/v2.0/{collect-data => write-data}/scrape-data/manage-scrapers/_index.md (85%) rename content/v2.0/{collect-data => write-data}/scrape-data/manage-scrapers/create-a-scraper.md (92%) rename content/v2.0/{collect-data => write-data}/scrape-data/manage-scrapers/delete-a-scraper.md (88%) rename content/v2.0/{collect-data => write-data}/scrape-data/manage-scrapers/update-a-scraper.md (81%) rename content/v2.0/{collect-data => write-data}/scrape-data/scrapable-endpoints.md (96%) rename content/v2.0/{collect-data => write-data}/use-telegraf/_index.md (95%) rename content/v2.0/{collect-data => write-data}/use-telegraf/auto-config/_index.md (94%) rename content/v2.0/{collect-data => write-data}/use-telegraf/auto-config/delete-telegraf-config.md (90%) rename content/v2.0/{collect-data => write-data}/use-telegraf/auto-config/update-telegraf-config.md (91%) rename content/v2.0/{collect-data => write-data}/use-telegraf/auto-config/view-telegraf-config.md (92%) rename content/v2.0/{collect-data => write-data}/use-telegraf/manual-config.md (95%) diff --git a/content/v2.0/cloud/get-started.md b/content/v2.0/cloud/get-started.md index 8a238129e..8b51d3f34 100644 --- a/content/v2.0/cloud/get-started.md +++ b/content/v2.0/cloud/get-started.md @@ -46,7 +46,7 @@ Log in at [https://us-west-2-1.aws.cloud2.influxdata.com](https://us-west-2-1.aw Use Telegraf to collect and write data to {{< cloud-name >}}. Create Telegraf configurations automatically in the UI or manually configure Telegraf. -For details, see [Automatically configure Telegraf](https://v2.docs.influxdata.com/v2.0/collect-data/use-telegraf/auto-config/#create-a-telegraf-configuration) and [Manually configure Telegraf](https://v2.docs.influxdata.com/v2.0/collect-data/use-telegraf/manual-config/). +For details, see [Automatically configure Telegraf](https://v2.docs.influxdata.com/v2.0/write-data/use-telegraf/auto-config/#create-a-telegraf-configuration) and [Manually configure Telegraf](https://v2.docs.influxdata.com/v2.0/write-data/use-telegraf/manual-config/). ## Query and visualize data diff --git a/content/v2.0/collect-data/_index.md b/content/v2.0/collect-data/_index.md deleted file mode 100644 index 5ea1521d4..000000000 --- a/content/v2.0/collect-data/_index.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: Collect data with InfluxDB 2.0 -weight: 2 -description: > - InfluxDB provides multiple ways to collect time series data including using Telegraf, - using InfluxDB's built-in data scraper, and using line protocol. -weight: 2 -menu: - v2_0: - name: Collect data ---- - -The following guides will give you a taste of how you can use the InfluxDB user -interface (UI) to collect data into InfluxDB 2.0 buckets and display the data -in dashboards. - -{{< children >}} diff --git a/content/v2.0/get-started.md b/content/v2.0/get-started.md index 009accd45..745da37ed 100644 --- a/content/v2.0/get-started.md +++ b/content/v2.0/get-started.md @@ -209,7 +209,7 @@ the `influx` command line interface (CLI). 5. Click **Continue**. InfluxDB is now initialized with a primary user, organization, and bucket. -You are ready to [collect data](/v2.0/collect-data). +You are ready to [write or collect data](/v2.0/write-data). {{% note %}} #### Using the influx CLI after setting up InfluxDB through the UI @@ -247,7 +247,7 @@ influx setup 7. Confirm the details for your primary user, organization, and bucket. InfluxDB is now initialized with a primary user, organization, and bucket. -You are ready to [collect data](/v2.0/collect-data). +You are ready to [write or collect data](/v2.0/write-data). {{% /tab-content %}} diff --git a/content/v2.0/query-data/_index.md b/content/v2.0/query-data/_index.md index 6f520431a..53a771091 100644 --- a/content/v2.0/query-data/_index.md +++ b/content/v2.0/query-data/_index.md @@ -7,7 +7,7 @@ description: > menu: v2_0: name: Query data -weight: 2 +weight: 3 v2.0/tags: [query, flux] --- diff --git a/content/v2.0/collect-data/write-data.md b/content/v2.0/write-data/_index.md similarity index 90% rename from content/v2.0/collect-data/write-data.md rename to content/v2.0/write-data/_index.md index 6bd78edcf..53d20b1ce 100644 --- a/content/v2.0/collect-data/write-data.md +++ b/content/v2.0/write-data/_index.md @@ -2,24 +2,26 @@ title: Write data to InfluxDB list_title: Write data description: > - Write time series data to InfluxDB using Line Protocol and the InfluxDB v2 API, - the `influx` CLI, or the InfluxDB UI. -weight: 104 + InfluxDB provides multiple ways to write and collect time series data + by using Line Protocol, Telegraf, data scrapers, the InfluxDB v2 API, `influx` CLI, + and the InfluxDB UI. +weight: 2 menu: v2_0: name: Write data - parent: Collect data v2.0/tags: [write, line protocol] --- -Write time series data to InfluxDB using [Line Protocol](/v2.0/reference/line-protocol) -and the InfluxDB v2 API, the `influx` command line interface (CLI), or the InfluxDB +InfluxDB provides multiple ways to write and collect time series data +by using [Line Protocol](/v2.0/reference/line-protocol), Telegraf, data scrapers, +the InfluxDB v2 API, `influx` command line interface (CLI), and the InfluxDB user interface (UI). - [Write requirements](#write-requirements) - [Write data using the InfluxDB v2 API](#write-data-using-the-influxdb-v2-api) - [Write data using the influx CLI](#write-data-using-the-influx-cli) - [Write data in the InfluxDB UI](#write-data-in-the-influxdb-ui) +- [Other ways to write data to InfluxDB](#other-ways-to-write-data-to-influxdb) ## Write requirements InfluxDB requires the following to write data. @@ -134,3 +136,7 @@ influx write -b bucketName -o orgName -p s @/path/to/line-protocol.txt 8. Click **Previous** to return to the previous dialog and add more data or correct errors in the Line Protocol. 9. Click **Finish** to close the window. + +## Other ways to write data to InfluxDB + +{{< children >}} diff --git a/content/v2.0/collect-data/quick-start.md b/content/v2.0/write-data/quick-start.md similarity index 97% rename from content/v2.0/collect-data/quick-start.md rename to content/v2.0/write-data/quick-start.md index aa395863e..8001799b1 100644 --- a/content/v2.0/collect-data/quick-start.md +++ b/content/v2.0/write-data/quick-start.md @@ -6,10 +6,11 @@ description: > that collects InfluxDB metrics from the InfluxDB `/metrics` endpoint. aliases: - /v2.0/collect-data/scraper-quickstart + - /v2.0/collect-data/quick-start menu: v2_0: name: Quick start - parent: Collect data + parent: Write data weight: 101 --- diff --git a/content/v2.0/collect-data/scrape-data/_index.md b/content/v2.0/write-data/scrape-data/_index.md similarity index 93% rename from content/v2.0/collect-data/scrape-data/_index.md rename to content/v2.0/write-data/scrape-data/_index.md index a50673c1f..988eeff25 100644 --- a/content/v2.0/collect-data/scrape-data/_index.md +++ b/content/v2.0/write-data/scrape-data/_index.md @@ -7,11 +7,12 @@ description: > Create a scraper in the InfluxDB UI to collect metrics from a specified target. aliases: - /v2.0/collect-data/scraper-metrics-endpoint + - /v2.0/collect-data/scrape-data v2.0/tags: [scraper] menu: v2_0: name: Scrape data - parent: Collect data + parent: Write data --- InfluxDB scrapers collect data from specified targets at regular intervals, diff --git a/content/v2.0/collect-data/scrape-data/manage-scrapers/_index.md b/content/v2.0/write-data/scrape-data/manage-scrapers/_index.md similarity index 85% rename from content/v2.0/collect-data/scrape-data/manage-scrapers/_index.md rename to content/v2.0/write-data/scrape-data/manage-scrapers/_index.md index ee0f6c5f9..0f1b7d099 100644 --- a/content/v2.0/collect-data/scrape-data/manage-scrapers/_index.md +++ b/content/v2.0/write-data/scrape-data/manage-scrapers/_index.md @@ -2,6 +2,8 @@ title: Manage scrapers seotitle: Manage InfluxDB scrapers description: Create, update, and delete InfluxDB data scrapers in the InfluxDB user interface. +aliases: + - /v2.0/collect-data/scrape-data/manage-scrapers menu: v2_0: name: Manage scrapers diff --git a/content/v2.0/collect-data/scrape-data/manage-scrapers/create-a-scraper.md b/content/v2.0/write-data/scrape-data/manage-scrapers/create-a-scraper.md similarity index 92% rename from content/v2.0/collect-data/scrape-data/manage-scrapers/create-a-scraper.md rename to content/v2.0/write-data/scrape-data/manage-scrapers/create-a-scraper.md index 311f6635c..75f521b0f 100644 --- a/content/v2.0/collect-data/scrape-data/manage-scrapers/create-a-scraper.md +++ b/content/v2.0/write-data/scrape-data/manage-scrapers/create-a-scraper.md @@ -2,6 +2,8 @@ title: Create a scraper seotitle: Create an InfluxDB scraper description: Create an InfluxDB scraper that collects data from InfluxDB or a remote endpoint. +aliases: + - /v2.0/collect-data/scrape-data/manage-scrapers/create-a-scraper menu: v2_0: parent: Manage scrapers diff --git a/content/v2.0/collect-data/scrape-data/manage-scrapers/delete-a-scraper.md b/content/v2.0/write-data/scrape-data/manage-scrapers/delete-a-scraper.md similarity index 88% rename from content/v2.0/collect-data/scrape-data/manage-scrapers/delete-a-scraper.md rename to content/v2.0/write-data/scrape-data/manage-scrapers/delete-a-scraper.md index e0dcaf486..646658dfc 100644 --- a/content/v2.0/collect-data/scrape-data/manage-scrapers/delete-a-scraper.md +++ b/content/v2.0/write-data/scrape-data/manage-scrapers/delete-a-scraper.md @@ -2,6 +2,8 @@ title: Delete a scraper seotitle: Delete an InfluxDB scraper description: Delete an InfluxDB scraper in the InfluxDB user interface. +aliases: + - /v2.0/collect-data/scrape-data/manage-scrapers/delete-a-scraper menu: v2_0: parent: Manage scrapers diff --git a/content/v2.0/collect-data/scrape-data/manage-scrapers/update-a-scraper.md b/content/v2.0/write-data/scrape-data/manage-scrapers/update-a-scraper.md similarity index 81% rename from content/v2.0/collect-data/scrape-data/manage-scrapers/update-a-scraper.md rename to content/v2.0/write-data/scrape-data/manage-scrapers/update-a-scraper.md index 4ac150f13..b6cf1c67c 100644 --- a/content/v2.0/collect-data/scrape-data/manage-scrapers/update-a-scraper.md +++ b/content/v2.0/write-data/scrape-data/manage-scrapers/update-a-scraper.md @@ -2,6 +2,8 @@ title: Update a scraper seotitle: Update an InfluxDB scraper description: Update an InfluxDB scraper that collects data from InfluxDB or a remote endpoint. +aliases: + - /v2.0/collect-data/scrape-data/manage-scrapers/update-a-scraper menu: v2_0: parent: Manage scrapers @@ -12,7 +14,7 @@ Update a scraper in the InfluxDB user interface (UI). {{% note %}} Scraper **Target URLs** and **BUCKETS** can not be updated. -To modify either, [create a new scraper](/v2.0/collect-data/scrape-data/manage-scrapers/create-a-scraper). +To modify either, [create a new scraper](/v2.0/write-data/scrape-data/manage-scrapers/create-a-scraper). {{% /note %}} ## Update a scraper in the InfluxDB UI diff --git a/content/v2.0/collect-data/scrape-data/scrapable-endpoints.md b/content/v2.0/write-data/scrape-data/scrapable-endpoints.md similarity index 96% rename from content/v2.0/collect-data/scrape-data/scrapable-endpoints.md rename to content/v2.0/write-data/scrape-data/scrapable-endpoints.md index d409fa87b..20b39494f 100644 --- a/content/v2.0/collect-data/scrape-data/scrapable-endpoints.md +++ b/content/v2.0/write-data/scrape-data/scrapable-endpoints.md @@ -6,6 +6,8 @@ description: > returns data in the Prometheus data format. This article provides links to information about the Prometheus data format and tools that generate Prometheus-formatted metrics. +aliases: + - /v2.0/collect-data/scrape-data/scrapable-endpoints menu: v2_0: parent: Scrape data diff --git a/content/v2.0/collect-data/use-telegraf/_index.md b/content/v2.0/write-data/use-telegraf/_index.md similarity index 95% rename from content/v2.0/collect-data/use-telegraf/_index.md rename to content/v2.0/write-data/use-telegraf/_index.md index 8c56d36db..87ccf6402 100644 --- a/content/v2.0/collect-data/use-telegraf/_index.md +++ b/content/v2.0/write-data/use-telegraf/_index.md @@ -8,10 +8,11 @@ description: > Create Telegraf configurations in the InfluxDB UI or manually configure Telegraf. aliases: - /v2.0/collect-data/advanced-telegraf + - /v2.0/collect-data/use-telegraf menu: v2_0: name : Use Telegraf - parent: Collect data + parent: Write data --- diff --git a/content/v2.0/collect-data/use-telegraf/auto-config/_index.md b/content/v2.0/write-data/use-telegraf/auto-config/_index.md similarity index 94% rename from content/v2.0/collect-data/use-telegraf/auto-config/_index.md rename to content/v2.0/write-data/use-telegraf/auto-config/_index.md index e4271ccae..aaca5632d 100644 --- a/content/v2.0/collect-data/use-telegraf/auto-config/_index.md +++ b/content/v2.0/write-data/use-telegraf/auto-config/_index.md @@ -4,6 +4,8 @@ seotitle: Automatically configure Telegraf for InfluxDB v2.0 description: > Use the InfluxDB UI to automatically generate a Telegraf configuration, then start Telegraf using the generated configuration file. +aliases: + - /v2.0/collect-data/use-telegraf/auto-config menu: v2_0: parent: Use Telegraf @@ -16,7 +18,7 @@ This article describes how to create a Telegraf configuration in the InfluxDB UI start Telegraf using the generated configuration file. {{% note %}} -_View the [requirements](/v2.0/collect-data/use-telegraf#requirements) +_View the [requirements](/v2.0/write-data/use-telegraf#requirements) for using Telegraf with InfluxDB v2.0._ {{% /note %}} @@ -35,7 +37,7 @@ for using Telegraf with InfluxDB v2.0._ (e.g. **System**, **Docker**, **Kubernetes**, **NGINX**, or **Redis**), and click **Continue**. {{% note %}} All Telegraf plugins are supported, but only a subset are configurable using the InfluxDB UI. - To use plugins other than those listed, you must [manually configure Telegraf](/v2.0/collect-data/use-telegraf/manual-config). + To use plugins other than those listed, you must [manually configure Telegraf](/v2.0/write-data/use-telegraf/manual-config). {{% /note %}} 8. Review the list of **Plugins to Configure** for configuration requirements. Plugins listed with a {{< icon "check" >}} diff --git a/content/v2.0/collect-data/use-telegraf/auto-config/delete-telegraf-config.md b/content/v2.0/write-data/use-telegraf/auto-config/delete-telegraf-config.md similarity index 90% rename from content/v2.0/collect-data/use-telegraf/auto-config/delete-telegraf-config.md rename to content/v2.0/write-data/use-telegraf/auto-config/delete-telegraf-config.md index c3464444a..d68a54f60 100644 --- a/content/v2.0/collect-data/use-telegraf/auto-config/delete-telegraf-config.md +++ b/content/v2.0/write-data/use-telegraf/auto-config/delete-telegraf-config.md @@ -2,6 +2,8 @@ title: Delete a Telegraf configuration seotitle: Delete a Telegraf configuration from the InfluxDB UI description: Delete a Telegraf configuration created in the InfluxDB UI. +aliases: + - /v2.0/collect-data/use-telegraf/auto-config/delete-telegraf-config menu: v2_0: parent: Automatically configure Telegraf diff --git a/content/v2.0/collect-data/use-telegraf/auto-config/update-telegraf-config.md b/content/v2.0/write-data/use-telegraf/auto-config/update-telegraf-config.md similarity index 91% rename from content/v2.0/collect-data/use-telegraf/auto-config/update-telegraf-config.md rename to content/v2.0/write-data/use-telegraf/auto-config/update-telegraf-config.md index 442638d32..1f001756f 100644 --- a/content/v2.0/collect-data/use-telegraf/auto-config/update-telegraf-config.md +++ b/content/v2.0/write-data/use-telegraf/auto-config/update-telegraf-config.md @@ -2,6 +2,8 @@ title: Update a Telegraf configuration seotitle: Update Telegraf configurations in the InfluxDB UI description: Update the name and description of a Telegraf configuration created in the InfluxDB UI. +aliases: + - /v2.0/collect-data/use-telegraf/auto-config/update-telegraf-config menu: v2_0: parent: Automatically configure Telegraf diff --git a/content/v2.0/collect-data/use-telegraf/auto-config/view-telegraf-config.md b/content/v2.0/write-data/use-telegraf/auto-config/view-telegraf-config.md similarity index 92% rename from content/v2.0/collect-data/use-telegraf/auto-config/view-telegraf-config.md rename to content/v2.0/write-data/use-telegraf/auto-config/view-telegraf-config.md index 987b5cfd6..ffe46cb51 100644 --- a/content/v2.0/collect-data/use-telegraf/auto-config/view-telegraf-config.md +++ b/content/v2.0/write-data/use-telegraf/auto-config/view-telegraf-config.md @@ -4,6 +4,8 @@ seotitle: View a Telegraf configuration in the InfluxDB UI description: > View the `telegraf.conf` and setup instructions associated with a Telegraf configuration created in the InfluxDB UI. +aliases: + - /v2.0/collect-data/use-telegraf/auto-config/view-telegraf-config menu: v2_0: parent: Automatically configure Telegraf diff --git a/content/v2.0/collect-data/use-telegraf/manual-config.md b/content/v2.0/write-data/use-telegraf/manual-config.md similarity index 95% rename from content/v2.0/collect-data/use-telegraf/manual-config.md rename to content/v2.0/write-data/use-telegraf/manual-config.md index cc9043623..ff7b7f2c5 100644 --- a/content/v2.0/collect-data/use-telegraf/manual-config.md +++ b/content/v2.0/write-data/use-telegraf/manual-config.md @@ -4,6 +4,8 @@ seotitle: Manually configure Telegraf for InfluxDB v2.0 description: > Manually configure Telegraf to write to InfluxDB v2.0 using the Telegraf `influxdb_v2` output plugin, and then start Telegraf using the custom configuration. +aliases: + - /v2.0/collect-data/use-telegraf/manual-config menu: v2_0: parent: Use Telegraf @@ -16,7 +18,7 @@ This article describes how to enable the `influxdb_v2` output plugin, and then start Telegraf using the custom configuration file. {{% note %}} -_View the [requirements](/v2.0/collect-data/use-telegraf#requirements) +_View the [requirements](/v2.0/write-data/use-telegraf#requirements) for using Telegraf with InfluxDB v2.0._ {{% /note %}} diff --git a/layouts/_default/version-landing.html b/layouts/_default/version-landing.html index a74423a9c..53fa4d580 100644 --- a/layouts/_default/version-landing.html +++ b/layouts/_default/version-landing.html @@ -13,8 +13,8 @@
- -

Collect Data

+
+

Write Data

From 23d0c52c3b0be055fa2f9211650c50307278f658 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 3 May 2019 13:53:18 -0600 Subject: [PATCH 09/14] minor updates to write data --- content/v2.0/write-data/_index.md | 14 +++++++++----- content/v2.0/write-data/quick-start.md | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/content/v2.0/write-data/_index.md b/content/v2.0/write-data/_index.md index 53d20b1ce..e96d5dfd9 100644 --- a/content/v2.0/write-data/_index.md +++ b/content/v2.0/write-data/_index.md @@ -14,8 +14,8 @@ v2.0/tags: [write, line protocol] InfluxDB provides multiple ways to write and collect time series data by using [Line Protocol](/v2.0/reference/line-protocol), Telegraf, data scrapers, -the InfluxDB v2 API, `influx` command line interface (CLI), and the InfluxDB -user interface (UI). +the InfluxDB v2 API, `influx` command line interface (CLI), the InfluxDB +user interface (UI), and client libraries. - [Write requirements](#write-requirements) - [Write data using the InfluxDB v2 API](#write-data-using-the-influxdb-v2-api) @@ -46,7 +46,7 @@ InfluxDB accepts the following precisions: - `s` - Seconds ### Authentication token -All requests to the InfluxDB API require an [authentication token](http://localhost:1313/v2.0/security/tokens/). +All InfluxDB write interactions require an [authentication token](http://localhost:1313/v2.0/security/tokens/). ### Line protocol Line Protocol InfluxDB's text-based format for writing data points. @@ -119,8 +119,8 @@ influx write -b bucketName -o orgName -p s @/path/to/line-protocol.txt 2. Select the **Buckets** tab. 3. Hover over the bucket into which you want to write data and click **{{< icon "plus" >}} Add Data**. 4. Select **Line Protocol**. - _You can also [use Telegraf](/v2.0/collect-data/use-telegraf/) or - [scrape data](/v2.0/collect-data/scrape-data/)._ + _You can also [use Telegraf](/v2.0/write-data/use-telegraf/) or + [scrape data](/v2.0/write-data/scrape-data/)._ 5. Select **Upload File** or **Enter Manually**. - **Upload File:** @@ -140,3 +140,7 @@ influx write -b bucketName -o orgName -p s @/path/to/line-protocol.txt ## Other ways to write data to InfluxDB {{< children >}} + +### InfluxDB client libraries +InfluxDB provides language-specific client libraries that integrate with the InfluxDB v2 API. +See [Client libraries reference](/v2.0/reference/client-libraries/) for more information. diff --git a/content/v2.0/write-data/quick-start.md b/content/v2.0/write-data/quick-start.md index 8001799b1..f6d5a6d72 100644 --- a/content/v2.0/write-data/quick-start.md +++ b/content/v2.0/write-data/quick-start.md @@ -24,7 +24,7 @@ After [setting up InfluxDB v2.0](/v2.0/get-started/#set-up-influxdb), the "Let's start collecting data!" page displays options for collecting data. Click **Quick Start**. -InfluxDB creates and configures a new [scraper](/v2.0/collect-data/scrape-data/). +InfluxDB creates and configures a new [scraper](/v2.0/write-data/scrape-data/). The target URL points to the `/metrics` HTTP endpoint of your local InfluxDB instance (e.g. `http://localhost:9999/metrics`), which outputs internal InfluxDB metrics in the [Prometheus data format](https://prometheus.io/docs/instrumenting/exposition_formats/). It stores the scraped metrics in the bucket created during the [initial setup process](/v2.0/get-started/#set-up-influxdb). @@ -35,7 +35,7 @@ The following message briefly appears in the UI: {{% note %}} Quick Start is available only in the last step of the setup process. -If you missed the Quick Start option, you can [manually create a scraper](/v2.0/collect-data/scrape-data) +If you missed the Quick Start option, you can [manually create a scraper](/v2.0/write-data/scrape-data) that scrapes data from the `/metrics` endpoint. {{% /note %}} From 90661c435b1d6bcc0044f179b12afeaef2d56cc7 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 3 May 2019 14:16:10 -0600 Subject: [PATCH 10/14] added note to map function about dropped columns, resolves #217 --- .../functions/built-in/transformations/map.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/map.md b/content/v2.0/reference/flux/functions/built-in/transformations/map.md index 8a8dfa775..78756b4f8 100644 --- a/content/v2.0/reference/flux/functions/built-in/transformations/map.md +++ b/content/v2.0/reference/flux/functions/built-in/transformations/map.md @@ -24,6 +24,25 @@ _**Output data type:** Object_ map(fn: (r) => r._value * r._value), mergeKey: true) ``` +{{% note %}} +#### Dropped columns +`map()` drops any columns that: + +1. Are not part of the input table's group key +2. Are not explicitly mapped in the `map()` function. + +This often results in the `_time` column being dropped. +To preserve the `_time` column, include it in your column mapping. + +```js +map(fn: (r) => ({ + _time: r._time, + ... + }) +) +``` +{{% /note %}} + ## Parameters ### fn From 2354d7a75450a7bf9af4a98e03fb06af92187090 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 6 May 2019 08:46:18 -0600 Subject: [PATCH 11/14] updates to line protocol doc to address PR feedback --- content/v2.0/reference/line-protocol.md | 46 +++++++++++-------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/content/v2.0/reference/line-protocol.md b/content/v2.0/reference/line-protocol.md index a7866cae9..0074da158 100644 --- a/content/v2.0/reference/line-protocol.md +++ b/content/v2.0/reference/line-protocol.md @@ -1,8 +1,8 @@ --- title: Line protocol reference description: > - Line Protocol is a text based format for writing data points to InfluxDB. - It provides InfluxDB the measurement, tag set, field set, and timestamp of a data point. + InfluxDB uses Line Protocol to write data points. + It is a text-based format that provides the measurement, tag set, field set, and timestamp of a data point. menu: v2_0_ref: name: Line protocol @@ -10,12 +10,12 @@ weight: 6 v2.0/tags: [write, line protocol] --- -Line Protocol is a text based format for writing data points to InfluxDB. -It provides InfluxDB the measurement, tag set, field set, and timestamp of a data point. +InfluxDB uses Line Protocol to write data points. +It is a text-based format that provides the measurement, tag set, field set, and timestamp of a data point. - [Elements of Line Protocol](#elements-of-line-protocol) - [Data types and format](#data-types-and-format) -- [Quoting](#quoting) +- [Quotes](#quotes) - [Special characters](#special-characters) - [Comments](#comments) - [Naming restrictions](#naming-restrictions) @@ -49,7 +49,7 @@ measurementName,tagKey=tagValue fieldKey="fieldValue" 1465839830100400200 Required – The measurement name. InfluxDB accepts one measurement per point. -_Measurement names are case sensitive and are subject to [naming restrictions](#naming-restrictions)._ +_Measurement names are case-sensitive and subject to [naming restrictions](#naming-restrictions)._ _**Data type:** [String](#string)_ @@ -59,7 +59,7 @@ _**Optional**_ – All tag key-value pairs for the point. Key-value relationships are denoted with the `=` operand. Multiple tag key-value pairs are comma-delimited. -_Tag keys and values are case sensitive. +_Tag keys and tag values are case-sensitive. Tag keys are subject to [naming restrictions](#naming-restrictions)._ _**Key data type:** [String](#string)_ @@ -71,7 +71,7 @@ _See [naming restrictions](#naming-restrictions)_ Required – All field key-value pairs for the point. Points must have at least one field. -_Field keys and string values are case sensitive. +_Field keys and string values are case-sensitive. Field keys are subject to [naming restrictions](#naming-restrictions)._ _**Key data type:** [String](#string)_ @@ -80,7 +80,7 @@ _**Value data type:** [Float](#float) | [Integer](#integer) | [String](#string) _See [naming restrictions](#naming-restrictions)_ {{% note %}} -_Always double quote string field values. More on quoting [below](#quoting)._ +_Always double quote string field values. More on quotes [below](#quotes)._ ```sh measurementName fieldKey="field string value" 1556813561098000000 @@ -96,14 +96,14 @@ If no timestamp is provided, InfluxDB uses the system time (UTC) of its host mac _**Data type:** [Unix timestamp](#unix-timestamp)_ {{% note %}} -_InfluxDB expects a nanosecond precision timestamp, but you can specify -alternative precisions with the [InfluxDB API](#)._ +_Use the default nanosecond precision timestamp or specify an alternative precision +when [writing the data](/v2.0/write-data/)._ {{% /note %}} ### Whitespace -Whitespace in line protocol determines how InfluxDB interprets the point data. -InfluxDB uses the **first unescaped space** to delimit the measurement and the tag set from the field set. -It uses the **second unescaped space** to delimit the field set from the timestamp. +Whitespace in line protocol determines how InfluxDB interprets the data point. +The **first unescaped space** delimits the measurement and the tag set from the field set. +The **second unescaped space** delimits the field set from the timestamp. ``` measurementName,tagKey=tagValue fieldKey="fieldValue" 1465839830100400200 @@ -111,14 +111,12 @@ measurementName,tagKey=tagValue fieldKey="fieldValue" 1465839830100400200 1st space 2nd space ``` - ## Data types and format ### Float IEEE-754 64-bit floating-point numbers. -This is the default numerical type. -_InfluxDB supports field values specified in scientific notation._ -Examples: `1`, `1.0`, `1.e+78`, `1.E+78`. +Default numerical type. +_InfluxDB supports scientific notation in float field values._ ##### Float field value examples ```js @@ -129,8 +127,7 @@ myMeasurement fieldKey=-1.234456e+78 ### Integer Signed 64-bit integers. -Specify an integer with a trailing `i` on the number. -Example: `12i`. +Trailing `i` on the number specifies an integer. | Minimum integer | Maximum integer | | --------------- | --------------- | @@ -188,9 +185,8 @@ Unix nanosecond timestamp. myMeasurementName fieldKey="fieldValue" 1556813561098000000 ``` -## Quoting -Line Protocol supports single and double quotes in specific contexts. -The table below provides quote usage recommendations for each element of Line Protocol. +## Quotes +Line Protocol supports single and double quotes as described in the following table: | Element | Double quotes | Single quotes | | :------ | :------------: |:-------------: | @@ -206,8 +202,8 @@ measurement names, tag keys, tag values, and field keys, but interprets them as part of the name, key, or value._ ## Special Characters -Line Protocol supports the use of special characters in [string elements](#syntax). -Escape the following special characters with a backslash (`\`) when used in specific contexts: +Line Protocol supports special characters in [string elements](#string). +In the following contexts, it requires escaping certain characters with a backslash (`\`): | Element | Escape characters | |:------- |:----------------- | From c0a5e94e9a48b0e8579ecf30b55ddb6e62ec373d Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 6 May 2019 20:42:37 -0600 Subject: [PATCH 12/14] corrected use of line protocol --- content/v2.0/reference/line-protocol.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/content/v2.0/reference/line-protocol.md b/content/v2.0/reference/line-protocol.md index 0074da158..9b1d25ae4 100644 --- a/content/v2.0/reference/line-protocol.md +++ b/content/v2.0/reference/line-protocol.md @@ -1,7 +1,7 @@ --- title: Line protocol reference description: > - InfluxDB uses Line Protocol to write data points. + InfluxDB uses line protocol to write data points. It is a text-based format that provides the measurement, tag set, field set, and timestamp of a data point. menu: v2_0_ref: @@ -10,10 +10,10 @@ weight: 6 v2.0/tags: [write, line protocol] --- -InfluxDB uses Line Protocol to write data points. +InfluxDB uses line protocol to write data points. It is a text-based format that provides the measurement, tag set, field set, and timestamp of a data point. -- [Elements of Line Protocol](#elements-of-line-protocol) +- [Elements of line protocol](#elements-of-line-protocol) - [Data types and format](#data-types-and-format) - [Quotes](#quotes) - [Special characters](#special-characters) @@ -30,13 +30,13 @@ myMeasurement,tag1=value1,tag2=value2 fieldKey="fieldValue" 1556813561098000000 ``` Lines separated by the newline character `\n` represent a single point -in InfluxDB. Line Protocol is whitespace sensitive. +in InfluxDB. Line protocol is whitespace sensitive. {{% note %}} Line protocol does not support the newline character `\n` in tag or field values. {{% /note %}} -## Elements of Line Protocol +## Elements of line protocol ``` measurementName,tagKey=tagValue fieldKey="fieldValue" 1465839830100400200 @@ -97,7 +97,7 @@ _**Data type:** [Unix timestamp](#unix-timestamp)_ {{% note %}} _Use the default nanosecond precision timestamp or specify an alternative precision -when [writing the data](/v2.0/write-data/)._ +when [writing the data](/v2.0/write-data/#precision)._ {{% /note %}} ### Whitespace @@ -186,7 +186,7 @@ myMeasurementName fieldKey="fieldValue" 1556813561098000000 ``` ## Quotes -Line Protocol supports single and double quotes as described in the following table: +Line protocol supports single and double quotes as described in the following table: | Element | Double quotes | Single quotes | | :------ | :------------: |:-------------: | @@ -202,7 +202,7 @@ measurement names, tag keys, tag values, and field keys, but interprets them as part of the name, key, or value._ ## Special Characters -Line Protocol supports special characters in [string elements](#string). +Line protocol supports special characters in [string elements](#string). In the following contexts, it requires escaping certain characters with a backslash (`\`): | Element | Escape characters | @@ -215,7 +215,7 @@ In the following contexts, it requires escaping certain characters with a backsl You do not need to escape other special characters. -##### Examples of special characters in Line Protocol +##### Examples of special characters in line protocol ```sh # Measurement name with spaces my\ Measurement fieldKey="string value" @@ -231,7 +231,7 @@ myMeasurement,tagKey=🍭 fieldKey="Launch 🚀" 1556813561098000000 ``` ### Escaping backslashes -Line Protocol supports both literal backslashes and backslashes as an escape character. +Line protocol supports both literal backslashes and backslashes as an escape character. With two contiguous backslashes, the first is interpreted as an escape character. For example: @@ -259,6 +259,6 @@ The `_` namespace is reserved for InfluxDB system use. ## Duplicate points A point is uniquely identified by the measurement name, tag set, and timestamp. -If you submit Line Protocol with the same measurement, tag set, and timestamp, +If you submit line protocol with the same measurement, tag set, and timestamp, but with a different field set, the field set becomes the union of the old field set and the new field set, where any conflicts favor the new field set. From 51d69a3119deba8e9641ec801354bdaaa63a22e0 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 6 May 2019 21:09:01 -0600 Subject: [PATCH 13/14] updated write data doc to address PR feedback --- content/v2.0/write-data/_index.md | 67 +++++++++++++------------- content/v2.0/write-data/quick-start.md | 10 ++-- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/content/v2.0/write-data/_index.md b/content/v2.0/write-data/_index.md index e96d5dfd9..53e5756bd 100644 --- a/content/v2.0/write-data/_index.md +++ b/content/v2.0/write-data/_index.md @@ -2,9 +2,8 @@ title: Write data to InfluxDB list_title: Write data description: > - InfluxDB provides multiple ways to write and collect time series data - by using Line Protocol, Telegraf, data scrapers, the InfluxDB v2 API, `influx` CLI, - and the InfluxDB UI. + Collect and write time series data to InfluxDB using line protocol, Telegraf, data scrapers, + the InfluxDB v2 API, `influx` CLI, the InfluxDB UI, and client libaries. weight: 2 menu: v2_0: @@ -12,19 +11,19 @@ menu: v2.0/tags: [write, line protocol] --- -InfluxDB provides multiple ways to write and collect time series data -by using [Line Protocol](/v2.0/reference/line-protocol), Telegraf, data scrapers, -the InfluxDB v2 API, `influx` command line interface (CLI), the InfluxDB -user interface (UI), and client libraries. +Collect and write time series data to InfluxDB using [line protocol](/v2.0/reference/line-protocol), +Telegraf, data scrapers, the InfluxDB v2 API, `influx` command line interface (CLI), +the InfluxDB user interface (UI), and client libraries. -- [Write requirements](#write-requirements) -- [Write data using the InfluxDB v2 API](#write-data-using-the-influxdb-v2-api) -- [Write data using the influx CLI](#write-data-using-the-influx-cli) -- [Write data in the InfluxDB UI](#write-data-in-the-influxdb-ui) +- [Requirements to write data](#requirements-to-write-data) +- [InfluxDB v2 API](#write-data-using-the-influxdb-v2-api) +- [influx CLI](#write-data-using-the-influx-cli) +- [InfluxDB UI](#write-data-in-the-influxdb-ui) - [Other ways to write data to InfluxDB](#other-ways-to-write-data-to-influxdb) -## Write requirements -InfluxDB requires the following to write data. +## Requirements to write data +To write data to InfluxDB, you must have an organization, bucket, authentication token, +and data formatted in line protocol. ### Organization The organization in which to write data. @@ -36,8 +35,11 @@ Use the bucket name or ID. The bucket must belong to the specified organization. ### Precision -_Optional_ – If the precision of the timestamps in your [Line Protocol](#line-protocol) -is anything other than nanoseconds (ns), specify the precision. +The precision of timestamps provided in the line protocol. +Default timestamp precision is in nanoseconds. + +If the precision of the timestamps is anything other than nanoseconds (ns), +you must specify the precision in your write request. InfluxDB accepts the following precisions: - `ns` - Nanoseconds @@ -49,8 +51,8 @@ InfluxDB accepts the following precisions: All InfluxDB write interactions require an [authentication token](http://localhost:1313/v2.0/security/tokens/). ### Line protocol -Line Protocol InfluxDB's text-based format for writing data points. -Each line in Line Protocol represents a data point. +Use line protocol to write data points to InfluxDB. +Each line represents a data point. Each point requires a [measurement](/v2.0/reference/line-protocol/#measurement) and [field set](/v2.0/reference/line-protocol/#field-set) but can also include a [tag set](/v2.0/reference/line-protocol/#tag-set) and a [timestamp](/v2.0/reference/line-protocol/#timestamp). @@ -67,15 +69,15 @@ cpu,host=host1 usage_user=3.8234,usage_system=4.23874 1556892726597397000 mem,host=host1 used_percent=21.83599203 1556892777007291000 ``` -_See the [Line Protocol reference](/v2.0/reference/line-protocol) for detailed information about writing Line Protocol._ +_For details about line protocol, see the [Line protocol reference](/v2.0/reference/line-protocol) ._ ## Write data using the InfluxDB v2 API Use the InfluxDB API `/write` endpoint to write data to InfluxDB. -Include [write requirements](#write-requirements) in your request: +Include the following in your request: -| Requirement | Inclusion method | -|:----------- |:---------------- | +| Requirement | Include by | +|:----------- |:---------- | | Organization | Use the `org` query parameter in your request URL. | | Bucket | Use the `bucket` query parameter in your request URL. | | Precision | Use the `precision` query parameter in your request URL. | @@ -91,10 +93,10 @@ curl "http://localhost:9999/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precisi ## Write data using the influx CLI Use the [`influx write` command](/v2.0/reference/cli/influx/write/) to write data to InfluxDB. -Include the [write requirements](#write-requirements) in your command: +Include the following in your command: -| Requirement | Inclusion method | -|:----------- |:---------------- | +| Requirement | Include by | +|:----------- |:---------- | | Organization | Use the `-o`,`--org`, or `--org-id` flags. | | Bucket | Use the `-b`, `--bucket`, or `--bucket-id` flags. | | Precision | Use the the `-p`, `--precision` flag. | @@ -112,12 +114,12 @@ influx write -b bucketName -o orgName -p s @/path/to/line-protocol.txt ``` ## Write data in the InfluxDB UI -1. Click on the **Settings** icon in the left navigation menu. +1. Click **Settings** in the left navigation menu. {{< nav-icon "settings" >}} 2. Select the **Buckets** tab. -3. Hover over the bucket into which you want to write data and click **{{< icon "plus" >}} Add Data**. +3. Hover over the bucket to write data to and click **{{< icon "plus" >}} Add Data**. 4. Select **Line Protocol**. _You can also [use Telegraf](/v2.0/write-data/use-telegraf/) or [scrape data](/v2.0/write-data/scrape-data/)._ @@ -125,22 +127,21 @@ influx write -b bucketName -o orgName -p s @/path/to/line-protocol.txt - **Upload File:** Select the time precision of your data. - Drag and drop the Line Protocol file into the UI or click to select the + Drag and drop the line protocol file into the UI or click to select the file from your file manager. - **Enter Manually:** Select the time precision of your data. - Manually enter Line Protocol. + Manually enter line protocol. 6. Click **Continue**. -7. You will receive a success or failure message depending on whether or not the data was written. -8. Click **Previous** to return to the previous dialog and add more data or correct - errors in the Line Protocol. -9. Click **Finish** to close the window. + A message indicates whether data is successfully written to InfluxDB. +7. To add more data or correct line protocol, click **Previous**. +8. Click **Finish**. ## Other ways to write data to InfluxDB {{< children >}} ### InfluxDB client libraries -InfluxDB provides language-specific client libraries that integrate with the InfluxDB v2 API. +Use language-specific client libraries to integrate with the InfluxDB v2 API. See [Client libraries reference](/v2.0/reference/client-libraries/) for more information. diff --git a/content/v2.0/write-data/quick-start.md b/content/v2.0/write-data/quick-start.md index f6d5a6d72..dd2748eab 100644 --- a/content/v2.0/write-data/quick-start.md +++ b/content/v2.0/write-data/quick-start.md @@ -25,16 +25,18 @@ the "Let's start collecting data!" page displays options for collecting data. Click **Quick Start**. InfluxDB creates and configures a new [scraper](/v2.0/write-data/scrape-data/). -The target URL points to the `/metrics` HTTP endpoint of your local InfluxDB instance (e.g. `http://localhost:9999/metrics`), -which outputs internal InfluxDB metrics in the [Prometheus data format](https://prometheus.io/docs/instrumenting/exposition_formats/). -It stores the scraped metrics in the bucket created during the [initial setup process](/v2.0/get-started/#set-up-influxdb). +The target URL points to the `/metrics` HTTP endpoint of your local InfluxDB instance +(for example, `http://localhost:9999/metrics`), which outputs internal InfluxDB +metrics in the [Prometheus data format](https://prometheus.io/docs/instrumenting/exposition_formats/). +The scraper stores the scraped metrics in the bucket created during the +[initial setup process](/v2.0/get-started/#set-up-influxdb). The following message briefly appears in the UI: {{< ui-message text="The InfluxDB scraper has been configured for http://localhost:9999/metrics" >}} {{% note %}} -Quick Start is available only in the last step of the setup process. +Quick Start is only available in the last step of the setup process. If you missed the Quick Start option, you can [manually create a scraper](/v2.0/write-data/scrape-data) that scrapes data from the `/metrics` endpoint. {{% /note %}} From 4e36a3a7dff22d74bd22267d789cd99ab1bc8325 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 6 May 2019 21:10:48 -0600 Subject: [PATCH 14/14] commented out go client library --- content/v2.0/reference/client-libraries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v2.0/reference/client-libraries.md b/content/v2.0/reference/client-libraries.md index 9e8c62f99..f35c0c2cb 100644 --- a/content/v2.0/reference/client-libraries.md +++ b/content/v2.0/reference/client-libraries.md @@ -18,5 +18,5 @@ These client libraries are in active development and may not be feature-complete This list will continue to grow as more client libraries are released. {{% /note %}} -- [Go](https://github.com/influxdata/influxdb-client-go) + - [JavaScript/Node.js](https://github.com/influxdata/influxdb-client-js)