Merge branch 'master' into beta-17
commit
3bc323d39e
|
|
@ -75,6 +75,7 @@ list_code_example: # Code example included with article descriptions in children
|
|||
list_query_example: # Code examples included with article descriptions in children type="articles" shortcode,
|
||||
# References to examples in data/query_examples
|
||||
products: # List of products that the page specifically applies to: [oss, cloud, enterprise]
|
||||
canonical: # Path to canonical page, overrides auto-gen'd canonical URL
|
||||
```
|
||||
|
||||
#### Title usage
|
||||
|
|
@ -644,6 +645,25 @@ Redoc generates HTML documentation using the InfluxDB `swagger.yml`.
|
|||
For more information about generating InfluxDB API documentation, see the
|
||||
[API Documentation README](https://github.com/influxdata/docs-v2/tree/master/api-docs#readme).
|
||||
|
||||
## Canonical URLs
|
||||
Search engines use canonical URLs to accurately rank pages with similar or identical content.
|
||||
The `canonical` HTML meta tag identifies which page should be used as the source of truth.
|
||||
|
||||
By default, canonical URLs are automatically generated for each page in the InfluxData
|
||||
documentation using the latest version of the current product and the current path.
|
||||
|
||||
Use the `canonical` frontmatter to override the auto-generated canonical URL.
|
||||
|
||||
_**Note:** The `canonical` frontmatter supports the [`{{< latest >}}` shortcode](#latest-links)._
|
||||
|
||||
```yaml
|
||||
canonical: /path/to/canonical/doc/
|
||||
|
||||
# OR
|
||||
|
||||
canonical: /{{< latest "influxdb" "v2" >}}/path/to/canonical/doc/
|
||||
```
|
||||
|
||||
## InfluxDB URLs
|
||||
When a user selects an InfluxDB product and region, example URLs in code blocks
|
||||
throughout the documentation are updated to match their product and region.
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@
|
|||
<div class="spinner"></div>
|
||||
</div>
|
||||
<div id="influx-header">
|
||||
<a href="/{{templateOptions.version}}">InfluxDB {{templateOptions.version}} Docs</a>
|
||||
<a class="back" href="/influxdb/{{templateOptions.version}}/">InfluxDB <span class="version">{{templateOptions.version}}</span> Docs</a>
|
||||
<a class="btn" href="https://github.com/influxdata/influxdb/issues/new/choose/" target="_blank">Submit API issue</a>
|
||||
</div>
|
||||
{{{redocHTML}}}
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
|
|
@ -45,24 +45,54 @@ $bold: 700;
|
|||
|
||||
#influx-header {
|
||||
font-family: $rubik;
|
||||
padding: 15px 20px ;
|
||||
display: block;
|
||||
padding: 10px ;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: $g2-kevlar;
|
||||
a {
|
||||
color: $g20-white;
|
||||
text-decoration: none;
|
||||
transition: color .2s;
|
||||
&:hover {
|
||||
color: $b-pool;
|
||||
&.back {
|
||||
color: $g20-white;
|
||||
transition: color .2s;
|
||||
&:hover {
|
||||
color: $b-pool;
|
||||
}
|
||||
&:before {
|
||||
content: '\e918';
|
||||
font-family: 'icomoon';
|
||||
margin-right: .65rem;
|
||||
}
|
||||
}
|
||||
&:before {
|
||||
content: '\e918';
|
||||
font-family: 'icomoon';
|
||||
margin-right: .65rem;
|
||||
&.btn {
|
||||
padding: .5rem .75rem .5rem .65rem;
|
||||
font-size: .85rem;
|
||||
font-weight: 500;
|
||||
color: $g15-platinum;
|
||||
background: $g5-pepper;
|
||||
border-radius: 4.5px;
|
||||
transition: all .2s;
|
||||
&:before {
|
||||
content: "\e933";
|
||||
display: inline-block;
|
||||
font-size: .95rem;
|
||||
margin-right: .5rem;
|
||||
font-family: 'icomoon';
|
||||
}
|
||||
&:hover {
|
||||
color: $g20-white;
|
||||
background: $b-pool;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Header Media Queries
|
||||
|
||||
@media (max-width: 600px) {
|
||||
#influx-header span.version {display: none;}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.cjtbAK {
|
||||
|
|
@ -263,3 +293,4 @@ $bold: 700;
|
|||
}
|
||||
.token.boolean { color: #f955b0; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,98 @@
|
|||
.feedback {
|
||||
border-color: rgba($article-note-base, .75);
|
||||
background: rgba($article-text, .05);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border: none;
|
||||
border-radius: $radius;
|
||||
box-shadow: 1px 2px 6px $article-shadow;
|
||||
background: rgba($article-text, .03);
|
||||
}
|
||||
|
||||
.support {
|
||||
padding-right: 2rem;
|
||||
|
||||
ul {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1.25rem;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
|
||||
li {display: inline-block}
|
||||
|
||||
a {
|
||||
margin-right: 1.5rem;
|
||||
color: $article-heading-alt;
|
||||
|
||||
&:hover {
|
||||
color: $article-link;
|
||||
border-radius: calc($radius * 1.5);
|
||||
}
|
||||
|
||||
&.community:before {
|
||||
content: "\e900";
|
||||
color: $article-heading-alt;
|
||||
margin: 0 .25rem 0 -.25rem;
|
||||
font-size: 1.65rem;
|
||||
font-family: 'icomoon';
|
||||
vertical-align: middle;
|
||||
}
|
||||
&.slack:before {
|
||||
content: url('/svgs/slack.svg');
|
||||
display: inline-block;
|
||||
height: 1.1rem;
|
||||
width: 1.1rem;
|
||||
vertical-align: text-top;
|
||||
margin-right: .5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.actions {
|
||||
min-width: 230px;
|
||||
padding-bottom: 1.75rem;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
padding-left: .7rem;
|
||||
font-size: .85rem;
|
||||
|
||||
&.btn {
|
||||
color: $article-text !important;
|
||||
background: $feedback-btn-bg !important;
|
||||
|
||||
&:hover {
|
||||
color: $g20-white !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&:before {
|
||||
display: inline-block;
|
||||
margin-right: .5rem;
|
||||
font-family: 'icomoon';
|
||||
}
|
||||
|
||||
&.edit:before {
|
||||
content: "\e92e";
|
||||
font-size: .75rem;
|
||||
vertical-align: top;
|
||||
}
|
||||
&.issue:before {
|
||||
content: "\e933";
|
||||
font-size: .95rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////// Media Queries ////////////////////////////////
|
||||
|
||||
@include media(medium) {
|
||||
.feedback {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@include media(small) {
|
||||
.actions { padding-bottom: 1rem; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,9 @@ $tooltip-color-alt: $br-chartreuse;
|
|||
$tooltip-bg: $br-chartreuse;
|
||||
$tooltip-text: $g2-kevlar;
|
||||
|
||||
// Support and feedback buttons
|
||||
$feedback-btn-bg: $g3-castle;
|
||||
|
||||
// URL Modal colors
|
||||
$modal-field-bg: $g1-raven;
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,9 @@ $tooltip-color-alt: $p-twilight !default;
|
|||
$tooltip-bg: $p-amethyst !default;
|
||||
$tooltip-text: $g20-white !default;
|
||||
|
||||
// Support and feedback buttons
|
||||
$feedback-btn-bg: $g16-pearl !default;
|
||||
|
||||
// URL Modal colors
|
||||
$modal-field-bg: $g20-white !default;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@font-face {
|
||||
font-family: 'icomoon';
|
||||
src: url('fonts/icomoon.eot?rgf1km');
|
||||
src: url('fonts/icomoon.eot?rgf1km#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.ttf?rgf1km') format('truetype'),
|
||||
url('fonts/icomoon.woff?rgf1km') format('woff'),
|
||||
url('fonts/icomoon.svg?rgf1km#icomoon') format('svg');
|
||||
src: url('fonts/icomoon.eot?lp1izo');
|
||||
src: url('fonts/icomoon.eot?lp1izo#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.ttf?lp1izo') format('truetype'),
|
||||
url('fonts/icomoon.woff?lp1izo') format('woff'),
|
||||
url('fonts/icomoon.svg?lp1izo#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
[class^="icon-"], [class*=" icon-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'icomoon' !important;
|
||||
speak: none;
|
||||
speak: never;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
|
|
@ -25,35 +25,101 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-ui-disks-nav:before {
|
||||
content: "\e93c";
|
||||
.icon-alert-circle:before {
|
||||
content: "\e933";
|
||||
}
|
||||
.icon-ui-wrench-nav:before {
|
||||
content: "\e93d";
|
||||
.icon-influx-logo:before {
|
||||
content: "\e900";
|
||||
}
|
||||
.icon-ui-user:before {
|
||||
content: "\e93e";
|
||||
.icon-influx-logotype:before {
|
||||
content: "\e901";
|
||||
}
|
||||
.icon-ui-chat:before {
|
||||
content: "\e93a";
|
||||
.icon-alert-triangle:before {
|
||||
content: "\e902";
|
||||
}
|
||||
.icon-ui-bell:before {
|
||||
content: "\e93b";
|
||||
.icon-arrow-down:before {
|
||||
content: "\e903";
|
||||
}
|
||||
.icon-ui-users-trio:before {
|
||||
content: "\e940";
|
||||
.icon-moon1:before {
|
||||
content: "\e904";
|
||||
}
|
||||
.icon-ui-cloud:before {
|
||||
content: "\e93f";
|
||||
.icon-search:before {
|
||||
content: "\e905";
|
||||
}
|
||||
.icon-ui-nav-chat:before {
|
||||
content: "\e941";
|
||||
.icon-sun1:before {
|
||||
content: "\e906";
|
||||
}
|
||||
.icon-ui-eye-closed:before {
|
||||
content: "\e956";
|
||||
.icon-arrow-down-circle:before {
|
||||
content: "\e907";
|
||||
}
|
||||
.icon-ui-eye-open:before {
|
||||
content: "\e957";
|
||||
.icon-arrow-down-left:before {
|
||||
content: "\e908";
|
||||
}
|
||||
.icon-arrow-down-right:before {
|
||||
content: "\e909";
|
||||
}
|
||||
.icon-arrow-left:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
.icon-arrow-left-circle:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
.icon-arrow-right:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
.icon-arrow-right-circle:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
.icon-arrow-up:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
.icon-arrow-up-circle:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
.icon-arrow-up-left:before {
|
||||
content: "\e910";
|
||||
}
|
||||
.icon-arrow-up-right:before {
|
||||
content: "\e911";
|
||||
}
|
||||
.icon-check:before {
|
||||
content: "\e912";
|
||||
}
|
||||
.icon-heart1:before {
|
||||
content: "\e913";
|
||||
}
|
||||
.icon-settings:before {
|
||||
content: "\e914";
|
||||
}
|
||||
.icon-zoom-in:before {
|
||||
content: "\e915";
|
||||
}
|
||||
.icon-zoom-out:before {
|
||||
content: "\e916";
|
||||
}
|
||||
.icon-chevron-down:before {
|
||||
content: "\e917";
|
||||
}
|
||||
.icon-chevron-left:before {
|
||||
content: "\e918";
|
||||
}
|
||||
.icon-chevron-right:before {
|
||||
content: "\e919";
|
||||
}
|
||||
.icon-chevron-up:before {
|
||||
content: "\e91a";
|
||||
}
|
||||
.icon-menu:before {
|
||||
content: "\e91b";
|
||||
}
|
||||
.icon-download:before {
|
||||
content: "\e91c";
|
||||
}
|
||||
.icon-minus:before {
|
||||
content: "\e91d";
|
||||
}
|
||||
.icon-plus:before {
|
||||
content: "\e91e";
|
||||
}
|
||||
.icon-ui-add-cell:before {
|
||||
content: "\e91f";
|
||||
|
|
@ -115,123 +181,51 @@
|
|||
.icon-ui-remove:before {
|
||||
content: "\e932";
|
||||
}
|
||||
.icon-ui-search:before {
|
||||
content: "\e933";
|
||||
}
|
||||
.icon-ui-trash:before {
|
||||
content: "\e935";
|
||||
}
|
||||
.icon-ui-triangle:before {
|
||||
content: "\e936";
|
||||
}
|
||||
.icon-ui-wrench-2:before {
|
||||
content: "\e939";
|
||||
}
|
||||
.icon-moon1:before {
|
||||
content: "\e904";
|
||||
}
|
||||
.icon-sun1:before {
|
||||
content: "\e906";
|
||||
}
|
||||
.icon-search:before {
|
||||
content: "\e905";
|
||||
}
|
||||
.icon-influx-logo:before {
|
||||
content: "\e900";
|
||||
}
|
||||
.icon-influx-logotype:before {
|
||||
content: "\e901";
|
||||
}
|
||||
.icon-alert-triangle:before {
|
||||
content: "\e902";
|
||||
}
|
||||
.icon-arrow-down:before {
|
||||
content: "\e903";
|
||||
}
|
||||
.icon-arrow-down-circle:before {
|
||||
content: "\e907";
|
||||
}
|
||||
.icon-arrow-down-left:before {
|
||||
content: "\e908";
|
||||
}
|
||||
.icon-arrow-down-right:before {
|
||||
content: "\e909";
|
||||
}
|
||||
.icon-arrow-left:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
.icon-arrow-left-circle:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
.icon-arrow-right:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
.icon-arrow-right-circle:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
.icon-arrow-up:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
.icon-arrow-up-circle:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
.icon-arrow-up-left:before {
|
||||
content: "\e910";
|
||||
}
|
||||
.icon-arrow-up-right:before {
|
||||
content: "\e911";
|
||||
}
|
||||
.icon-check:before {
|
||||
content: "\e912";
|
||||
}
|
||||
.icon-chevron-down:before {
|
||||
content: "\e917";
|
||||
}
|
||||
.icon-chevron-left:before {
|
||||
content: "\e918";
|
||||
}
|
||||
.icon-chevron-right:before {
|
||||
content: "\e919";
|
||||
}
|
||||
.icon-chevron-up:before {
|
||||
content: "\e91a";
|
||||
}
|
||||
.icon-download:before {
|
||||
content: "\e91c";
|
||||
}
|
||||
.icon-heart1:before {
|
||||
content: "\e913";
|
||||
}
|
||||
.icon-menu:before {
|
||||
content: "\e91b";
|
||||
}
|
||||
.icon-minus:before {
|
||||
content: "\e91d";
|
||||
}
|
||||
.icon-plus:before {
|
||||
content: "\e91e";
|
||||
}
|
||||
.icon-settings:before {
|
||||
content: "\e914";
|
||||
}
|
||||
.icon-triangle:before {
|
||||
content: "\e937";
|
||||
}
|
||||
.icon-x:before {
|
||||
content: "\e938";
|
||||
}
|
||||
.icon-zoom-in:before {
|
||||
content: "\e915";
|
||||
.icon-ui-wrench-2:before {
|
||||
content: "\e939";
|
||||
}
|
||||
.icon-zoom-out:before {
|
||||
content: "\e916";
|
||||
.icon-chat:before {
|
||||
content: "\e93a";
|
||||
}
|
||||
.icon-folder-upload:before {
|
||||
content: "\e934";
|
||||
.icon-bell:before {
|
||||
content: "\e93b";
|
||||
}
|
||||
.icon-disks-nav:before {
|
||||
content: "\e93c";
|
||||
}
|
||||
.icon-wrench-nav:before {
|
||||
content: "\e93d";
|
||||
}
|
||||
.icon-user:before {
|
||||
content: "\e93e";
|
||||
}
|
||||
.icon-cloud:before {
|
||||
content: "\e93f";
|
||||
}
|
||||
.icon-users-trio:before {
|
||||
content: "\e940";
|
||||
}
|
||||
.icon-nav-chat:before {
|
||||
content: "\e941";
|
||||
}
|
||||
.icon-map2:before {
|
||||
content: "\e94c";
|
||||
}
|
||||
.icon-eye-closed:before {
|
||||
content: "\e956";
|
||||
}
|
||||
.icon-eye-open:before {
|
||||
content: "\e957";
|
||||
}
|
||||
.icon-heart:before {
|
||||
content: "\e9da";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,14 +52,14 @@ chronograf [flags]
|
|||
|
||||
| Flag | Description | Env. Variable |
|
||||
|---------|------------------------------------------------------------|--------------------|
|
||||
| `--cert | File path to PEM-encoded public key certificate | `$TLS_CERTIFICATE` |
|
||||
| `--cert` | File path to PEM-encoded public key certificate | `$TLS_CERTIFICATE` |
|
||||
| `--key` | File path to private key associated with given certificate | `$TLS_PRIVATE_KEY` |
|
||||
|
||||
## Other service option flags
|
||||
|
||||
| Flag | Description | Env. Variable |
|
||||
|----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
|
||||
| `--custom-link <display_name>:<link_address> | Custom link added to Chronograf user menu options. Useful for providing links to internal company resources for your Chronograf users. Can be used when any OAuth 2.0 authentication is enabled. To add another custom link, repeat the custom link option. | |
|
||||
| `--custom-link` <display_name>:<link_address> | Custom link added to Chronograf user menu options. Useful for providing links to internal company resources for your Chronograf users. Can be used when any OAuth 2.0 authentication is enabled. To add another custom link, repeat the custom link option. | |
|
||||
| `-r`, `--reporting-disabled` | Disables reporting of usage statistics. Usage statistics reported once every 24 hours include: `OS`, `arch`, `version`, `cluster_id`, and `uptime`. | `$REPORTING_DISABLED` |
|
||||
| `-l`, `--log-level` | Sets the logging level. Valid values include `info` (default), `debug`, and `error`. | `$LOG_LEVEL` |
|
||||
| `-d`, `--develop` | Runs the Chronograf service in developer mode | |
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ menu:
|
|||
influxdb_1_3:
|
||||
weight: 10
|
||||
parent: Write protocols
|
||||
canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/
|
||||
---
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ menu:
|
|||
influxdb_1_4:
|
||||
weight: 10
|
||||
parent: Write protocols
|
||||
canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/
|
||||
---
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ menu:
|
|||
name: Line Protocol reference
|
||||
weight: 10
|
||||
parent: Write protocols
|
||||
canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/
|
||||
---
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ menu:
|
|||
name: Line Protocol reference
|
||||
weight: 10
|
||||
parent: Write protocols
|
||||
canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/
|
||||
---
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ menu:
|
|||
name: InfluxDB line protocol reference
|
||||
weight: 10
|
||||
parent: Write protocols
|
||||
canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/
|
||||
---
|
||||
|
||||
InfluxDB line protocol is a text based format for writing points to InfluxDB.
|
||||
|
|
@ -201,12 +202,12 @@ In field values, you must use a backslash character (`\`) to escape:
|
|||
- the backslash character itself (`\`).
|
||||
|
||||
For example, `\"` escapes a double quote.
|
||||
|
||||
|
||||
>#### Note on backslashes:
|
||||
>
|
||||
* If you use multiple backslashes, they must be escaped. Influx interprets backslashes as follows:
|
||||
* `\` or `\\` interpreted as `\`
|
||||
* `\\\` or `\\\\` interpreted as `\\`
|
||||
* `\` or `\\` interpreted as `\`
|
||||
* `\\\` or `\\\\` interpreted as `\\`
|
||||
* `\\\\\` or `\\\\\\` interpreted as `\\\`, and so on
|
||||
|
||||
In tag keys, tag values, and field keys, you must escape:
|
||||
|
|
|
|||
|
|
@ -120,12 +120,12 @@ InfluxDB supports multiple query languages:
|
|||
|
||||
### Flux
|
||||
|
||||
[Flux](/flux/latest/introduction) is a data scripting language designed for querying, analyzing, and acting on time series data.
|
||||
[Flux](/influxdb/v1.8/flux/) is a data scripting language designed for querying, analyzing, and acting on time series data.
|
||||
Beginning with **InfluxDB 1.8.0**, Flux is available for production use along side InfluxQL.
|
||||
|
||||
For those familiar with [InfluxQL](#influxql), Flux is intended to address
|
||||
many of the outstanding feature requests that we've received since introducing InfluxDB 1.0.
|
||||
For a comparison between Flux and InfluxQL, see [Flux vs InfluxQL](/flux/latest/introduction/flux-vs-influxql).
|
||||
For a comparison between Flux and InfluxQL, see [Flux vs InfluxQL](/influxdb/v1.8/flux/flux-vs-influxql/).
|
||||
|
||||
Flux is the primary language for working with data in [InfluxDB 2.0 OSS](/influxdb/v2.0/get-started)
|
||||
(currently in _beta_) and [InfluxDB Cloud 2.0](/influxdb/v2.0/cloud/get-started/),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ menu:
|
|||
weight: 2
|
||||
aliases:
|
||||
- /influxdb/v1.8/flux/getting-started/
|
||||
- /influxdb/v1.8/flux/introduction/getting-started/
|
||||
---
|
||||
|
||||
Flux is InfluxData's new functional data scripting language designed for querying,
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ menu:
|
|||
name: InfluxDB line protocol reference
|
||||
weight: 10
|
||||
parent: Write protocols
|
||||
canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/
|
||||
---
|
||||
|
||||
InfluxDB line protocol is a text-based format for writing points to InfluxDB.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
---
|
||||
title: Create custom checks
|
||||
seotitle: Custom checks
|
||||
description: >
|
||||
Create custom checks with a Flux task.
|
||||
menu:
|
||||
influxdb_2_0:
|
||||
parent: Monitor & alert
|
||||
weight: 201
|
||||
v2.0/tags: [alerts, checks, tasks, Flux]
|
||||
---
|
||||
|
||||
In the UI, you can create two kinds of [checks](/influxdb/v2.0/reference/glossary/#check):
|
||||
[`threshold`](/influxdb/v2.0/monitor-alert/checks/create/#threshold-check) and
|
||||
[`deadman`](/influxdb/v2.0/monitor-alert/checks/create/#deadman-check).
|
||||
|
||||
Using a Flux task, you can create a custom check that provides a couple advantages:
|
||||
|
||||
- Customize and transform the data you would like to use for the check.
|
||||
- Set up custom criteria for your alert (other than `threshold` and `deadman`).
|
||||
|
||||
## Create a task
|
||||
|
||||
1. In the InfluxDB UI, select **Tasks** in the navigation menu on the left.
|
||||
|
||||
{{< nav-icon "tasks" >}}
|
||||
|
||||
2. Click **{{< icon "plus" >}} Create Task**, and then select **New Task**.
|
||||
3. In the **Name** field, enter a descriptive name,
|
||||
and then enter how often to run the task in the **Every** field (for example, `10m`).
|
||||
For more detail, such as using cron syntax or including an offset, see [Task configuration options](/influxdb/v2.0/process-data/task-options/).
|
||||
4. Enter the Flux script for your custom check, including the [`monitor.check`](/influxdb/v2.0/reference/flux/stdlib/monitor/check/) function.
|
||||
|
||||
{{% note %}}
|
||||
Use the the API endpoint `/checks/{checkID}/query` to see the Flux code for a check built in the UI.
|
||||
This can be useful for constructing custom checks.
|
||||
{{% /note %}}
|
||||
|
||||
### Example: Monitor failed tasks
|
||||
|
||||
The script below is fairly complex, and can be used as a framework for similar tasks.
|
||||
It does the following:
|
||||
|
||||
- Import the necessary `influxdata/influxdb/monitor` package, and other packages for data processing.
|
||||
- Query the `_tasks` bucket to retrieve all statuses generated by your check.
|
||||
- Set the `_level` to alert on, for example, `crit`, `warn`, `info`, or `ok`.
|
||||
- Create a `check` object that specifies an ID, name, and type for the check.
|
||||
- Define the `ok` and `crit` statuses.
|
||||
- Execute the `monitor` function on the `check` using the `task_data`.
|
||||
|
||||
#### Example alert task script
|
||||
|
||||
```js
|
||||
import "strings"
|
||||
import "regexp"
|
||||
import "influxdata/influxdb/monitor"
|
||||
import "influxdata/influxdb/v1"
|
||||
|
||||
option task = {name: "Failed Tasks Check", every: 1h, offset: 4m}
|
||||
|
||||
task_data = from(bucket: "_tasks")
|
||||
|> range(start: -task.every)
|
||||
|> filter(fn: (r) =>
|
||||
(r["_measurement"] == "runs"))
|
||||
|> filter(fn: (r) =>
|
||||
(r["_field"] == "logs"))
|
||||
|> map(fn: (r) => ({ r with name: strings.split(v: regexp.findString(r: /option task = \{([^\}]+)/, v: r._value), t: "\\\\\\\"")[1] }))
|
||||
|> drop(columns: ["_value", "_start", "_stop"])
|
||||
|> group(columns: ["name", "taskID", "status", "_measurement"])
|
||||
|> map(fn: (r) =>
|
||||
({r with _value: if r.status == "failed" then 1 else 0}))
|
||||
|> last()
|
||||
check = {
|
||||
_check_id: "0000000000000001", // 16 characters, alphanumeric
|
||||
_check_name: "Failed Tasks Check", // string
|
||||
_type: "custom", // can also use "threashold" or "deadman"
|
||||
tags: {},
|
||||
}
|
||||
ok = (r) =>
|
||||
(r["logs"] == 0)
|
||||
crit = (r) =>
|
||||
(r["logs"] == 1)
|
||||
messageFn = (r) =>
|
||||
("The task: ${r.taskID} - ${r.name} has a status of ${r.status}")
|
||||
|
||||
task_data
|
||||
|> v1["fieldsAsCols"]()
|
||||
|> monitor["check"](
|
||||
data: check,
|
||||
messageFn: messageFn,
|
||||
ok: ok,
|
||||
crit: crit,
|
||||
)
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
Creating a custom check does not send a notification email.
|
||||
For information on how to create notification emails, see
|
||||
[Create notification endpoints](/influxdb/v2.0/monitor-alert/notification-endpoints/create),
|
||||
[Create notification rules](/influxdb/v2.0/monitor-alert/notification-rules/create),
|
||||
and [Send alert email](/influxdb/v2.0/monitor-alert/send-email/)
|
||||
{{% /note %}}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
---
|
||||
title: Alert on failed tasks
|
||||
seotitle: Alert on failed tasks.
|
||||
description: >
|
||||
Create an alert when a task fails.
|
||||
menu:
|
||||
influxdb_2_0:
|
||||
parent: Monitor & alert
|
||||
weight: 201
|
||||
influxdb/v2.0/tags: [tasks]
|
||||
---
|
||||
|
||||
Use a task to receive alerts when a task fails.
|
||||
|
||||
## Example alert task script
|
||||
|
||||
```js
|
||||
import "strings"
|
||||
import "regexp"
|
||||
import "influxdata/influxdb/monitor"
|
||||
import "influxdata/influxdb/v1"
|
||||
|
||||
option task = {name: "Failed Tasks Check", every: 1h, offset: 4m}
|
||||
|
||||
task_data = from(bucket: "_tasks")
|
||||
|> range(start: -1h, stop: now())
|
||||
|> filter(fn: (r) =>
|
||||
(r["_measurement"] == "runs"))
|
||||
|> filter(fn: (r) =>
|
||||
(r["_field"] == "logs"))
|
||||
|> map(fn: (r) => ({ r with name: strings.split(v: regexp.findString(r: /option task = \{([^\}]+)/, v: r._value), t: "\\\\\\\"")[1] }))
|
||||
|> drop(columns: ["_value", "_start", "_stop"])
|
||||
|> group(columns: ["name", "taskID", "status", "_measurement"])
|
||||
|> map(fn: (r) =>
|
||||
({r with _value: if r.status == "failed" then 1 else 0}))
|
||||
|> last()
|
||||
check = {
|
||||
_check_id: "0000000deadbeef1",
|
||||
_check_name: "Failed Tasks Check",
|
||||
_type: "threshold",
|
||||
tags: {},
|
||||
}
|
||||
ok = (r) =>
|
||||
(r["logs"] == 0)
|
||||
crit = (r) =>
|
||||
(r["logs"] == 1)
|
||||
messageFn = (r) =>
|
||||
("The task: ${r.taskID} - ${r.name} has a status of ${r.status}")
|
||||
|
||||
task_data
|
||||
|> v1["fieldsAsCols"]()
|
||||
|> monitor["check"](
|
||||
data: check,
|
||||
messageFn: messageFn,
|
||||
ok: ok,
|
||||
crit: crit,
|
||||
)
|
||||
```
|
||||
|
||||
## Add your task
|
||||
|
||||
Once your task is ready, see [Create a task](/influxdb/v2.0/process-data/manage-tasks/create-task) for information about adding it to InfluxDB.
|
||||
|
||||
{{% note %}}
|
||||
This script does not send an email alert.
|
||||
For information on how to create notification emails, see
|
||||
[Create notification endpoints](/influxdb/v2.0/monitor-alert/notification-endpoints/create)
|
||||
and [Create notification rules](/influxdb/v2.0/monitor-alert/notification-rules/create).
|
||||
{{% /note %}}
|
||||
|
|
@ -5,7 +5,7 @@ list_title: Query SQL data
|
|||
description: >
|
||||
The Flux `sql` package provides functions for working with SQL data sources.
|
||||
Use `sql.from()` to query SQL databases like PostgreSQL, MySQL, Snowflake,
|
||||
SQLite, Microsoft SQL Server, and Amazon Athena.
|
||||
SQLite, Microsoft SQL Server, Amazon Athena, and Google BigQuery.
|
||||
influxdb/v2.0/tags: [query, flux, sql]
|
||||
menu:
|
||||
influxdb_2_0:
|
||||
|
|
@ -33,8 +33,8 @@ The [Flux](/influxdb/v2.0/reference/flux) `sql` package provides functions for w
|
|||
like [PostgreSQL](https://www.postgresql.org/), [MySQL](https://www.mysql.com/),
|
||||
[Snowflake](https://www.snowflake.com/), [SQLite](https://www.sqlite.org/index.html),
|
||||
[Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server/default.aspx),
|
||||
and [Amazon Athena](https://aws.amazon.com/athena/) and use the results with
|
||||
InfluxDB dashboards, tasks, and other operations.
|
||||
[Amazon Athena](https://aws.amazon.com/athena/) and [Google BigQuery](https://cloud.google.com/bigquery)
|
||||
and use the results with InfluxDB dashboards, tasks, and other operations.
|
||||
|
||||
- [Query a SQL data source](#query-a-sql-data-source)
|
||||
- [Join SQL data with data in InfluxDB](#join-sql-data-with-data-in-influxdb)
|
||||
|
|
@ -61,6 +61,8 @@ To query a SQL data source:
|
|||
[Snowflake](#)
|
||||
[SQLite](#)
|
||||
[SQL Server](#)
|
||||
[Athena](#)
|
||||
[BigQuery](#)
|
||||
{{% /code-tabs %}}
|
||||
|
||||
{{% code-tab-content %}}
|
||||
|
|
@ -129,6 +131,33 @@ sql.from(
|
|||
_For information about authenticating with SQL Server using ADO-style parameters,
|
||||
see [SQL Server ADO authentication](/influxdb/v2.0/reference/flux/stdlib/sql/from/#sql-server-ado-authentication)._
|
||||
{{% /code-tab-content %}}
|
||||
|
||||
{{% code-tab-content %}}
|
||||
```js
|
||||
import "sql"
|
||||
sql.from(
|
||||
driverName: "awsathena",
|
||||
dataSourceName: "s3://myorgqueryresults/?accessID=12ab34cd56ef®ion=region-name&secretAccessKey=y0urSup3rs3crEtT0k3n",
|
||||
query: "GO SELECT * FROM Example.Table"
|
||||
)
|
||||
```
|
||||
|
||||
_For information about parameters to include in the Athena DSN,
|
||||
see [Athena connection string](/influxdb/v2.0/reference/flux/stdlib/sql/from/#athena-connection-string)._
|
||||
{{% /code-tab-content %}}
|
||||
{{% code-tab-content %}}
|
||||
```js
|
||||
import "sql"
|
||||
sql.from(
|
||||
driverName: "bigquery",
|
||||
dataSourceName: "bigquery://projectid/?apiKey=mySuP3r5ecR3tAP1K3y",
|
||||
query: "SELECT * FROM exampleTable"
|
||||
)
|
||||
```
|
||||
|
||||
_For information about authenticating with BigQuery, see
|
||||
[BigQuery authentication parameters](/influxdb/v2.0/reference/flux/stdlib/sql/from/#bigquery-authentication-parameters)._
|
||||
{{% /code-tab-content %}}
|
||||
{{< /code-tabs-wrapper >}}
|
||||
|
||||
_See the [`sql.from()` documentation](/influxdb/v2.0/reference/flux/stdlib/sql/from/) for
|
||||
|
|
|
|||
|
|
@ -223,18 +223,19 @@ Operators with a lower number have higher precedence.
|
|||
| 1 | `a()` | Function call |
|
||||
| | `a[]` | Member or index access |
|
||||
| | `.` | Member access |
|
||||
| 2 | `^` | Exponentiation |
|
||||
| 3 | `*` `/` `%` | Multiplication, division, and modulo |
|
||||
| 4 | `+` `-` | Addition and subtraction |
|
||||
| 5 |`==` `!=` | Comparison operators |
|
||||
| 2 | <code>\|></code> | Pipe forward |
|
||||
| 3 | `^` | Exponentiation |
|
||||
| 4 | `*` `/` `%` | Multiplication, division, and modulo |
|
||||
| 5 | `+` `-` | Addition and subtraction |
|
||||
| 6 |`==` `!=` | Comparison operators |
|
||||
| | `<` `<=` | |
|
||||
| | `>` `>=` | |
|
||||
| |`=~` `!~` | |
|
||||
| 6 | `not` | Unary logical operator |
|
||||
| 7 | `not` | Unary logical operator |
|
||||
| | `exists` | Null check operator |
|
||||
| 7 | `and` | Logical AND |
|
||||
| 8 | `or` | Logical OR |
|
||||
| 9 | `if` `then` `else` | Conditional |
|
||||
| 8 | `and` | Logical AND |
|
||||
| 9 | `or` | Logical OR |
|
||||
| 10 | `if` `then` `else` | Conditional |
|
||||
|
||||
The operator precedence is encoded directly into the grammar as the following.
|
||||
|
||||
|
|
|
|||
|
|
@ -131,19 +131,21 @@ Literal constructors define fixed values.
|
|||
The table below outlines operator precedence.
|
||||
Operators with a lower number have higher precedence.
|
||||
|
||||
| Precedence | Operator | Description |
|
||||
|:----------:|:--------: |:--------------------------|
|
||||
| 1 | `a()` | Function call |
|
||||
| | `a[]` | Member or index access |
|
||||
| | `.` | Member access |
|
||||
| 2 | `*` `/` |Multiplication and division|
|
||||
| 3 | `+` `-` | Addition and subtraction |
|
||||
| 4 |`==` `!=` | Comparison operators |
|
||||
| | `<` `<=` | |
|
||||
| | `>` `>=` | |
|
||||
| |`=~` `!~` | |
|
||||
| 5 | `not` | Unary logical operator |
|
||||
| | `exists` | Null check operator |
|
||||
| 6 | `and` | Logical AND |
|
||||
| 7 | `or` | Logical OR |
|
||||
| 8 | `if` `then` `else` | Conditional |
|
||||
| Precedence | Operator | Description |
|
||||
|:----------:|:--------: |:-------------------------- |
|
||||
| 1 | `a()` | Function call |
|
||||
| | `a[]` | Member or index access |
|
||||
| | `.` | Member access |
|
||||
| 2 | <code>\|></code> | Pipe forward |
|
||||
| 3 | `^` | Exponentiation |
|
||||
| 4 | `*` `/` `%` | Multiplication, division, and modulo |
|
||||
| 5 | `+` `-` | Addition and subtraction |
|
||||
| 6 |`==` `!=` | Comparison operators |
|
||||
| | `<` `<=` | |
|
||||
| | `>` `>=` | |
|
||||
| |`=~` `!~` | |
|
||||
| 7 | `not` | Unary logical operator |
|
||||
| | `exists` | Null check operator |
|
||||
| 8 | `and` | Logical AND |
|
||||
| 9 | `or` | Logical OR |
|
||||
| 10 | `if` `then` `else` | Conditional |
|
||||
|
|
|
|||
|
|
@ -20,23 +20,47 @@ _**Function type:** Aggregate_
|
|||
_**Output data type:** Float_
|
||||
|
||||
```js
|
||||
integral(unit: 10s, column: "_value")
|
||||
integral(
|
||||
unit: 10s,
|
||||
column: "_value",
|
||||
timeColumn: "_time",
|
||||
interpolation: ""
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### unit
|
||||
The time duration used when computing the integral.
|
||||
Time duration used when computing the integral.
|
||||
|
||||
_**Data type:** Duration_
|
||||
|
||||
### column
|
||||
The column on which to operate.
|
||||
Column on which to operate.
|
||||
Defaults to `"_value"`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### timeColumn
|
||||
Column that contains time values to use in the operation.
|
||||
Defaults to `"_time"`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### interpolate
|
||||
Type of interpolation to use.
|
||||
Defaults to `""`.
|
||||
|
||||
Use one of the following interpolation options:
|
||||
|
||||
- _empty sting for no interpolation_
|
||||
- linear
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Calculate the integral
|
||||
```js
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -5m)
|
||||
|
|
@ -46,3 +70,14 @@ from(bucket: "example-bucket")
|
|||
)
|
||||
|> integral(unit:10s)
|
||||
```
|
||||
|
||||
##### Calculate the integral with linear interpolation
|
||||
```js
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -5m)
|
||||
|> filter(fn: (r) =>
|
||||
r._measurement == "cpu" and
|
||||
r._field == "usage_system"
|
||||
)
|
||||
|> integral(unit:10s, interpolate: "linear")
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
title: timeWeightedAvg() function
|
||||
description: The `timeWeightedAvg()` function outputs the timeWeightedAvg of non-null records as a float.
|
||||
menu:
|
||||
influxdb_2_0_ref:
|
||||
name: timeWeightedAvg
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
related:
|
||||
- /influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral/
|
||||
---
|
||||
|
||||
The `timeWeightedAvg()` function outputs the time-weighted average of non-null records
|
||||
in a table as a float.
|
||||
Time is weighted using the linearly interpolated integral of values in the table.
|
||||
|
||||
_**Function type:** Aggregate_
|
||||
_**Output data type:** Float_
|
||||
|
||||
```js
|
||||
timeWeightedAvg(unit: "_value")
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### unit
|
||||
Time duration used when computing the time-weighted average.
|
||||
|
||||
_**Data type:** Duration_
|
||||
|
||||
## Examples
|
||||
```js
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -5m)
|
||||
|> filter(fn: (r) =>
|
||||
r._measurement == "cpu" and
|
||||
r._field == "usage_system"
|
||||
)
|
||||
|> timeWeightedAvg(unit: 1m)
|
||||
```
|
||||
|
||||
## Function definition
|
||||
```js
|
||||
timeWeightedAvg = (tables=<-, unit) => tables
|
||||
|> integral(
|
||||
unit: unit,
|
||||
interpolate: "linear"
|
||||
)
|
||||
|> map(fn: (r) => ({
|
||||
r with
|
||||
_value: (r._value * float(v: uint(v: unit))) / float(v: int(v: r._stop) - int(v: r._start))
|
||||
}))
|
||||
```
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
title: Flux InfluxDB Tasks package
|
||||
list_title: InfluxDB Tasks package
|
||||
description: >
|
||||
The Flux InfluxDB Tasks package provides options and functions for working with
|
||||
[InfluxDB tasks](/influxdb/v2.0/process-data/get-started/).
|
||||
Import the `influxdata/influxdb/tasks` package.
|
||||
aliases:
|
||||
- /influxdb/v2.0/reference/flux/functions/influxdb-v1/
|
||||
menu:
|
||||
influxdb_2_0_ref:
|
||||
name: InfluxDB Tasks
|
||||
parent: Flux standard library
|
||||
weight: 202
|
||||
influxdb/v2.0/tags: [functions, tasks, package]
|
||||
related:
|
||||
- /influxdb/v2.0/process-data/get-started/
|
||||
---
|
||||
|
||||
The Flux InfluxDB Tasks package provides options and functions for working with
|
||||
[InfluxDB tasks](/influxdb/v2.0/process-data/get-started/).
|
||||
Import the `influxdata/influxdb/tasks` package:
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/tasks"
|
||||
```
|
||||
|
||||
## Options
|
||||
The InfluxDB Tasks package provides the following options:
|
||||
|
||||
#### lastSuccessTime
|
||||
Define the time of the last successful task run.
|
||||
_Only use this option to override the time of the last successful run provided by
|
||||
the InfluxDB task engine._
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/tasks"
|
||||
|
||||
option tasks.lastSuccessTime = 0000-01-01T00:00:00Z
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: tasks.lastSuccess() function
|
||||
description: The `tasks.lastSuccess()` function returns ...
|
||||
menu:
|
||||
influxdb_2_0_ref:
|
||||
name: tasks.lastSuccess
|
||||
parent: InfluxDB Tasks
|
||||
weight: 301
|
||||
---
|
||||
|
||||
The `tasks.lastSuccess()` function returns the time of last successful run of the
|
||||
InfluxDB task or the value of the `orTime` parameter if the task has never successfully run.
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/tasks"
|
||||
|
||||
tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### orTime
|
||||
The default time value returned if the task has never successfully run.
|
||||
|
||||
_**Data type:** Time_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Query data since the last successful task run
|
||||
```js
|
||||
import "influxdata/influxdb/tasks"
|
||||
|
||||
options task = {
|
||||
name: "Example task",
|
||||
every: 30m
|
||||
}
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z))
|
||||
// ...
|
||||
```
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
title: Flux Profiler package
|
||||
list_title: Profiler package
|
||||
description: >
|
||||
The Flux Profiler package provides performance profiling tools for Flux queries and operations.
|
||||
Import the `profiler` package.
|
||||
menu:
|
||||
influxdb_2_0_ref:
|
||||
name: Profiler
|
||||
parent: Flux standard library
|
||||
weight: 202
|
||||
influxdb/v2.0/tags: [functions, optimize, package]
|
||||
related:
|
||||
- /influxdb/v2.0/query-data/optimize-queries/
|
||||
---
|
||||
|
||||
The Flux Profiler package provides performance profiling tools for Flux queries and operations.
|
||||
Import the `profiler` package:
|
||||
|
||||
```js
|
||||
import "profiler"
|
||||
```
|
||||
|
||||
## Options
|
||||
The Profiler package includes the following options:
|
||||
|
||||
### enabledProfilers
|
||||
Enable Flux profilers.
|
||||
|
||||
_**Data type:** Array of strings_
|
||||
|
||||
```js
|
||||
import "profiler"
|
||||
|
||||
option profiler.enabledProfilers = [""]
|
||||
```
|
||||
|
||||
#### Available profilers
|
||||
|
||||
##### query
|
||||
The `query` profiler provides statistics about the execution of an entire Flux script.
|
||||
When enabled, results returned by [`yield()`](/influxdb/v2.0/reference/flux/stdlib/built-in/outputs/yield/)
|
||||
include a table with the following columns:
|
||||
|
||||
- **TotalDuration**: total query duration in nanoseconds.
|
||||
- **CompileDuration**: number of nanoseconds spent compiling the query.
|
||||
- **QueueDuration**: number of nanoseconds spent queueing.
|
||||
- **RequeueDuration**: number fo nanoseconds spent requeueing.
|
||||
- **PlanDuration**: number of nanoseconds spent planning the query.
|
||||
- **ExecuteDuration**: number of nanoseconds spent executing the query.
|
||||
- **Concurrency**: number of goroutines allocated to process the query.
|
||||
- **MaxAllocated**: maximum number of bytes the query allocated.
|
||||
- **TotalAllocated**: total number of bytes the query allocated (includes memory that was freed and then used again).
|
||||
- **RuntimeErrors**: error messages returned during query execution.
|
||||
- **flux/query-plan**: Flux query plan.
|
||||
- **influxdb/scanned-values**: value scanned by InfluxDB.
|
||||
- **influxdb/scanned-bytes**: number of bytes scanned by InfluxDB.
|
||||
|
||||
#### Use the query profiler to output statistics about query execution
|
||||
```js
|
||||
import "profilers"
|
||||
|
||||
option profiler.enabledProfiles["query"]
|
||||
|
||||
// ... Query to profile
|
||||
```
|
||||
|
|
@ -67,11 +67,8 @@ _**Data type:** Function_
|
|||
|
||||
The returned record must include the following fields:
|
||||
|
||||
- `username`
|
||||
- `channel`
|
||||
- `workspace`
|
||||
- `text`
|
||||
- `iconEmoji`
|
||||
- `color`
|
||||
|
||||
_For more information, see [`slack.message()`](/influxdb/v2.0/reference/flux/stdlib/slack/message/)_
|
||||
|
|
@ -92,11 +89,8 @@ crit_statuses = from(bucket: "example-bucket")
|
|||
|
||||
crit_statuses
|
||||
|> e(mapFn: (r) => ({
|
||||
username: r.username,
|
||||
channel: r.channel,
|
||||
workspace: r.workspace,
|
||||
text: r.text,
|
||||
iconEmoji: r.iconEmoji,
|
||||
color: r.color,
|
||||
})
|
||||
)()
|
||||
|
|
|
|||
|
|
@ -24,11 +24,8 @@ import "slack"
|
|||
slack.message(
|
||||
url: "https://slack.com/api/chat.postMessage",
|
||||
token: "mySuPerSecRetTokEn",
|
||||
username: "Fluxtastic",
|
||||
channel: "#flux",
|
||||
workspace: "",
|
||||
channel: "#flux",,
|
||||
text: "This is a message from the Flux slack.message() function.",
|
||||
iconEmoji: "wave",
|
||||
color: "good"
|
||||
)
|
||||
```
|
||||
|
|
@ -57,39 +54,16 @@ A token is only required if using the Slack chat.postMessage API.
|
|||
|
||||
_**Data type:** String_
|
||||
|
||||
### username
|
||||
The username to use when posting the message to a Slack channel. <span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### channel
|
||||
The name of channel to post the message to. <span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### workspace
|
||||
The name of the Slack workspace to use if there are multiple.
|
||||
Defaults to `""`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### text
|
||||
The text to display in the Slack message. <span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### iconEmoji
|
||||
The name of emoji to use as the user avatar when posting the message to Slack.
|
||||
<span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
{{% note %}}
|
||||
#### Things to know about iconEmoji
|
||||
- **Do not** enclose the name in colons `:` as you do in the Slack client.
|
||||
- `iconEmoji` only appears as the user avatar when using the Slack chat.postMessage API.
|
||||
{{% /note %}}
|
||||
|
||||
### color
|
||||
The color to include with the message.
|
||||
<span class="required">Required</span>
|
||||
|
|
@ -120,7 +94,6 @@ lastReported =
|
|||
slack.message(
|
||||
url: "https://slack.com/api/chat.postMessage",
|
||||
token: "mySuPerSecRetTokEn",
|
||||
username: "johndoe",
|
||||
channel: "#system-status",
|
||||
text: "The last reported status was \"${lastReported.status}\"."
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ title: Flux SQL package
|
|||
list_title: SQL package
|
||||
description: >
|
||||
The Flux SQL package provides tools for working with data in SQL databases such
|
||||
as MySQL, PostgreSQL, Snowflake, SQLite, Microsoft SQL Server, and Amazon Athena.
|
||||
as MySQL, PostgreSQL, Snowflake, SQLite, Microsoft SQL Server, Amazon Athena,
|
||||
and Google BigQuery.
|
||||
Import the `sql` package.
|
||||
aliases:
|
||||
- /influxdb/v2.0/reference/flux/functions/sql/
|
||||
|
|
@ -20,6 +21,7 @@ related:
|
|||
SQL Flux functions provide tools for working with data in SQL databases such as:
|
||||
|
||||
- Amazon Athena
|
||||
- Google BigQuery
|
||||
- Microsoft SQL Server
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ _**Data type:** String_
|
|||
The following drivers are available:
|
||||
|
||||
- awsathena
|
||||
- bigquery
|
||||
- mysql
|
||||
- postgres
|
||||
- snowflake
|
||||
|
|
@ -73,6 +74,10 @@ sqlserver://username:password@localhost:1234?database=examplebdb
|
|||
server=localhost;user id=username;database=examplebdb;
|
||||
server=localhost;user id=username;database=examplebdb;azure auth=ENV
|
||||
server=localhost;user id=username;database=examplebdbr;azure tenant id=77e7d537;azure client id=58879ce8;azure client secret=0123456789
|
||||
|
||||
# Google BigQuery DSNs
|
||||
bigquery://projectid/?param1=value¶m2=value
|
||||
bigquery://projectid/location?param1=value¶m2=value
|
||||
```
|
||||
|
||||
### query
|
||||
|
|
@ -88,6 +93,7 @@ _**Data type:** String_
|
|||
- [SQLite](#query-an-sqlite-database)
|
||||
- [Amazon Athena](#query-an-amazon-athena-database)
|
||||
- [SQL Server](#query-a-sql-server-database)
|
||||
- [Google BigQuery](#query-a-bigquery-database)
|
||||
|
||||
{{% note %}}
|
||||
The examples below use [InfluxDB secrets](/influxdb/v2.0/security/secrets/) to populate
|
||||
|
|
@ -250,3 +256,40 @@ _For information about managed identities, see [Microsoft managed identities](ht
|
|||
```
|
||||
azure auth=MSI
|
||||
```
|
||||
|
||||
### Query a BigQuery database
|
||||
```js
|
||||
import "sql"
|
||||
import "influxdata/influxdb/secrets"
|
||||
projectID = secrets.get(key: "BIGQUERY_PROJECT_ID")
|
||||
apiKey = secrets.get(key: "BIGQUERY_APIKEY")
|
||||
sql.from(
|
||||
driverName: "bigquery",
|
||||
dataSourceName: "bigquery://${projectID}/?apiKey=${apiKey}",
|
||||
query:"SELECT * FROM exampleTable"
|
||||
)
|
||||
```
|
||||
|
||||
#### Common BigQuery URL parameters
|
||||
- **dataset** - BigQuery dataset ID. When set, you can use unqualified table names in queries.
|
||||
|
||||
#### BigQuery authentication parameters
|
||||
The Flux BigQuery implementation uses the Google Cloud Go SDK.
|
||||
Provide your authentication credentials using one of the following methods:
|
||||
|
||||
- The `GOOGLE_APPLICATION_CREDENTIALS` environment variable that identifies the
|
||||
location of your credential JSON file.
|
||||
- Provide your BigQuery API key using the **apiKey** URL parameter in your BigQuery DSN.
|
||||
|
||||
###### Example apiKey URL parameter
|
||||
```
|
||||
bigquery://projectid/?apiKey=AIzaSyB6XK8IO5AzKZXoioQOVNTFYzbDBjY5hy4
|
||||
```
|
||||
|
||||
- Provide your base-64 encoded service account, refresh token, or JSON credentials
|
||||
using the **credentials** URL parameter in your BigQuery DSN.
|
||||
|
||||
###### Example credentials URL parameter
|
||||
```
|
||||
bigquery://projectid/?credentials=eyJ0eXBlIjoiYXV0...
|
||||
```
|
||||
|
|
|
|||
|
|
@ -34,12 +34,18 @@ _**Data type:** String_
|
|||
|
||||
The following drivers are available:
|
||||
|
||||
- bigquery
|
||||
- mysql
|
||||
- postgres
|
||||
- snowflake
|
||||
- sqlite3 – _Does not work with InfluxDB OSS or InfluxDB Cloud. More information [below](#write-data-to-an-sqlite-database)._
|
||||
- sqlserver, mssql
|
||||
|
||||
{{% warn %}}
|
||||
#### sql.to does not support Amazon Athena
|
||||
The `sql.to` function does not support writing data to [Amazon Athena](https://aws.amazon.com/athena/).
|
||||
{{% /warn %}}
|
||||
|
||||
### dataSourceName
|
||||
The data source name (DSN) or connection string used to connect to the SQL database.
|
||||
The string's form and structure depend on the [driver](#drivername) used.
|
||||
|
|
@ -67,6 +73,10 @@ sqlserver://username:password@localhost:1234?database=examplebdb
|
|||
server=localhost;user id=username;database=examplebdb;
|
||||
server=localhost;user id=username;database=examplebdb;azure auth=ENV
|
||||
server=localhost;user id=username;database=examplebdbr;azure tenant id=77e7d537;azure client id=58879ce8;azure client secret=0123456789
|
||||
|
||||
# Google BigQuery DSNs
|
||||
bigquery://projectid/?param1=value¶m2=value
|
||||
bigquery://projectid/location?param1=value¶m2=value
|
||||
```
|
||||
|
||||
### table
|
||||
|
|
@ -91,6 +101,7 @@ If writing to a **SQLite** database, set `batchSize` to `999` or less.
|
|||
- [Snowflake](#write-data-to-a-snowflake-database)
|
||||
- [SQLite](#write-data-to-an-sqlite-database)
|
||||
- [SQL Server](#write-data-to-a-sql-server-database)
|
||||
- [Google BigQuery](#write-data-to-a-sql-server-database)
|
||||
|
||||
{{% note %}}
|
||||
The examples below use [InfluxDB secrets](/influxdb/v2.0/security/secrets/) to populate
|
||||
|
|
@ -223,7 +234,39 @@ _For information about managed identities, see [Microsoft managed identities](ht
|
|||
azure auth=MSI
|
||||
```
|
||||
|
||||
{{% warn %}}
|
||||
### sql.to does not support Amazon Athena
|
||||
The `sql.to` function does not support writing data to [Amazon Athena](https://aws.amazon.com/athena/).
|
||||
{{% /warn %}}
|
||||
### Write to a BigQuery database
|
||||
```js
|
||||
import "sql"
|
||||
import "influxdata/influxdb/secrets"
|
||||
projectID = secrets.get(key: "BIGQUERY_PROJECT_ID")
|
||||
apiKey = secrets.get(key: "BIGQUERY_APIKEY")
|
||||
sql.to(
|
||||
driverName: "bigquery",
|
||||
dataSourceName: "bigquery://${projectID}/?apiKey=${apiKey}",
|
||||
table:"exampleTable"
|
||||
)
|
||||
```
|
||||
|
||||
#### Common BigQuery URL parameters
|
||||
- **dataset** - BigQuery dataset ID. When set, you can use unqualified table names in queries.
|
||||
|
||||
#### BigQuery authentication parameters
|
||||
The Flux BigQuery implementation uses the Google Cloud Go SDK.
|
||||
Provide your authentication credentials using one of the following methods:
|
||||
|
||||
- The `GOOGLE_APPLICATION_CREDENTIALS` environment variable that identifies the
|
||||
location of your credential JSON file.
|
||||
- Provide your BigQuery API key using the **apiKey** URL parameter in your BigQuery DSN.
|
||||
|
||||
###### Example apiKey URL parameter
|
||||
```
|
||||
bigquery://projectid/?apiKey=AIzaSyB6XK8IO5AzKZXoioQOVNTFYzbDBjY5hy4
|
||||
```
|
||||
|
||||
- Provide your base-64 encoded service account, refresh token, or JSON credentials
|
||||
using the **credentials** URL parameter in your BigQuery DSN.
|
||||
|
||||
###### Example credentials URL parameter
|
||||
```
|
||||
bigquery://projectid/?credentials=eyJ0eXBlIjoiYXV0...
|
||||
```
|
||||
|
|
|
|||
|
|
@ -9,11 +9,62 @@ menu:
|
|||
---
|
||||
|
||||
{{% note %}}
|
||||
The latest release of InfluxDB v2.0 beta includes **Flux v0.77.1**.
|
||||
_The latest release of InfluxDB v2.0 beta includes **Flux v0.77.1**.
|
||||
Though newer versions of Flux may be available, they will not be included with
|
||||
InfluxDB until the next InfluxDB v2.0 release._
|
||||
{{% /note %}}
|
||||
|
||||
## v0.83.1 [2020-09-02]
|
||||
|
||||
### Bug fixes
|
||||
- Single value integral interpolation.
|
||||
|
||||
---
|
||||
|
||||
## v0.83.0 [2020-09-01]
|
||||
|
||||
### Features
|
||||
- Improve window errors.
|
||||
- Add [BigQuery](https://cloud.google.com/bigquery) support to
|
||||
[`sql` package](/influxdb/v2.0/reference/flux/stdlib/sql/).
|
||||
- Add `TypeExpression` to `BuiltinStmt` and fix tests.
|
||||
- Add time-weighted average ([`timeWeightedAvg()` function](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg/)).
|
||||
- Update [`integral()`](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral/)
|
||||
with linear interpolation.
|
||||
- Make experimental tracing an attribute of the context.
|
||||
|
||||
### Bug fixes
|
||||
- Update builtin statement for `integral()`.
|
||||
- Add Rust JSON tests.
|
||||
- CSV no longer deadlocks when next transformation does not consume table.
|
||||
|
||||
---
|
||||
|
||||
## v0.82.2 [2020-08-25]
|
||||
|
||||
### Features
|
||||
- Add [`tasks.lastSuccess` function](/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess/)
|
||||
to retrieve the time of the last successful run of an InfluxDB task.
|
||||
|
||||
---
|
||||
|
||||
## v0.82.1 [2020-08-25]
|
||||
- _Internal code cleanup._
|
||||
|
||||
---
|
||||
|
||||
## v0.82.0 [2020-08-24]
|
||||
|
||||
### Features
|
||||
- Add the [`profiler` package](/influxdb/v2.0/reference/flux/stdlib/profiler/).
|
||||
- Add a documentation URL field to Flux errors.
|
||||
- Check InfluxDB schema compatibility.
|
||||
|
||||
### Bug fixes
|
||||
- Panic when a map object property contains an invalid type.
|
||||
|
||||
---
|
||||
|
||||
## v0.81.0 [2020-08-17]
|
||||
|
||||
### Features
|
||||
|
|
|
|||
|
|
@ -103,14 +103,14 @@ exports.handler = (event, context, callback) => {
|
|||
/////////////////////////////// Flux redirects ///////////////////////////////
|
||||
// Redirect flux guides and introduction based on latest InfluxDB version
|
||||
if (/v2/.test(latestVersions['influxdb'])) {
|
||||
temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/guides\//, `/influxdb/${latestVersions['influxdb']}/query-data/flux/`));
|
||||
temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/query-data/get-started/`));
|
||||
temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//, `/influxdb/${latestVersions['influxdb']}/query-data/flux/`));
|
||||
temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//, `/influxdb/${latestVersions['influxdb']}/query-data/get-started/`));
|
||||
} else {
|
||||
temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/guides\//, `/influxdb/${latestVersions['influxdb']}/flux/guides/`));
|
||||
temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/flux/introduction/`));
|
||||
temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//, `/influxdb/${latestVersions['influxdb']}/flux/guides/`));
|
||||
temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//, `/influxdb/${latestVersions['influxdb']}/flux/`));
|
||||
}
|
||||
// Redirect Flux stdlib and language sections to v2 Flux docs
|
||||
temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/(?:functions|stdlib|language)\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\//, `/influxdb/${latestVersions['influxdbv2']}/reference/flux/`));
|
||||
temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/(?:functions|stdlib|language)\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\//, `/influxdb/${latestVersions['influxdbv2']}/reference/flux/`));
|
||||
|
||||
// Redirect versionless and base version to v2 Flux docs
|
||||
temporaryRedirect(/^\/flux\/(?:v0\.[0-9]{1,2}\/|)$/.test(request.uri), `/influxdb/${latestVersions['influxdbv2']}/reference/flux/`);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,13 @@
|
|||
</div>
|
||||
<p><a href="/enterprise_influxdb/{{ $enterpriseVersion }}/">View documentation</a></p>
|
||||
</div>
|
||||
<div class="card kapacitor">
|
||||
<div class="card-content">
|
||||
<h2><a href="https://archive.docs.influxdata.com/enterprise_kapacitor/v1.5/" target="_blank">Kapacitor Enterprise <span class="version">v1.5</span></a></h2>
|
||||
<p>A high availability Kapacitor cluster with alert deduplication and backend authentication. Run Kapacitor Enterprise on your own infrastructure—on-premises, private cloud, public cloud, or at the edge.</p>
|
||||
</div>
|
||||
<p><a href="https://archive.docs.influxdata.com/enterprise_kapacitor/v1.5/" target="_blank">View documentation archive</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
{{ .Content }}
|
||||
{{ partial "article/related.html" . }}
|
||||
{{ partial "article/tags.html" . }}
|
||||
{{ partial "article/_feedback.html" . }}
|
||||
{{ partial "article/feedback.html" . }}
|
||||
</article>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
<hr/>
|
||||
<div class="feedback block">
|
||||
<h4 id="bug-reports-and-feedback">Support and feedback</h4>
|
||||
<p>
|
||||
Thank you for being part of our community!
|
||||
We welcome and encourage your feedback and bug reports for InfluxDB and this documentation.
|
||||
To find support or submit feedback, the following resources are available:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="https://community.influxdata.com/c/influxdb2" target="_blank">Post in the InfluxData Community</a>.</li>
|
||||
<li>Submit <strong>documentation issues</strong> to the <a href="https://github.com/influxdata/docs-v2" target="_blank">InfluxDB 2.0 documentation repository</a>.</li>
|
||||
<li>Submit <strong>InfluxDB issues</strong> to the <a href="https://github.com/influxdata/influxdb" target="_blank">InfluxDB repository</a>.</li>
|
||||
</ul>
|
||||
<p>
|
||||
For our <strong>InfluxDB Cloud</strong> customers, <a href="mailto:support@influxdata.com" target="_blank">InfluxData Support</a> is also available.
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }}
|
||||
{{ .Scratch.Set "product" (index $productPathData 0) }}
|
||||
{{ if in (.Scratch.Get "product") "influxdb" }}
|
||||
{{ .Scratch.Set "product" "influxdb" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $product := .Scratch.Get "product" }}
|
||||
{{ $productName := (index .Site.Data.products $product).name }}
|
||||
{{ $supportBlacklist := slice "chronograf" "kapacitor" }}
|
||||
|
||||
{{ .Scratch.Set "pageGithubLink" (print "https://github.com/influxdata/docs-v2/edit/master/content/" .File.Path) }}
|
||||
{{ .Scratch.Set "productGithubLink" (print "https://github.com/influxdata/" $product "/issues/new/choose/") }}
|
||||
{{ $pageGithubLink := .Scratch.Get "pageGithubLink" }}
|
||||
{{ $productGithubLink := .Scratch.Get "productGithubLink" }}
|
||||
|
||||
<hr/>
|
||||
<div class="feedback block">
|
||||
<div class="support">
|
||||
<h4 id="bug-reports-and-feedback">Support and feedback</h4>
|
||||
<p>
|
||||
Thank you for being part of our community!
|
||||
We welcome and encourage your feedback and bug reports for {{ $productName }} and this documentation.
|
||||
To find support, the following resources are available:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a class="community" href="https://community.influxdata.com/" target="_blank">InfluxData Community</a></li>
|
||||
<li><a class="slack" href="https://influxdata.com/slack" target="_blank">InfluxDB Community Slack</a></li>
|
||||
</ul>
|
||||
{{ if not (in $supportBlacklist $product) }}
|
||||
<p><strong>InfluxDB Cloud{{ if eq $product "influxdb" }} and InfluxDB Enterprise{{ end }} customers</strong> can <a href="mailto:support@influxdata.com" target="_blank">contact InfluxData Support</a>.</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a href="{{ $pageGithubLink }}" class="btn edit" target="_blank">Edit this page</a>
|
||||
<a href="https://github.com/influxdata/docs-v2/issues/new/" class="btn issue" target="_blank">Submit docs issue</a>
|
||||
<a href="{{ $productGithubLink }}" class="btn issue" target="_blank">Submit {{ $productName }} issue</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -17,8 +17,32 @@
|
|||
{{ $baseURL := replaceRE `\/$` "" .Site.BaseURL }}
|
||||
|
||||
{{ $scratch.Set "canonicalURL" (print $baseURL .RelPermalink) }}
|
||||
{{ if ge (len (findRE "[^/]+.*?" .RelPermalink)) 2 }}
|
||||
{{ $scratch.Set "canonicalURL" (print $baseURL (replaceRE `v[0-9]\.[0-9]{1,2}` $latestMinorVersion .RelPermalink))}}
|
||||
<!-- Override canonical URL with 'canonical' frontmatter, support latest shortcode -->
|
||||
{{ if .Page.Params.canonical }}
|
||||
{{ if in .Page.Params.canonical "{{< latest" }}
|
||||
|
||||
|
||||
{{ $product := replaceRE `[ \"]` "" (index (findRE ` \"\w*\"` .Page.Params.canonical) 0) }}
|
||||
{{ $majorVersion := replaceRE `[ \"]` "" (index (findRE ` \"\w*\"` .Page.Params.canonical) 1) }}
|
||||
{{ $minorVersions := (index $.Site.Data.products $product).versions }}
|
||||
|
||||
{{ $scratch.Set "latestVersion" (index $.Site.Data.products $product).latest }}
|
||||
{{ if gt (len $majorVersion) 0 }}
|
||||
{{ if eq $majorVersion "v1" }}
|
||||
{{ $scratch.Set "latestVersion" (index (last 1 (findRE `v1\.[0-9]{1,2}` (delimit $minorVersions " "))) 0) }}
|
||||
{{ else if eq $majorVersion "v2" }}
|
||||
{{ $scratch.Set "latestVersion" (index (last 1 (findRE `v2\.[0-9]{1,2}` (delimit $minorVersions " "))) 0) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $productLatestVersion := $scratch.Get "latestVersion" }}
|
||||
{{ $replaceLatest := replaceRE `\{\{\< latest \".*\" \>\}\}` (print $product "/" $productLatestVersion) .Page.Params.canonical }}
|
||||
{{ $scratch.Set "canonicalURL" (print $baseURL $replaceLatest) }}
|
||||
{{ else }}
|
||||
{{ $scratch.Set "canonicalURL" (print $baseURL .Page.Params.canonical) }}
|
||||
{{ end }}
|
||||
{{ else if ge (len (findRE "[^/]+.*?" .RelPermalink)) 2 }}
|
||||
{{ $scratch.Set "canonicalURL" (print $baseURL (replaceRE `v[0-9]\.[0-9]{1,2}` $latestMinorVersion .RelPermalink)) }}
|
||||
{{ end }}
|
||||
|
||||
{{ $canonicalURL := $scratch.Get "canonicalURL" }}
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 62 KiB |
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 122.8 122.8" style="enable-background:new 0 0 122.8 122.8;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#E01E5A;}
|
||||
.st1{fill:#36C5F0;}
|
||||
.st2{fill:#2EB67D;}
|
||||
.st3{fill:#ECB22E;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M25.8,77.6c0,7.1-5.8,12.9-12.9,12.9S0,84.7,0,77.6c0-7.1,5.8-12.9,12.9-12.9h12.9V77.6z"/>
|
||||
<path class="st0" d="M32.3,77.6c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v32.3c0,7.1-5.8,12.9-12.9,12.9s-12.9-5.8-12.9-12.9
|
||||
C32.3,109.9,32.3,77.6,32.3,77.6z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M45.2,25.8c-7.1,0-12.9-5.8-12.9-12.9S38.1,0,45.2,0s12.9,5.8,12.9,12.9v12.9H45.2z"/>
|
||||
<path class="st1" d="M45.2,32.3c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9H12.9C5.8,58.1,0,52.3,0,45.2s5.8-12.9,12.9-12.9
|
||||
C12.9,32.3,45.2,32.3,45.2,32.3z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st2" d="M97,45.2c0-7.1,5.8-12.9,12.9-12.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9H97V45.2z"/>
|
||||
<path class="st2" d="M90.5,45.2c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9V12.9C64.7,5.8,70.5,0,77.6,0
|
||||
c7.1,0,12.9,5.8,12.9,12.9V45.2z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st3" d="M77.6,97c7.1,0,12.9,5.8,12.9,12.9c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9V97H77.6z"/>
|
||||
<path class="st3" d="M77.6,90.5c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h32.3c7.1,0,12.9,5.8,12.9,12.9
|
||||
c0,7.1-5.8,12.9-12.9,12.9H77.6z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
Loading…
Reference in New Issue