diff --git a/.ci/vale/styles/InfluxDataDocs/WordList.yml b/.ci/vale/styles/InfluxDataDocs/WordList.yml index 5582bd6ac..bebf40b6d 100644 --- a/.ci/vale/styles/InfluxDataDocs/WordList.yml +++ b/.ci/vale/styles/InfluxDataDocs/WordList.yml @@ -55,7 +55,6 @@ swap: fewer data: less data file name: filename firewalls: firewall rules - fully qualified: fully-qualified functionality: capability|feature Google account: Google Account Google accounts: Google Accounts diff --git a/content/influxdb/v2/query-data/influxql/explore-data/regular-expressions.md b/content/influxdb/v2/query-data/influxql/explore-data/regular-expressions.md index f2bcafa73..8a4bce275 100644 --- a/content/influxdb/v2/query-data/influxql/explore-data/regular-expressions.md +++ b/content/influxdb/v2/query-data/influxql/explore-data/regular-expressions.md @@ -39,8 +39,8 @@ as those without. SELECT // FROM // WHERE [ // | //] GROUP BY // ``` -Regular expressions are surrounded by `/` characters and use -[Golang's regular expression syntax](http://golang.org/pkg/regexp/syntax/). +Regular expressions are surrounded by `/` characters and use the +[Go regular expression syntax](http://golang.org/pkg/regexp/syntax/). ## Supported operators @@ -49,6 +49,22 @@ Regular expressions are surrounded by `/` characters and use ### Examples + + {{< expand-wrapper >}} {{% expand "Use a regular expression to specify field keys and tag keys in the SELECT clause" %}} @@ -57,7 +73,20 @@ Regular expressions are surrounded by `/` characters and use SELECT /l/ FROM "h2o_feet" LIMIT 1 ``` + + Output: + {{% influxql/table-meta %}} Name: h2o_feet {{% /influxql/table-meta %}} @@ -77,6 +106,40 @@ The syntax `//::[field | tag]` is not supported. {{% /expand %}} +{{% expand "Use a regular expression to specify field keys and tag keys in function arguments" %}} + +```sql +SELECT MAX(/_level/) FROM "h2o_feet" LIMIT 1 +``` + + + +Output: + +{{% influxql/table-meta %}} +Name: h2o_feet +{{% /influxql/table-meta %}} + +| time | max_water_level | +| :------------------- | ---------------------:| +| 2019-08-28T07:24:00Z | 9.964 + +This query uses the InfluxQL [`MAX()` selector function](/influxdb/v2/query-data/influxql/functions/selectors/#max) +to find the greatest field value out of all field keys that match the regular expression. + +{{% /expand %}} + {{% expand "Use a regular expression to specify measurements in the FROM clause" %}} ```sql diff --git a/content/influxdb/v2/query-data/influxql/explore-data/select.md b/content/influxdb/v2/query-data/influxql/explore-data/select.md index 2bf50f9c9..6c43ab5c9 100644 --- a/content/influxdb/v2/query-data/influxql/explore-data/select.md +++ b/content/influxdb/v2/query-data/influxql/explore-data/select.md @@ -58,7 +58,7 @@ Other supported features include: ### `FROM` clause The `SELECT` clause specifies the measurement to query. -This clause supports several formats for specifying a [measurement(s)](/influxdb/v2/reference/glossary/#measurement): +This clause supports several formats for specifying a [measurement](/influxdb/v2/reference/glossary/#measurement): - `FROM ` - Returns data from a measurement. - `FROM ,` - Returns data from more than one measurement. @@ -319,97 +319,19 @@ Name: h2o_feet ## Regular expressions -InfluxQL supports using regular expressions when specifying: +InfluxQL supports using [regular expressions](/influxdb/v2/query-data/influxql/explore-data/regular-expressions/) when specifying: - [field keys](/influxdb/v2/reference/glossary/#field-key) and [tag keys](/influxdb/v2/reference/glossary/#tag-key) in the [`SELECT` clause](/influxdb/v2/query-data/influxql/explore-data/select/) - [measurements](/influxdb/v2/reference/glossary/#measurement) in the [`FROM` clause](/influxdb/v2/query-data/influxql/explore-data/select/#from-clause) - [tag values](/influxdb/v2/reference/glossary/#tag-value) and string [field values](/influxdb/v2/reference/glossary/#field-value) in the [`WHERE` clause](/influxdb/v2/query-data/influxql/explore-data/where/). - [tag keys](/influxdb/v2/reference/glossary/#tag-key) in the [`GROUP BY` clause](/influxdb/v2/query-data/influxql/explore-data/group-by/) -Currently, InfluxQL does not support using regular expressions to match -non-string field values in the -`WHERE` clause, -[databases](/influxdb/v2/reference/glossary/#database), and -[retention policies](/influxdb/v2/reference/glossary/#retention-policy-rp). - -{{% note %}} -**Note:** Regular expression comparisons are more computationally intensive than exact -string comparisons. Queries with regular expressions are not as performant -as those without. -{{% /note %}} - ## Syntax ```sql SELECT // FROM // WHERE [ // | //] GROUP BY // ``` -Regular expressions are surrounded by `/` characters and use -[Golang's regular expression syntax](http://golang.org/pkg/regexp/syntax/). - -## Supported operators - -`=~`: matches against -`!~`: doesn't match against - -## Examples - -{{< expand-wrapper >}} -{{% expand "Use a regular expression to specify field keys and tag keys in the SELECT statement" %}} -#### Use a regular expression to specify field keys and tag keys in the SELECT statement - -```sql -SELECT /l/ FROM "h2o_feet" LIMIT 1 -``` -Output: -{{% influxql/table-meta %}} -Name: h2o_feet -{{% /influxql/table-meta %}} - -| time | level description | location | water_level | -| :-------------- |:----------------------| :-------------------| ------------------:| -| 2019-08-17T00:00:00Z | below 3 feet | santa_monica | 2.0640000000 | - -The query selects all [field keys](/influxdb/v2/reference/glossary/#field-key) -and [tag keys](/influxdb/v2/reference/glossary/#tag-key) that include an `l`. -Note that the regular expression in the `SELECT` clause must match at least one -field key in order to return results for a tag key that matches the regular -expression. - -Currently, there is no syntax to distinguish between regular expressions for -field keys and regular expressions for tag keys in the `SELECT` clause. -The syntax `//::[field | tag]` is not supported. - -{{% /expand %}} - -{{% expand "Use a regular expression to specify measurements in the FROM clause" %}} - -```sql -SELECT MEAN("degrees") FROM /temperature/ -``` -Output: -{{% influxql/table-meta %}} -Name: average_temperature -{{% /influxql/table-meta %}} - -| time | mean| -| :-------------- |----------------------:| -| 1970-01-01T00:00:00Z | 79.9847293223 - - -{{% influxql/table-meta %}} -Name: h2o_temperature -{{% /influxql/table-meta %}} - -| time | mean| -| :-------------- |----------------------:| -| 1970-01-01T00:00:00Z | 64.9980273540 | - - -This query uses the InfluxQL [MEAN() function](/influxdb/v2/query-data/influxql/functions/aggregates/#mean) to calculate the average `degrees` for every [measurement](/influxdb/v2/reference/glossary/#measurement) in the `noaa` database that contains the word `temperature`. - -{{% /expand %}} - -{{< /expand-wrapper >}} +See [regular expressions](/influxdb/v2/query-data/influxql/explore-data/regular-expressions/) for more information. ## Data types and cast operations diff --git a/content/influxdb/v2/reference/cli/influx/write/_index.md b/content/influxdb/v2/reference/cli/influx/write/_index.md index e0cea7868..4a879f53f 100644 --- a/content/influxdb/v2/reference/cli/influx/write/_index.md +++ b/content/influxdb/v2/reference/cli/influx/write/_index.md @@ -99,6 +99,7 @@ In **extended annotated CSV**, measurements, fields, and values and their types - [via stdin](#write-line-protocol-via-stdin) - [from a file](#write-line-protocol-from-a-file) +- [and skip header lines](#skip-header-lines-in-a-file) - [from multiple files](#write-line-protocol-from-multiple-files) - [from a URL](#write-line-protocol-from-a-url) - [from multiple URLs](#write-line-protocol-from-multiple-urls) @@ -135,6 +136,14 @@ influx write \ --file path/to/line-protocol.txt ``` +##### Skip header lines in a file +```sh +influx write \ + --bucket example-bucket \ + --file path/to/line-protocol.txt + --skipHeader 8 +``` + ##### Write line protocol from multiple files ```sh influx write \ diff --git a/content/influxdb/v2/reference/config-options.md b/content/influxdb/v2/reference/config-options.md index 71ce2fafe..b5a6a2479 100644 --- a/content/influxdb/v2/reference/config-options.md +++ b/content/influxdb/v2/reference/config-options.md @@ -34,23 +34,20 @@ Server configuration commands require an [Operator token](/influxdb/v2/admin/tok Use the [`influx server-config` command](/influxdb/v2/reference/cli/influx/server-config/) to retrieve your runtime server configuration. - - - ```sh influx server-config ``` @@ -226,7 +223,7 @@ _Typically, InfluxData internal use only._ influxd --assets-path=/path/to/custom/assets-dir ``` - ```sh @@ -825,7 +823,7 @@ potentially hurt performance. influxd --http-write-timeout=10s ``` -