diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1dd82d7b1..ffd410c2d 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,7 +4,7 @@ jobs:
docker:
- image: circleci/node:latest
environment:
- HUGO_VERSION: "0.55.1"
+ HUGO_VERSION: "0.56.3"
S3DEPLOY_VERSION: "2.3.2"
steps:
- checkout
diff --git a/README.md b/README.md
index 422d5004c..d12011dd0 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,13 @@ This repository contains the InfluxDB 2.x documentation published at [docs.influ
## Contributing
We welcome and encourage community contributions. For information about contributing to the InfluxData documentation, see [Contribution guidelines](CONTRIBUTING.md).
+## Reporting a Vulnerability
+InfluxData takes security and our users' trust very seriously.
+If you believe you have found a security issue in any of our open source projects,
+please responsibly disclose it by contacting security@influxdata.com.
+More details about security vulnerability reporting,
+including our GPG key, can be found here. https://www.influxdata.com/how-to-report-security-vulnerabilities/
+
## Run the docs locally
The InfluxData documentation uses [Hugo](https://gohugo.io/), a static site
generator built in Go.
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..79d053066
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,11 @@
+# Security Policy
+
+## Reporting a Vulnerability
+
+Reporting a Vulnerability
+
+InfluxData takes security and our users' trust very seriously.
+If you believe you have found a security issue in any of our open source projects,
+please responsibly disclose it by contacting security@influxdata.com.
+More details about security vulnerability reporting, including our GPG key,
+can be found here. https://www.influxdata.com/how-to-report-security-vulnerabilities/
diff --git a/assets/styles/layouts/_article.scss b/assets/styles/layouts/_article.scss
index c9ca666a0..1c8ef4a49 100644
--- a/assets/styles/layouts/_article.scss
+++ b/assets/styles/layouts/_article.scss
@@ -18,7 +18,8 @@
}
}
h2,h3,h4,h5,h6 {
- & + .highlight pre { margin-top: .5rem; }
+ & + .highlight pre { margin-top: .5rem }
+ & + pre { margin-top: .5rem }
& + .code-tabs-wrapper { margin-top: 0; }
}
h1 {
diff --git a/assets/styles/layouts/_inline-icons.scss b/assets/styles/layouts/_inline-icons.scss
index 0609c0c24..b654d14bd 100644
--- a/assets/styles/layouts/_inline-icons.scss
+++ b/assets/styles/layouts/_inline-icons.scss
@@ -26,22 +26,22 @@
&.ui-toggle {
display: inline-block;
position: relative;
- width: 34px;
- height: 22px;
- background: #1C1C21;
- border: 2px solid #383846;
+ width: 28px;
+ height: 16px;
+ background: $b-pool;
border-radius: .7rem;
- vertical-align: text-bottom;
+ vertical-align: text-top;
+ margin-top: 2px;
.circle {
display: inline-block;
position: absolute;
border-radius: 50%;
- height: 12px;
- width: 12px;
- background: #22ADF6;
- top: 3px;
- right: 3px;
+ height: 8px;
+ width: 8px;
+ background: $g20-white;
+ top: 4px;
+ right: 4px;
}
}
}
diff --git a/assets/styles/layouts/article/_code.scss b/assets/styles/layouts/article/_code.scss
index a7038a799..85a88cc2b 100644
--- a/assets/styles/layouts/article/_code.scss
+++ b/assets/styles/layouts/article/_code.scss
@@ -56,7 +56,7 @@ pre {
padding: 0;
font-size: .95rem;
line-height: 1.5rem;
- white-space: pre-wrap;
+ white-space: pre;
}
}
diff --git a/assets/styles/themes/_theme-dark.scss b/assets/styles/themes/_theme-dark.scss
index 26efd67cc..4ca1c16ad 100644
--- a/assets/styles/themes/_theme-dark.scss
+++ b/assets/styles/themes/_theme-dark.scss
@@ -86,7 +86,7 @@ $article-note-table-row-alt: #3B2862;
$article-note-table-scrollbar: $np-deepnight;
$article-note-shadow: $np-deepnight;
$article-note-code: $cp-comet;
-$article-note-code-bg: $wp-telopea;
+$article-note-code-bg: $wp-jaguar;
$article-note-code-accent1: #567375;
$article-note-code-accent2: $b-pool;
$article-note-code-accent3: $gr-viridian;
diff --git a/assets/styles/tools/_color-palette.scss b/assets/styles/tools/_color-palette.scss
index 7004a1aa2..146282cfa 100644
--- a/assets/styles/tools/_color-palette.scss
+++ b/assets/styles/tools/_color-palette.scss
@@ -24,6 +24,7 @@ $g19-ghost: #FAFAFC;
$g20-white: #FFFFFF; // Brand color
// Warm Purples - Magentas
+$wp-jaguar: #1d0135;
$wp-telopea: #23043E;
$wp-violentdark: #2d0749;
$wp-violet: #32094E;
diff --git a/assets/styles/tools/_icomoon.scss b/assets/styles/tools/_icomoon.scss
index dfd7c1f91..32f4e000f 100644
--- a/assets/styles/tools/_icomoon.scss
+++ b/assets/styles/tools/_icomoon.scss
@@ -1,10 +1,10 @@
@font-face {
font-family: 'icomoon';
- src: url('fonts/icomoon.eot?e8u66e');
- src: url('fonts/icomoon.eot?e8u66e#iefix') format('embedded-opentype'),
- url('fonts/icomoon.ttf?e8u66e') format('truetype'),
- url('fonts/icomoon.woff?e8u66e') format('woff'),
- url('fonts/icomoon.svg?e8u66e#icomoon') format('svg');
+ src: url('fonts/icomoon.eot?9r9zke');
+ src: url('fonts/icomoon.eot?9r9zke#iefix') format('embedded-opentype'),
+ url('fonts/icomoon.ttf?9r9zke') format('truetype'),
+ url('fonts/icomoon.woff?9r9zke') format('woff'),
+ url('fonts/icomoon.svg?9r9zke#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
@@ -24,9 +24,24 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-ui-disks-nav:before {
+ content: "\e93c";
+}
+.icon-ui-wrench-nav:before {
+ content: "\e93d";
+}
+.icon-ui-eye-closed:before {
+ content: "\e956";
+}
+.icon-ui-eye-open:before {
+ content: "\e957";
+}
.icon-ui-chat:before {
content: "\e93a";
}
+.icon-ui-bell:before {
+ content: "\e93b";
+}
.icon-ui-cloud:before {
content: "\e93f";
}
diff --git a/content/v2.0/cloud/account-management/billing.md b/content/v2.0/cloud/account-management/billing.md
new file mode 100644
index 000000000..de4e41ff4
--- /dev/null
+++ b/content/v2.0/cloud/account-management/billing.md
@@ -0,0 +1,99 @@
+---
+title: Add payment method and view billing
+list_title: Add payment and view billing
+description: >
+ Add your InfluxDB Cloud payment method and view billing information.
+weight: 103
+menu:
+ v2_0_cloud:
+ parent: Account management
+ name: Add payment and view billing
+---
+
+- Hover over the **Usage** icon in the left navigation bar and select **Billing**.
+
+ {{< nav-icon "cloud" >}}
+
+ Complete the following procedures as needed:
+
+ - [Add or update your {{< cloud-name >}} payment method](#add-or-update-your-influxdb-cloud-2-0-payment-method)
+ - [Add or update your contact information](#add-or-update-your-contact-information)
+ - [Send notifications when usage exceeds an amount](#send-notifications-when-usage-exceeds-an-amount)
+
+ View information about:
+
+ - [Pay As You Go billing](#view-pay-as-you-go-billing-information)
+ - [Free plan](#view-free-plan-information)
+ - [Exceeded rate limits](#exceeded-rate-limits)
+ - [Billing cycle](#billing-cycle)
+ - [Declined or late payments](#declined-or-late-payments)
+
+### Add or update your InfluxDB Cloud 2.0 payment method
+
+1. On the Billing page:
+ - To update, click the **Change Payment** button on the Billing page.
+ - In the **Payment Method** section:
+ - Enter your cardholder name and number
+ - Select your expiration month and year
+ - Enter your CVV code and select your card type
+ - Enter your card billing address
+
+2. Click **Add Card**.
+
+### Add or update your contact information
+
+1. On the Billing page:
+ - To update, click the **Edit Information** button.
+ - In the **Contact Information** section, enter your name, company, and address.
+2. Click **Save Contact Info**.
+
+### Send notifications when usage exceeds an amount
+
+1. On the Billing page, click **Notification Settings**.
+2. Select the **Send email notification** toggle, and then enter the email address to notify.
+3. Enter the dollar amount to trigger a notification email. By default, an email is triggered when the amount exceeds $10. (Whole dollar amounts only. For example, $10.50 is not a supported amount.)
+
+### View Pay As You Go billing information
+
+- On the Billing page, view your billing information, including:
+ - Account balance
+ - Last billing update (updated hourly)
+ - Past invoices
+ - Payment method
+ - Contact information
+ - Notification settings
+
+### View Free plan information
+
+- On the Billing page, view the total limits available for the Free plan.
+
+### Exceeded rate limits
+
+If you exceed your plan's [rate limits](/v2.0/cloud/pricing-plans/), {{< cloud-name >}} provides a notification in the {{< cloud-name "short" >}} user interface (UI) and adds a rate limit event to your **Usage** page for review.
+
+All rate-limited requests are rejected; including both read and write requests.
+_Rate-limited requests are **not** queued._
+
+_To remove rate limits, [upgrade to a Pay As You Go Plan](/v2.0/cloud/account-management/upgrade-to-payg/)._
+
+#### Rate-limited HTTP response code
+
+When a request exceeds your plan's rate limit, the InfluxDB API returns the following response:
+
+```
+HTTP 429 “Too Many Requests”
+Retry-After: xxx (seconds to wait before retrying the request)
+```
+
+### Billing cycle
+
+Billing occurs on the first day of the month for the previous month. For example, if you start the Pay As You Go plan on September 15, you're billed on October 1 for your usage from September 15-30.
+
+### Declined or late payments
+
+| Timeline | Action |
+|:----------------------------|:------------------------------------------------------------------------------------------------------------------------|
+| **Initial declined payment**| We'll retry charge every 72 hours. During this period, update your payment method to successfully process your payment. |
+| **One week later** | Account disabled except data writes. Update your payment method to successfully process your payment and enable your account. |
+| **10-14 days later** | Account completely disabled. During this period, you must contact us at support@influxdata.com to process your payment and enable your account. |
+| **21 days later** | Account suspended. Contact support@influxdata.com to settle your final bill and retrieve a copy of your data or access to InfluxDB Cloud dashboards, tasks, Telegraf configurations, and so on.|
diff --git a/content/v2.0/cloud/account-management/offboarding.md b/content/v2.0/cloud/account-management/offboarding.md
index 34b3f6bc9..ea60507b8 100644
--- a/content/v2.0/cloud/account-management/offboarding.md
+++ b/content/v2.0/cloud/account-management/offboarding.md
@@ -30,15 +30,15 @@ For details, see [Export a task](/v2.0/process-data/manage-tasks/export-task/).
#### Export dashboards
-For details, see [Export a dashboard](v2.0/visualize-data/dashboards/export-dashboard/).
+For details, see [Export a dashboard](/v2.0/visualize-data/dashboards/export-dashboard/).
#### Telegraf configurations
**To save a Telegraf configuration:**
-1. Click in the **Organizations** icon in the navigation bar.
+1. Click in the **Settings** icon in the navigation bar.
- {{< nav-icon "orgs" >}}
+ {{< nav-icon "settings" >}}
2. Select the **Telegraf** tab. A list of existing Telegraf configurations appears.
3. Click on the name of a Telegraf configuration.
diff --git a/content/v2.0/cloud/get-started.md b/content/v2.0/cloud/get-started.md
index be12978cf..7a1e9fb23 100644
--- a/content/v2.0/cloud/get-started.md
+++ b/content/v2.0/cloud/get-started.md
@@ -43,7 +43,7 @@ Once you're ready to grow, [upgrade to the Pay As You Go Plan](/v2.0/cloud/accou
5. Click **Continue**. {{< cloud-name >}} opens with a default organization
and bucket (both created from your email address).
- _To update organization and bucket names, see [Update an organtization](/v2.0/organizations/update-org/)
+ _To update organization and bucket names, see [Update an organization](/v2.0/organizations/update-org/)
and [Update a bucket](/v2.0/organizations/buckets/update-bucket/#update-a-bucket-s-name-in-the-influxdb-ui)._
{{% cloud-msg %}}
@@ -117,7 +117,7 @@ The primary differences between InfluxDB OSS 2.0 and InfluxDB Cloud 2.0 are:
targets are not available in {{< cloud-name "short" >}}.
- {{< cloud-name "short" >}} instances are currently limited to a single organization with a single user.
- Retrieving data from a file based CSV source using the `file` parameter of the
- [`csv.from()`](/v2/reference/flux/functions/csv/from) function is not supported;
+ [`csv.from()`](/v2.0/reference/flux/functions/csv/from) function is not supported;
however you can use raw CSV data with the `csv` parameter.
- Multi-organization accounts and multi-user organizations are currently not
available in {{< cloud-name >}}.
@@ -139,4 +139,4 @@ The primary differences between InfluxDB OSS 2.0 and InfluxDB Cloud 2.0 are:
the new user interface (InfluxDB UI) offers quick and effortless onboarding,
richer user experiences, and significantly quicker results.
- **Usage-based pricing**: The [The Pay As You Go Plan](/v2.0/cloud/pricing-plans/#pay-as-you-go-plan)
- offers more flexibility and ensures that you only pay for what you use.
+ offers more flexibility and ensures that you only pay for what you use. To estimate your projected usage costs, use the [InfluxDB Cloud 2.0 pricing calculator](/v2.0/cloud/pricing-calculator/).
diff --git a/content/v2.0/cloud/pricing-calculator.md b/content/v2.0/cloud/pricing-calculator.md
new file mode 100644
index 000000000..bca77ea4b
--- /dev/null
+++ b/content/v2.0/cloud/pricing-calculator.md
@@ -0,0 +1,49 @@
+---
+title: InfluxDB Cloud 2.0 pricing calculator
+description: >
+ Use the InfluxDB Cloud 2.0 pricing calculator to estimate costs by adjusting the number of devices,
+ plugins, metrics, and writes for the Pay As You Go Plan.
+weight: 2
+menu:
+ v2_0_cloud:
+ name: Pricing calculator
+---
+
+Use the {{< cloud-name >}} pricing calculator to estimate costs for the Pay As You Go plan by adjusting your number of devices,
+ plugins, users, dashboards, writes, and retention. Default configurations include:
+
+| Configuration | Hobby | Standard | Professional | Enterprise |
+|:-----------------------------------|-------:|---------:|-------------:|-----------:|
+| **Devices** | 8 | 200 | 500 | 1000 |
+| **Plugins per device** | 1 | 4 | 4 | 5 |
+| **Users** | 1 | 2 | 10 | 20 |
+| **Concurrent dashboards per user** | 2 | 2 | 2 | 2 |
+| **Writes per minute** | 6 | 4 | 3 | 3 |
+| **Average retention in days** | 7 | 30 | 30 | 30 |
+
+Guidelines used to estimate costs for default configurations:
+
+- Average metrics per plugin = 25
+- Average KB per value = 0.01
+- Number of cells per dashboard = 10
+- Average response KB per cell = 0.5
+- Average query duration = 75ms
+
+**To estimate costs**
+
+1. Do one of the following:
+
+ - Free plan. Hover over the **Usage** icon in the left navigation bar and select **Billing**.
+
+ {{< nav-icon "cloud" >}}
+
+ Then click the **Pricing Calculator** link at the bottom of the page.
+ - Pay As You Go plan. Open the pricing calculator [here](https://cloud2.influxdata.com/pricing).
+3. Choose your region.
+4. Select your configuration:
+ - **Hobby**. For a single user monitoring a few machines or sensors.
+ - **Standard**. For a single team requiring real-time visibility and monitoring a single set of use cases.
+ - **Professional**. For teams monitoring multiple disparate systems or use cases.
+ - **Enterprise**. For teams monitoring multiple domains and use cases accessing a variety of dashboards.
+5. Adjust the default configuration values to match your number of devices, plugins, metrics, and so on. The **Projected Usage** costs are automatically updated as you adjust your configuration.
+6. Click **Get started with InfluxDB Cloud** [to get started](https://v2.docs.influxdata.com/v2.0/cloud/get-started/).
diff --git a/content/v2.0/cloud/pricing-plans.md b/content/v2.0/cloud/pricing-plans.md
index 96f84efd6..3582ffd0b 100644
--- a/content/v2.0/cloud/pricing-plans.md
+++ b/content/v2.0/cloud/pricing-plans.md
@@ -16,35 +16,50 @@ InfluxDB Cloud 2.0 offers two pricing plans:
- [Free Plan](#free-plan)
- [Pay As You Go Plan](#pay-as-you-go-plan)
+To estimate your projected usage costs, use the [InfluxDB Cloud 2.0 pricing calculator](/v2.0/cloud/pricing-calculator/).
+
## Free Plan
+
All new {{< cloud-name >}} accounts start with a rate-limited Free Plan.
-Use it as much and as long as you want within the Free Plan rate limits:
+Use this plan as much and as long as you want within the Free Plan rate limits:
#### Free Plan rate limits
+
- **Writes:** 3MB every 5 minutes
- **Query:** 30MB every 5 minutes
- **Storage:** 72-hour data retention
+- **Series cardinality:** 10,000
- **Create:**
- Up to 5 dashboards
- Up to 5 tasks
- Up to 2 buckets
+ - Up to 2 checks
+ - Up to 2 notification rules
+ - Unlimited Slack notification endpoints
+
_To remove rate limits, [upgrade to a Pay As You Go Plan](/v2.0/cloud/account-management/upgrade-to-payg/)._
## Pay As You Go Plan
-Pay As You Go Plans offer more flexibility and ensure you only pay for what you use.
+
+The Pay As You Go Plan offers more flexibility and ensures you only pay for what you [use]((/v2.0/cloud/account-management/data-usage/).
#### Pay As You Go Plan rate limits
-In order to protect against any intentional or unintentional harm,
-Pay As You Go Plans include soft rate limits:
+
+To protect against any intentional or unintentional harm, Pay As You Go Plans include soft rate limits:
- **Writes:** 300MB every 5 minutes
+- **Ingest batch size:** 50MB
- **Queries:** 3000MB every 5 minutes
- **Storage:** Unlimited retention
+- **Series cardinality:** 1,000,000
- **Create:**
- Unlimited dashboards
- Unlimited tasks
- Unlimited buckets
- Unlimited users
+ - Unlimited checks
+ - Unlimited notification rules
+ - Unlimited PagerDuty, Slack, and HTTP notification endpoints
_To request higher rate limits, contact [InfluxData Support](mailto:support@influxdata.com)._
diff --git a/content/v2.0/get-started.md b/content/v2.0/get-started.md
index 8470f8564..539d98f6c 100644
--- a/content/v2.0/get-started.md
+++ b/content/v2.0/get-started.md
@@ -27,7 +27,7 @@ This article describes how to get started with InfluxDB OSS. To get started with
### Download and install InfluxDB v2.0 alpha
Download InfluxDB v2.0 alpha for macOS.
-InfluxDB v2.0 alpha (macOS)
+InfluxDB v2.0 alpha (macOS)
### Unpackage the InfluxDB binaries
Unpackage the downloaded archive.
@@ -36,7 +36,7 @@ _**Note:** The following commands are examples. Adjust the file paths to your ow
```sh
# Unpackage contents to the current working directory
-gunzip -c ~/Downloads/influxdb_2.0.0-alpha.16_darwin_amd64.tar.gz | tar xopf -
+gunzip -c ~/Downloads/influxdb_2.0.0-alpha.18_darwin_amd64.tar.gz | tar xopf -
```
If you choose, you can place `influx` and `influxd` in your `$PATH`.
@@ -44,7 +44,7 @@ You can also prefix the executables with `./` to run then in place.
```sh
# (Optional) Copy the influx and influxd binary to your $PATH
-sudo cp influxdb_2.0.0-alpha.16_darwin_amd64/{influx,influxd} /usr/local/bin/
+sudo cp influxdb_2.0.0-alpha.18_darwin_amd64/{influx,influxd} /usr/local/bin/
```
{{% note %}}
@@ -90,8 +90,8 @@ influxd --reporting-disabled
### Download and install InfluxDB v2.0 alpha
Download the InfluxDB v2.0 alpha package appropriate for your chipset.
-InfluxDB v2.0 alpha (amd64)
-InfluxDB v2.0 alpha (arm)
+InfluxDB v2.0 alpha (amd64)
+InfluxDB v2.0 alpha (arm)
### Place the executables in your $PATH
Unpackage the downloaded archive and place the `influx` and `influxd` executables in your system `$PATH`.
@@ -100,10 +100,10 @@ _**Note:** The following commands are examples. Adjust the file names, paths, an
```sh
# Unpackage contents to the current working directory
-tar xvzf path/to/influxdb_2.0.0-alpha.16_linux_amd64.tar.gz
+tar xvzf path/to/influxdb_2.0.0-alpha.18_linux_amd64.tar.gz
# Copy the influx and influxd binary to your $PATH
-sudo cp influxdb_2.0.0-alpha.16_linux_amd64/{influx,influxd} /usr/local/bin/
+sudo cp influxdb_2.0.0-alpha.18_linux_amd64/{influx,influxd} /usr/local/bin/
```
{{% note %}}
diff --git a/content/v2.0/monitor-alert/_index.md b/content/v2.0/monitor-alert/_index.md
new file mode 100644
index 000000000..cd52ba5b2
--- /dev/null
+++ b/content/v2.0/monitor-alert/_index.md
@@ -0,0 +1,38 @@
+---
+title: Monitor data and send alerts
+seotitle: Monitor data and send alerts
+description: >
+ Monitor your time series data and send alerts by creating checks, notification
+ rules, and notification endpoints.
+menu:
+ v2_0:
+ name: Monitor & alert
+weight: 6
+v2.0/tags: [monitor, alert, checks, notification, endpoints]
+---
+
+Monitor your time series data and send alerts by creating checks, notification
+rules, and notification endpoints.
+
+## The monitoring workflow
+
+1. A [check](/v2.0/reference/glossary/#check) in InfluxDB queries data and assigns a status with a `_level` based on specific conditions.
+2. InfluxDB stores the output of a check in the `statuses` measurement in the `_monitoring` system bucket.
+3. [Notification rules](/v2.0/reference/glossary/#notification-rule) check data in the `statuses`
+ measurement and, based on conditions set in the notification rule, send a message
+ to a [notification endpoint](/v2.0/reference/glossary/#notification-endpoint).
+4. InfluxDB stores notifications in the `notifications` measurement in the `_monitoring` system bucket.
+
+## Monitor your data
+To get started, do the following:
+
+1. [Create checks](/v2.0/monitor-alert/checks/create/) to monitor data and assign a status.
+2. [Add notification endpoints](/v2.0/monitor-alert/notification-endpoints/create/)
+ to send notifications to third parties.
+3. [Create notification rules](/v2.0/monitor-alert/notification-rules/create) to check
+ statuses and send notifications to your notifications endpoints.
+
+
+## Manage your monitoring and alerting pipeline
+
+{{< children >}}
diff --git a/content/v2.0/monitor-alert/checks/_index.md b/content/v2.0/monitor-alert/checks/_index.md
new file mode 100644
index 000000000..2c84bb054
--- /dev/null
+++ b/content/v2.0/monitor-alert/checks/_index.md
@@ -0,0 +1,19 @@
+---
+title: Manage checks
+seotitle: Manage monitoring checks in InfluxDB
+description: >
+ Checks in InfluxDB query data and apply a status or level to each data point based on specified conditions.
+menu:
+ v2_0:
+ parent: Monitor & alert
+weight: 101
+v2.0/tags: [monitor, checks, notifications, alert]
+related:
+ - /v2.0/monitor-alert/notification-rules/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+Checks in InfluxDB query data and apply a status or level to each data point based on specified conditions.
+Learn how to create and manage checks:
+
+{{< children >}}
diff --git a/content/v2.0/monitor-alert/checks/create.md b/content/v2.0/monitor-alert/checks/create.md
new file mode 100644
index 000000000..c2b8964f1
--- /dev/null
+++ b/content/v2.0/monitor-alert/checks/create.md
@@ -0,0 +1,155 @@
+---
+title: Create checks
+seotitle: Create monitoring checks in InfluxDB
+description: >
+ Create a check in the InfluxDB UI.
+menu:
+ v2_0:
+ parent: Manage checks
+weight: 201
+related:
+ - /v2.0/monitor-alert/notification-rules/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+Create a check in the InfluxDB user interface (UI).
+Checks query data and apply a status to each point based on specified conditions.
+
+## Check types
+There are two types of checks – a threshold check and a deadman check.
+
+#### Threshold check
+A threshold check assigns a status based on a value being above, below,
+inside, or outside of defined thresholds.
+[Create a threshold check](#create-a-threshold-check).
+
+#### Deadman check
+A deadman check assigns a status to data when a series or group doesn't report
+in a specified amount of time.
+[Create a deadman check](#create-a-deadman-check).
+
+## Parts of a check
+A check consists of two parts – a query and check configuration.
+
+#### Check query
+- Specifies the dataset to monitor.
+- May include tags to narrow results.
+
+#### Check configuration
+- Defines check properties, including the check interval and status message.
+- Evaluates specified conditions and applies a status (if applicable) to each data point:
+ - `crit`
+ - `warn`
+ - `info`
+ - `ok`
+- Stores status in the `_level` column.
+
+## Create a check in the InfluxDB UI
+1. Click **Monitoring & Alerting** in the sidebar in the InfluxDB UI.
+
+ {{< nav-icon "alerts" >}}
+
+2. In the top right corner of the **Checks** column, click **{{< icon "plus" >}} Create**
+ and select the [type of check](#check-types) to create.
+3. Click **Name this check** in the top left corner and provide a unique name for the check.
+
+#### Configure the check query
+1. Select the **bucket**, **measurement**, **field** and **tag sets** to query.
+2. If creating a threshold check, select an **aggregate function**.
+ Aggregate functions aggregate data between the specified check intervals and
+ return a single value for the check to process.
+
+ In the **Aggregate functions** column, select an interval from the interval drop-down list
+ (for example, "Every 5 minutes") and an aggregate function from the list of functions.
+
+3. Click **Submit** to run the query and preview the results.
+ To see the raw query results, click the **{{< icon "toggle" >}} View Raw Data** toggle.
+
+#### Configure the check
+1. Click **2. Check** near the top of the window.
+2. In the **Properties** column, configure the following:
+
+ ##### Schedule Every
+ Select the interval to run the check (for example, "Every 5 minutes").
+ This interval matches the aggregate function interval for the check query.
+ _Changing the interval here will update the aggregate function interval._
+
+ ##### Offset
+ Delay the execution of a task to account for any late data.
+ Offset queries do not change the queried time range.
+
+ {{% note %}}Your offset must be shorter than your [check interval](#schedule-every).
+ {{% /note %}}
+
+ ##### Tags
+ Add custom tags to the query output.
+ Each custom tag appends a new column to each row in the query output.
+ The column label is the tag key and the column value is the tag value.
+
+ Use custom tags to associate additional metadata with the check.
+ Common metadata tags across different checks lets you easily group and organize checks.
+ You can also use custom tags in [notification rules](/v2.0/monitor-alert/notification-rules/create/).
+
+3. In the **Status Message Template** column, enter the status message template for the check.
+ Use [Flux string interpolation](/v2.0/reference/flux/language/string-interpolation/)
+ to populate the message with data from the query.
+
+ {{% note %}}
+#### Flux only interpolates string values
+Flux currently interpolates only string values.
+Use the [string() function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string/)
+to convert non-string values to strings.
+
+```js
+count = 12
+"I currently have ${string(v: count)} cats."
+```
+ {{% /note %}}
+
+ Check data is represented as an object, `r`.
+ Access specific column values using dot notation: `r.columnName`.
+
+ Use data from the following columns:
+
+ - columns included in the query output
+ - [custom tags](#tags) added to the query output
+ - `_check_id`
+ - `_check_name`
+ - `_level`
+ - `_source_measurement`
+ - `_type`
+
+ ###### Example status message template
+ ```
+ From ${r._check_name}:
+ ${r._field} is ${r._level}.
+ Its value is ${string(v: r._value)}.
+ ```
+
+ When a check generates a status, it stores the message in the `_message` column.
+
+4. Define check conditions that assign statuses to points.
+ Condition options depend on your check type.
+
+ ##### Configure a threshold check
+ 1. In the **Thresholds** column, click the status name (CRIT, WARN, INFO, or OK)
+ to define conditions for that specific status.
+ 2. From the **When value** drop-down list, select a threshold: is above, is below,
+ is inside of, is outside of.
+ 3. Enter a value or values for the threshold.
+ You can also use the threshold sliders in the data visualization to define threshold values.
+
+ ##### Configure a deadman check
+ 1. In the **Deadman** column, enter a duration for the deadman check in the **for** field.
+ For example, `90s`, `5m`, `2h30m`, etc.
+ 2. Use the **set status to** drop-down list to select a status to set on a dead series.
+ 3. In the **And stop checking after** field, enter the time to stop monitoring the series.
+ For example, `30m`, `2h`, `3h15m`, etc.
+
+5. Click the green **{{< icon "check" >}}** in the top right corner to save the check.
+
+## Clone a check
+Create a new check by cloning an existing check.
+
+1. In the **Checks** column, hover over the check you want to clone.
+2. Click the **{{< icon "clone" >}}** icon, then **Clone**.
diff --git a/content/v2.0/monitor-alert/checks/delete.md b/content/v2.0/monitor-alert/checks/delete.md
new file mode 100644
index 000000000..8e884679f
--- /dev/null
+++ b/content/v2.0/monitor-alert/checks/delete.md
@@ -0,0 +1,34 @@
+---
+title: Delete checks
+seotitle: Delete monitoring checks in InfluxDB
+description: >
+ Delete checks in the InfluxDB UI.
+menu:
+ v2_0:
+ parent: Manage checks
+weight: 204
+related:
+ - /v2.0/monitor-alert/notification-rules/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+If you no longer need a check, use the InfluxDB user interface (UI) to delete it.
+
+{{% warn %}}
+Deleting a check cannot be undone.
+{{% /warn %}}
+
+1. Click **Monitoring & Alerting** in the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. In the **Checks** column, hover over the check you want to delete, click the
+ **{{< icon "delete" >}}** icon, then **Delete**.
+
+After a check is deleted, all statuses generated by the check remain in the `_monitoring`
+bucket until the retention period for the bucket expires.
+
+{{% note %}}
+You can also [disable a check](/v2.0/monitor-alert/checks/update/#enable-or-disable-a-check)
+without having to delete it.
+{{% /note %}}
diff --git a/content/v2.0/monitor-alert/checks/update.md b/content/v2.0/monitor-alert/checks/update.md
new file mode 100644
index 000000000..d2c9af61c
--- /dev/null
+++ b/content/v2.0/monitor-alert/checks/update.md
@@ -0,0 +1,62 @@
+---
+title: Update checks
+seotitle: Update monitoring checks in InfluxDB
+description: >
+ Update, rename, enable or disable checks in the InfluxDB UI.
+menu:
+ v2_0:
+ parent: Manage checks
+weight: 203
+related:
+ - /v2.0/monitor-alert/notification-rules/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+Update checks in the InfluxDB user interface (UI).
+Common updates include:
+
+- [Update check queries and logic](#update-check-queries-and-logic)
+- [Enable or disable a check](#enable-or-disable-a-check)
+- [Rename a check](#rename-a-check)
+- [Add or update a check description](#add-or-update-a-check-description)
+- [Add a label to a check](#add-a-label-to-a-check)
+
+To update checks, click **Monitoring & Alerting** in the InfluxDB UI sidebar.
+
+{{< nav-icon "alerts" >}}
+
+
+## Update check queries and logic
+1. In the **Checks** column, click the name of the check you want to update.
+ The check builder appears.
+2. To edit the check query, click **1. Query** at the top of the check builder window.
+3. To edit the check logic, click **2. Check** at the top of the check builder window.
+
+_For details about using the check builder, see [Create checks](/v2.0/monitor-alert/checks/create/)._
+
+## Enable or disable a check
+In the **Checks** column, click the {{< icon "toggle" >}} toggle next to a check
+to enable or disable it.
+
+## Rename a check
+1. In the **Checks** column, hover over the name of the check you want to update.
+2. Click the **{{< icon "edit" >}}** icon that appears next to the check name.
+2. Enter a new name and click out of the name field or press enter to save.
+
+_You can also rename a check in the [check builder](#update-check-queries-and-logic)._
+
+## Add or update a check description
+1. In the **Checks** column, hover over the check description you want to update.
+2. Click the **{{< icon "edit" >}}** icon that appears next to the description.
+2. Enter a new description and click out of the name field or press enter to save.
+
+## Add a label to a check
+1. In the **Checks** column, click **Add a label** next to the check you want to add a label to.
+ The **Add Labels** box opens.
+2. To add an existing label, select the label from the list.
+3. To create and add a new label:
+ - In the search field, enter the name of the new label. The **Create Label** box opens.
+ - In the **Description** field, enter an optional description for the label.
+ - Select a color for the label.
+ - Click **Create Label**.
+4. To remove a label, hover over the label under to a rule and click **{{< icon "x" >}}**.
diff --git a/content/v2.0/monitor-alert/checks/view.md b/content/v2.0/monitor-alert/checks/view.md
new file mode 100644
index 000000000..a41f90713
--- /dev/null
+++ b/content/v2.0/monitor-alert/checks/view.md
@@ -0,0 +1,43 @@
+---
+title: View checks
+seotitle: View monitoring checks in InfluxDB
+description: >
+ View check details and statuses and notifications generated by checks in the InfluxDB UI.
+menu:
+ v2_0:
+ parent: Manage checks
+weight: 202
+related:
+ - /v2.0/monitor-alert/notification-rules/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+View check details and statuses and notifications generated by checks in the InfluxDB user interface (UI).
+
+- [View a list of all checks](#view-a-list-of-all-checks)
+- [View check details](#view-check-details)
+- [View statuses generated by a check](#view-statuses-generated-by-a-check)
+- [View notifications triggered by a check](#view-notifications-triggered-by-a-check)
+
+To view checks, click **Monitoring & Alerting** in the InfluxDB UI sidebar.
+
+{{< nav-icon "alerts" >}}
+
+## View a list of all checks
+The **Checks** column on the Monitoring & Alerting landing page displays all existing checks.
+
+## View check details
+In the **Checks** column, click the name of the check you want to view.
+The check builder appears.
+Here you can view the check query and logic.
+
+## View statuses generated by a check
+1. In the **Checks** column, hover over the check, click the **{{< icon "view" >}}**
+ icon, then **View History**.
+ The Statuses History page displays statuses generated by the selected check.
+
+## View notifications triggered by a check
+1. In the **Checks** column, hover over the check, click the **{{< icon "view" >}}**
+ icon, then **View History**.
+2. In the top left corner, click **Notifications**.
+ The Notifications History page displays notifications initiated by the selected check.
diff --git a/content/v2.0/monitor-alert/notification-endpoints/_index.md b/content/v2.0/monitor-alert/notification-endpoints/_index.md
new file mode 100644
index 000000000..f3d6fef42
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-endpoints/_index.md
@@ -0,0 +1,20 @@
+---
+title: Manage notification endpoints
+list_title: Manage notification endpoints
+description: >
+ Create, read, update, and delete endpoints in the InfluxDB UI.
+v2.0/tags: [monitor, endpoints, notifications, alert]
+menu:
+ v2_0:
+ parent: Monitor & alert
+weight: 102
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-rules/
+---
+
+Notification endpoints store information to connect to a third party service.
+If you're using the Free plan, create a Slack endpoint.
+If you're using the Pay as You Go plan, create a connection to a HTTP, Slack, or PagerDuty endpoint.
+
+{{< children >}}
diff --git a/content/v2.0/monitor-alert/notification-endpoints/create.md b/content/v2.0/monitor-alert/notification-endpoints/create.md
new file mode 100644
index 000000000..829158886
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-endpoints/create.md
@@ -0,0 +1,45 @@
+---
+title: Create notification endpoints
+description: >
+ Create notification endpoints to send alerts on your time series data.
+menu:
+ v2_0:
+ name: Create endpoints
+ parent: Manage notification endpoints
+weight: 201
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-rules/
+---
+
+To send notifications about changes in your data, start by creating a notification endpoint to a third party service. After creating notification endpoints, [create notification rules](/v2.0/monitor-alert/notification-rules/create) to send alerts to third party services on [check statuses](/v2.0/monitor-alert/checks/create).
+
+## Create a notification endpoint in the UI
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Next to **Notification Endpoints**, click **Create**.
+3. From the **Destination** drop-down list, select a destination endpoint to send notifications.
+ The following endpoints are available for InfluxDB 2.0 OSS, the InfluxDB Cloud 2.0 Free Plan,
+ and the InfluxDB Cloud 2.0 Pay As You Go (PAYG) Plan:
+
+ | Endpoint | OSS | Free Plan _(Cloud)_ | PAYG Plan _(Cloud)_ |
+ |:-------- |:--------: |:-------------------: |:----------------------------:|
+ | **Slack** | **{{< icon "check" >}}** | **{{< icon "check" >}}** | **{{< icon "check" >}}** |
+ | **PagerDuty** | **{{< icon "check" >}}** | | **{{< icon "check" >}}** |
+ | **HTTP** | **{{< icon "check" >}}** | | **{{< icon "check" >}}** |
+
+4. In the **Name** and **Description** fields, enter a name and description for the endpoint.
+5. Enter enter information to connect to the endpoint:
+
+ - For HTTP, enter the **URL** to send the notification. Select the **auth method** to use: **None** for no authentication. To authenticate with a username and password, select **Basic** and then enter credentials in the **Username** and **Password** fields. To authenticate with a token, select **Bearer**, and then enter the authentication token in the **Token** field.
+
+ - For Slack, create an [Incoming WebHook](https://api.slack.com/incoming-webhooks#posting_with_webhooks) in Slack, and then enter your webHook URL in the **Slack Incoming WebHook URL** field.
+
+ - For PagerDuty:
+ - [Create a new service](https://support.pagerduty.com/docs/services-and-integrations#section-create-a-new-service), [add an integration for your service](https://support.pagerduty.com/docs/services-and-integrations#section-add-integrations-to-an-existing-service), and then enter the PagerDuty integration key for your new service in the **Routing Key** field.
+ - The **Client URL** provides a useful link in your PagerDuty notification. Enter any URL that you'd like to use to investigate issues. This URL is sent as the `client_url` property in the PagerDuty trigger event. By default, the **Client URL** is set to your Monitoring & Alerting History page, and the following included in the PagerDuty trigger event: `"client_url": "https://twodotoh.a.influxcloud.net/orgs//alert-history”`
+
+6. Click **Create Notification Endpoint**.
diff --git a/content/v2.0/monitor-alert/notification-endpoints/delete.md b/content/v2.0/monitor-alert/notification-endpoints/delete.md
new file mode 100644
index 000000000..24a0dc71b
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-endpoints/delete.md
@@ -0,0 +1,24 @@
+---
+title: Delete notification endpoints
+description: >
+ Delete a notification endpoint in the InfluxDB UI.
+menu:
+ v2_0:
+ name: Delete endpoints
+ parent: Manage notification endpoints
+weight: 204
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-rules/
+---
+
+If notifications are no longer sent to an endpoint, complete the steps below to delete the endpoint, and then [update notification rules](/v2.0/monitor-alert/notification-rules/update) with a new notification endpoint as needed.
+
+## Delete a notification endpoint in the UI
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Under **Notification Rules**, find the rule you want to delete.
+3. Click the delete icon, then click **Delete** to confirm.
diff --git a/content/v2.0/monitor-alert/notification-endpoints/update.md b/content/v2.0/monitor-alert/notification-endpoints/update.md
new file mode 100644
index 000000000..d2624e5e4
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-endpoints/update.md
@@ -0,0 +1,65 @@
+---
+title: Update notification endpoints
+description: >
+ Update notification endpoints in the InfluxDB UI.
+menu:
+ v2_0:
+ name: Update endpoints
+ parent: Manage notification endpoints
+weight: 203
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-rules/
+---
+
+To update the notification endpoint details, complete the procedures below as needed. To update the notification endpoint selected for a notification rule, see [update notification rules](/v2.0/monitor-alert/notification-rules/update/).
+
+## Add a label to notification endpoint
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Under **Notification Endpoints**, click **Add a label** next to the endpoint you want to add a label to. The **Add Labels** box opens.
+3. To add an existing label, select the label from the list.
+4. To create and add a new label:
+
+ - In the search field, enter the name of the new label. The **Create Label** box opens.
+ - In the **Description** field, enter an optional description for the label.
+ - Select a color for the label.
+ - Click **Create Label**.
+
+5. To remove a label, hover over the label under an endpoint and click X.
+
+
+## Disable notification endpoint
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+
+ {{< nav-icon "alerts" >}}
+
+
+2. Under **Notification Endpoints**, find the endpoint you want to disable.
+3. Click the blue toggle to disable the notification endpoint.
+
+## Update the name or description for notification endpoint
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+
+ {{< nav-icon "alerts" >}}
+
+
+2. Under **Notification Endpoints**, hover over the name or description of the endpoint.
+3. Click the pencil icon to edit the field.
+4. Click outside of the field to save your changes.
+
+## Change endpoint details
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Under **Notification Endpoints**, click the endpoint to update.
+3. Update details as needed, and then click **Edit a Notification Endpoint**. For details about each field, see [Create notification endpoints](/v2.0/monitor-alert/notification-endpoints/create/).
diff --git a/content/v2.0/monitor-alert/notification-endpoints/view.md b/content/v2.0/monitor-alert/notification-endpoints/view.md
new file mode 100644
index 000000000..982fa4c42
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-endpoints/view.md
@@ -0,0 +1,43 @@
+---
+title: View notification endpoint history
+seotitle: View notification endpoint details and history
+description: >
+ View notification endpoint details and history in the InfluxDB UI.
+menu:
+ v2_0:
+ name: View endpoint history
+ parent: Manage notification endpoints
+weight: 202
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-rules/
+---
+
+View notification endpoint details and history in the InfluxDB user interface (UI).
+
+- [View notification endpoints](#view-notification-endpoints)
+- [View notification endpoint details](#view-notification-endpoint-details)
+- [View history notification endpoint history](#view-notification-endpoint-history), including statues and notifications sent to the endpoint
+
+## View notification endpoints
+
+- Click **Monitoring & Alerting** in the InfluxDB UI sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+ In the **Notification Endpoints** column, view existing notification endpoints.
+
+## View notification endpoint details
+
+1. Click **Monitoring & Alerting** in the InfluxDB UI sidebar.
+2. In the **Notification Endpoints** column, click the name of the notification endpoint you want to view.
+3. View the notification endpoint destination, name, and information to connect to the endpoint.
+
+## View notification endpoint history
+
+1. Click **Monitoring & Alerting** in the InfluxDB UI sidebar.
+2. In the **Notification Endpoints** column, hover over the notification endpoint, click the **{{< icon "view" >}}** icon, then **View History**.
+The Check Statuses History page displays:
+
+ - Statuses generated for the selected notification endpoint
+ - Notifications sent to the selected notification endpoint
diff --git a/content/v2.0/monitor-alert/notification-rules/_index.md b/content/v2.0/monitor-alert/notification-rules/_index.md
new file mode 100644
index 000000000..bc99a9114
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-rules/_index.md
@@ -0,0 +1,17 @@
+---
+title: Manage notification rules
+description: >
+ Manage notification rules in InfluxDB.
+weight: 103
+v2.0/tags: [monitor, notifications, alert]
+menu:
+ v2_0:
+ parent: Monitor & alert
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+The following articles provide information on managing your notification rules:
+
+{{< children >}}
diff --git a/content/v2.0/monitor-alert/notification-rules/create.md b/content/v2.0/monitor-alert/notification-rules/create.md
new file mode 100644
index 000000000..471f65aff
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-rules/create.md
@@ -0,0 +1,42 @@
+---
+title: Create notification rules
+description: >
+ Create notification rules to send alerts on your time series data.
+weight: 201
+menu:
+ v2_0:
+ parent: Manage notification rules
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+Once you've set up checks and notification endpoints, create notification rules to alert you.
+_For details, see [Manage checks](/v2.0/monitor-alert/checks/) and
+[Manage notification endpoints](/v2.0/monitor-alert/notification-endpoints/)._
+
+## Create a new notification rule in the UI
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Under **Notification Rules**, click **+Create**.
+3. Complete the **About** section:
+ 1. In the **Name** field, enter a name for the notification rule.
+ 2. In the **Schedule Every** field, enter how frequently the rule should run.
+ 3. In the **Offset** field, enter an offset time. For example,if a task runs on the hour, a 10m offset delays the task to 10 minutes after the hour. Time ranges defined in the task are relative to the specified execution time.
+4. In the **Conditions** section, build a condition using a combination of status and tag keys.
+ - Next to **When status is equal to**, select a status from the drop-down field.
+ - Next to **AND When**, enter one or more tag key-value pairs to filter by.
+5. In the **Message** section, select an endpoint to notify.
+6. Click **Create Notification Rule**.
+
+## Clone an existing notification rule in the UI
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Under **Notification Rules**, hover over the rule you want to clone.
+3. Click the clone icon and select **Clone**. The cloned rule appears.
diff --git a/content/v2.0/monitor-alert/notification-rules/delete.md b/content/v2.0/monitor-alert/notification-rules/delete.md
new file mode 100644
index 000000000..dea28950d
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-rules/delete.md
@@ -0,0 +1,21 @@
+---
+title: Delete notification rules
+description: >
+ If you no longer need to receive an alert, delete the associated notification rule.
+weight: 204
+menu:
+ v2_0:
+ parent: Manage notification rules
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+## Delete a notification rule in the UI
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Under **Notification Rules**, find the rule you want to delete.
+3. Click the delete icon, then click **Delete** to confirm.
diff --git a/content/v2.0/monitor-alert/notification-rules/update.md b/content/v2.0/monitor-alert/notification-rules/update.md
new file mode 100644
index 000000000..f88a832d0
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-rules/update.md
@@ -0,0 +1,51 @@
+---
+title: Update notification rules
+description: >
+ Update notification rules to update the notification message or change the schedule or conditions.
+weight: 203
+menu:
+ v2_0:
+ parent: Manage notification rules
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+## Add a label to notification rules
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+ {{< nav-icon "alerts" >}}
+
+2. Under **Notification Rules**, click **Add a label** next to the rule you want to add a label to. The **Add Labels** box opens.
+3. To add an existing label, select the label from the list.
+4. To create and add a new label:
+ - In the search field, enter the name of the new label. The **Create Label** box opens.
+ - In the **Description** field, enter an optional description for the label.
+ - Select a color for the label.
+ - Click **Create Label**.
+5. To remove a label, hover over the label under to a rule and click X.
+
+
+## Disable notification rules
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+
+ {{< nav-icon "alerts" >}}
+
+
+2. Under **Notification Rules**, find the rule you want to disable.
+3. Click the blue toggle to disable the notification rule.
+
+## Update the name or description for notification rules
+
+1. Select the **Monitoring and Alerting** icon from the sidebar.
+
+
+ {{< nav-icon "alerts" >}}
+
+
+2. Under **Notification Rules**, hover over the name or description of a rule.
+3. Click the pencil icon to edit the field.
+4. Click outside of the field to save your changes.
diff --git a/content/v2.0/monitor-alert/notification-rules/view.md b/content/v2.0/monitor-alert/notification-rules/view.md
new file mode 100644
index 000000000..bbbcbe130
--- /dev/null
+++ b/content/v2.0/monitor-alert/notification-rules/view.md
@@ -0,0 +1,42 @@
+---
+title: View notification rules
+description: >
+ Update notification rules to update the notification message or change the schedule or conditions.
+weight: 202
+menu:
+ v2_0:
+ parent: Manage notification rules
+related:
+ - /v2.0/monitor-alert/checks/
+ - /v2.0/monitor-alert/notification-endpoints/
+---
+
+View notification rule details and statuses and notifications generated by notification rules in the InfluxDB user interface (UI).
+
+- [View a list of all notification rules](#view-a-list-of-all-notification-rules)
+- [View notification rule details](#view-notification-rule-details)
+- [View statuses generated by a check](#view-statuses-generated-by-a-notification-rule)
+- [View notifications triggered by a notification rule](#view-notifications-triggered-by-a-notification-rule)
+
+To view notification rules, click **Monitoring & Alerting** in the InfluxDB UI sidebar.
+
+{{< nav-icon "alerts" >}}
+
+## View a list of all notification rules
+The **Notification Rules** column on the Monitoring & Alerting landing page displays all existing checks.
+
+## View notification rule details
+In the **Notification Rules** column, click the name of the check you want to view.
+The check builder appears.
+Here you can view the check query and logic.
+
+## View statuses generated by a notification rule
+1. In the **Notification Rules** column, hover over the check, click the **{{< icon "view" >}}**
+ icon, then **View History**.
+ The Statuses History page displays statuses generated by the selected check.
+
+## View notifications triggered by a notification rule
+1. In the **Notification Rules** column, hover over the notification rule, click the **{{< icon "view" >}}**
+ icon, then **View History**.
+2. In the top left corner, click **Notifications**.
+ The Notifications History page displays notifications initiated by the selected notification rule.
diff --git a/content/v2.0/organizations/buckets/create-bucket.md b/content/v2.0/organizations/buckets/create-bucket.md
index 0572d2a70..6616e838a 100644
--- a/content/v2.0/organizations/buckets/create-bucket.md
+++ b/content/v2.0/organizations/buckets/create-bucket.md
@@ -14,16 +14,16 @@ to create a bucket.
## Create a bucket in the InfluxDB UI
-1. Click the **Settings** tab in the navigation bar.
+1. Click **Load Data** in the navigation bar.
- {{< nav-icon "settings" >}}
+ {{< nav-icon "load data" >}}
-2. Select the **Buckets** tab.
+2. Select **Buckets**.
3. Click **{{< icon "plus" >}} Create Bucket** in the upper right.
4. Enter a **Name** for the bucket.
-5. Select **How often to clear data?**:
- Select **Never** to retain data forever.
- Select **Periodically** to define a specific retention policy.
+5. Select when to **Delete Data**:
+ - **Never** to retain data forever.
+ - **Older than** to choose a specific retention policy.
5. Click **Create** to create the bucket.
## Create a bucket using the influx CLI
@@ -32,7 +32,7 @@ Use the [`influx bucket create` command](/v2.0/reference/cli/influx/bucket/creat
to create a new bucket. A bucket requires the following:
- A name
-- The name or ID of the organization to which it belongs
+- The name or ID of the organization the bucket belongs to
- A retention period in nanoseconds
```sh
diff --git a/content/v2.0/organizations/buckets/delete-bucket.md b/content/v2.0/organizations/buckets/delete-bucket.md
index 3622b684c..8c25b4948 100644
--- a/content/v2.0/organizations/buckets/delete-bucket.md
+++ b/content/v2.0/organizations/buckets/delete-bucket.md
@@ -14,13 +14,13 @@ to delete a bucket.
## Delete a bucket in the InfluxDB UI
-1. Click the **Settings** tab in the navigation bar.
+1. Click **Load Data** in the navigation bar.
- {{< nav-icon "settings" >}}
+ {{< nav-icon "load data" >}}
-2. Select the **Buckets** tab.
+2. Select **Buckets**.
3. Hover over the bucket you would like to delete.
-4. Click **Delete** and **Confirm** to delete the bucket.
+4. Click **{{< icon "delete" >}} Delete Bucket** and **Confirm** to delete the bucket.
## Delete a bucket using the influx CLI
diff --git a/content/v2.0/organizations/buckets/update-bucket.md b/content/v2.0/organizations/buckets/update-bucket.md
index f113d9ac7..0bbfef353 100644
--- a/content/v2.0/organizations/buckets/update-bucket.md
+++ b/content/v2.0/organizations/buckets/update-bucket.md
@@ -8,6 +8,7 @@ menu:
parent: Manage buckets
weight: 202
---
+
Use the `influx` command line interface (CLI) or the InfluxDB user interface (UI) to update a bucket.
Note that updating an bucket's name will affect any assets that reference the bucket by name, including the following:
@@ -23,23 +24,22 @@ If you change a bucket name, be sure to update the bucket in the above places as
## Update a bucket's name in the InfluxDB UI
-1. Click the **Settings** tab in the navigation bar.
+1. Click **Load Data** in the navigation bar.
- {{< nav-icon "settings" >}}
+ {{< nav-icon "load data" >}}
-2. Select the **Buckets** tab.
-3. Hover over the name of the bucket you want to rename in the list.
-4. Click **Rename**.
-5. Review the information in the window that appears and click **I understand, let's rename my bucket**.
-6. Update the bucket's name and click **Change Bucket Name**.
+2. Select **Buckets**.
+3. Click **Rename** under the bucket you want to rename.
+4. Review the information in the window that appears and click **I understand, let's rename my bucket**.
+5. Update the bucket's name and click **Change Bucket Name**.
## Update a bucket's retention policy in the InfluxDB UI
-1. Click the **Settings** tab in the navigation bar.
+1. Click **Load Data** in the navigation bar.
- {{< nav-icon "settings" >}}
+ {{< nav-icon "load data" >}}
-2. Select the **Buckets** tab.
+2. Select **Buckets**.
3. Click the name of the bucket you want to update from the list.
4. In the window that appears, edit the bucket's retention policy.
5. Click **Save Changes**.
@@ -50,7 +50,7 @@ Use the [`influx bucket update` command](/v2.0/reference/cli/influx/bucket/updat
to update a bucket. Updating a bucket requires the following:
- The bucket ID _(provided in the output of `influx bucket find`)_
-- The name or ID of the organization to which the bucket belongs
+- The name or ID of the organization the bucket belongs to.
##### Update the name of a bucket
```sh
diff --git a/content/v2.0/organizations/buckets/view-buckets.md b/content/v2.0/organizations/buckets/view-buckets.md
index 5d47f5211..5dd6e91a9 100644
--- a/content/v2.0/organizations/buckets/view-buckets.md
+++ b/content/v2.0/organizations/buckets/view-buckets.md
@@ -11,18 +11,17 @@ weight: 202
## View buckets in the InfluxDB UI
-1. Click the **Settings** tab in the navigation bar.
+1. Click **Load Data** in the navigation bar.
- {{< nav-icon "settings" >}}
+ {{< nav-icon "load data" >}}
-2. Select the **Buckets** tab.
+2. Select **Buckets**.
3. Click on a bucket to view details.
## View buckets using the influx CLI
Use the [`influx bucket find` command](/v2.0/reference/cli/influx/bucket/find)
-to view a buckets in an organization. Viewing bucket requires the following:
-
+to view a buckets in an organization.
```sh
influx bucket find
diff --git a/content/v2.0/process-data/common-tasks/downsample-data.md b/content/v2.0/process-data/common-tasks/downsample-data.md
index 1b84563c2..1c4d83148 100644
--- a/content/v2.0/process-data/common-tasks/downsample-data.md
+++ b/content/v2.0/process-data/common-tasks/downsample-data.md
@@ -32,7 +32,7 @@ A separate bucket where aggregated, downsampled data is stored.
To downsample data, it must be aggregated in some way.
What specific method of aggregation you use depends on your specific use case,
but examples include mean, median, top, bottom, etc.
-View [Flux's aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates/)
+View [Flux's aggregate functions](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/)
for more information and ideas.
## Create a destination bucket
@@ -47,7 +47,7 @@ The example task script below is a very basic form of data downsampling that doe
1. Defines a task named "cq-mem-data-1w" that runs once a week.
2. Defines a `data` variable that represents all data from the last 2 weeks in the
`mem` measurement of the `system-data` bucket.
-3. Uses the [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/)
+3. Uses the [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/)
to window the data into 1 hour intervals and calculate the average of each interval.
4. Stores the aggregated data in the `system-data-downsampled` bucket under the
`my-org` organization.
diff --git a/content/v2.0/process-data/get-started.md b/content/v2.0/process-data/get-started.md
index 45bb10c7e..ef146a4ad 100644
--- a/content/v2.0/process-data/get-started.md
+++ b/content/v2.0/process-data/get-started.md
@@ -54,8 +54,8 @@ in form fields when creating the task.
{{% /note %}}
## Define a data source
-Define a data source using Flux's [`from()` function](/v2.0/reference/flux/functions/built-in/inputs/from/)
-or any other [Flux input functions](/v2.0/reference/flux/functions/built-in/inputs/).
+Define a data source using Flux's [`from()` function](/v2.0/reference/flux/stdlib/built-in/inputs/from/)
+or any other [Flux input functions](/v2.0/reference/flux/stdlib/built-in/inputs/).
For convenience, consider creating a variable that includes the sourced data with
the required time range and any relevant filters.
@@ -88,7 +88,7 @@ specific use case.
The example below illustrates a task that downsamples data by calculating the average of set intervals.
It uses the `data` variable defined [above](#define-a-data-source) as the data source.
It then windows the data into 5 minute intervals and calculates the average of each
-window using the [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/).
+window using the [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/).
```js
data
@@ -104,7 +104,7 @@ _See [Common tasks](/v2.0/process-data/common-tasks) for examples of tasks commo
In the vast majority of task use cases, once data is transformed, it needs to sent and stored somewhere.
This could be a separate bucket with a different retention policy, another measurement, or even an alert endpoint _(Coming)_.
-The example below uses Flux's [`to()` function](/v2.0/reference/flux/functions/built-in/outputs/to)
+The example below uses Flux's [`to()` function](/v2.0/reference/flux/stdlib/built-in/outputs/to)
to send the transformed data to another bucket:
```js
diff --git a/content/v2.0/process-data/manage-tasks/create-task.md b/content/v2.0/process-data/manage-tasks/create-task.md
index 1b578a9f8..270a0d1c2 100644
--- a/content/v2.0/process-data/manage-tasks/create-task.md
+++ b/content/v2.0/process-data/manage-tasks/create-task.md
@@ -55,8 +55,6 @@ The InfluxDB UI provides multiple ways to create a task:
6. In the right panel, enter your task script.
7. Click **Save** in the upper right.
-{{< img-hd src="/img/2-0-tasks-create-edit.png" title="Create a task" />}}
-
### Import a task
1. Click on the **Tasks** icon in the left navigation menu.
diff --git a/content/v2.0/query-data/execute-queries.md b/content/v2.0/query-data/execute-queries.md
index 462db6f40..d001a9a7e 100644
--- a/content/v2.0/query-data/execute-queries.md
+++ b/content/v2.0/query-data/execute-queries.md
@@ -60,35 +60,50 @@ In your request, set the following:
- Your organization via the `org` or `orgID` URL parameters.
- `Authorization` header to `Token ` + your authentication token.
-- `accept` header to `application/csv`.
-- `content-type` header to `application/vnd.flux`.
+- `Accept` header to `application/csv`.
+- `Content-type` header to `application/vnd.flux`.
+- Your plain text query as the request's raw data.
-This lets you POST the Flux query in plain text and receive the annotated CSV response.
+InfluxDB returns the query results in [annotated CSV](/v2.0/reference/annotated-csv/).
+
+{{% note %}}
+#### Use gzip to compress the query response
+To compress the query response, set the `Accept-Encoding` header to `gzip`.
+This saves network bandwidth, but increases server-side load.
+{{% /note %}}
Below is an example `curl` command that queries InfluxDB:
{{< code-tabs-wrapper >}}
{{% code-tabs %}}
-[Multi-line](#)
-[Single-line](#)
+[Without compression](#)
+[With compression](#)
{{% /code-tabs %}}
{{% code-tab-content %}}
```bash
curl http://localhost:9999/api/v2/query?org=my-org -XPOST -sS \
--H 'Authorization: Token YOURAUTHTOKEN' \
--H 'accept:application/csv' \
--H 'content-type:application/vnd.flux' \
--d 'from(bucket:“test”)
- |> range(start:-1000h)
- |> group(columns:[“_measurement”], mode:“by”)
- |> sum()'
+ -H 'Authorization: Token YOURAUTHTOKEN' \
+ -H 'Accept: application/csv' \
+ -H 'Content-type: application/vnd.flux' \
+ -d 'from(bucket:“test”)
+ |> range(start:-1000h)
+ |> group(columns:[“_measurement”], mode:“by”)
+ |> sum()'
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```bash
-curl http://localhost:9999/api/v2/query?org=my-org -XPOST -sS -H 'Authorization: Token TOKENSTRINGHERE' -H 'accept:application/csv' -H 'content-type:application/vnd.flux' -d 'from(bucket:“test”) |> range(start:-1000h) |> group(columns:[“_measurement”], mode:“by”) |> sum()'
+curl http://localhost:9999/api/v2/query?org=my-org -XPOST -sS \
+ -H 'Authorization: Token YOURAUTHTOKEN' \
+ -H 'Accept: application/csv' \
+ -H 'Content-type: application/vnd.flux' \
+ -H 'Accept-Encoding: gzip' \
+ -d 'from(bucket:“test”)
+ |> range(start:-1000h)
+ |> group(columns:[“_measurement”], mode:“by”)
+ |> sum()'
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
diff --git a/content/v2.0/query-data/get-started/_index.md b/content/v2.0/query-data/get-started/_index.md
index 56162f606..54834da2e 100644
--- a/content/v2.0/query-data/get-started/_index.md
+++ b/content/v2.0/query-data/get-started/_index.md
@@ -11,7 +11,7 @@ menu:
parent: Query data
related:
- /v2.0/reference/flux/
- - /v2.0/reference/flux/functions/
+ - /v2.0/reference/flux/stdlib/
---
Flux is InfluxData's functional data scripting language designed for querying,
diff --git a/content/v2.0/query-data/get-started/query-influxdb.md b/content/v2.0/query-data/get-started/query-influxdb.md
index f454e2d93..f2a024736 100644
--- a/content/v2.0/query-data/get-started/query-influxdb.md
+++ b/content/v2.0/query-data/get-started/query-influxdb.md
@@ -9,9 +9,9 @@ menu:
weight: 201
related:
- /v2.0/query-data/guides/
- - /v2.0/reference/flux/functions/built-in/inputs/from
- - /v2.0/reference/flux/functions/built-in/transformations/range
- - /v2.0/reference/flux/functions/built-in/transformations/filter
+ - /v2.0/reference/flux/stdlib/built-in/inputs/from
+ - /v2.0/reference/flux/stdlib/built-in/transformations/range
+ - /v2.0/reference/flux/stdlib/built-in/transformations/filter
---
This guide walks through the basics of using Flux to query data from InfluxDB.
@@ -23,8 +23,8 @@ Every Flux query needs the following:
## 1. Define your data source
-Flux's [`from()`](/v2.0/reference/flux/functions/built-in/inputs/from) function defines an InfluxDB data source.
-It requires a [`bucket`](/v2.0/reference/flux/functions/built-in/inputs/from#bucket) parameter.
+Flux's [`from()`](/v2.0/reference/flux/stdlib/built-in/inputs/from) function defines an InfluxDB data source.
+It requires a [`bucket`](/v2.0/reference/flux/stdlib/built-in/inputs/from#bucket) parameter.
The following examples use `example-bucket` as the bucket name.
```js
@@ -36,7 +36,7 @@ Flux requires a time range when querying time series data.
"Unbounded" queries are very resource-intensive and as a protective measure,
Flux will not query the database without a specified range.
-Use the pipe-forward operator (`|>`) to pipe data from your data source into the [`range()`](/v2.0/reference/flux/functions/built-in/transformations/range)
+Use the pipe-forward operator (`|>`) to pipe data from your data source into the [`range()`](/v2.0/reference/flux/stdlib/built-in/transformations/range)
function, which specifies a time range for your query.
It accepts two properties: `start` and `stop`.
Ranges can be **relative** using negative [durations](/v2.0/reference/flux/language/lexical-elements#duration-literals)
diff --git a/content/v2.0/query-data/get-started/transform-data.md b/content/v2.0/query-data/get-started/transform-data.md
index 534544858..b65335a54 100644
--- a/content/v2.0/query-data/get-started/transform-data.md
+++ b/content/v2.0/query-data/get-started/transform-data.md
@@ -8,15 +8,15 @@ menu:
parent: Get started with Flux
weight: 202
related:
- - /v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow
- - /v2.0/reference/flux/functions/built-in/transformations/window
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow
+ - /v2.0/reference/flux/stdlib/built-in/transformations/window
---
When [querying data from InfluxDB](/v2.0/query-data/get-started/query-influxdb),
you often need to transform that data in some way.
Common examples are aggregating data into averages, downsampling data, etc.
-This guide demonstrates using [Flux functions](/v2.0/reference/flux/functions) to transform your data.
+This guide demonstrates using [Flux functions](/v2.0/reference/flux/stdlib) to transform your data.
It walks through creating a Flux script that partitions data into windows of time,
averages the `_value`s in each window, and outputs the averages as a new table.
@@ -39,13 +39,13 @@ from(bucket:"example-bucket")
## Flux functions
Flux provides a number of functions that perform specific operations, transformations, and tasks.
You can also [create custom functions](/v2.0/query-data/guides/custom-functions) in your Flux queries.
-_Functions are covered in detail in the [Flux functions](/v2.0/reference/flux/functions) documentation._
+_Functions are covered in detail in the [Flux functions](/v2.0/reference/flux/stdlib) documentation._
A common type of function used when transforming data queried from InfluxDB is an aggregate function.
Aggregate functions take a set of `_value`s in a table, aggregate them, and transform
them into a new value.
-This example uses the [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean)
+This example uses the [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean)
to average values within each time window.
{{% note %}}
@@ -55,7 +55,7 @@ It's just good to understand the steps in the process.
{{% /note %}}
## Window your data
-Flux's [`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window) partitions records based on a time value.
+Flux's [`window()` function](/v2.0/reference/flux/stdlib/built-in/transformations/window) partitions records based on a time value.
Use the `every` parameter to define a duration of each window.
For this example, window data in five minute intervals (`5m`).
@@ -78,7 +78,7 @@ When visualized, each table is assigned a unique color.
## Aggregate windowed data
Flux aggregate functions take the `_value`s in each table and aggregate them in some way.
-Use the [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean) to average the `_value`s of each table.
+Use the [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean) to average the `_value`s of each table.
```js
from(bucket:"example-bucket")
@@ -104,7 +104,7 @@ Aggregate functions don't infer what time should be used for the aggregate value
Therefore the `_time` column is dropped.
A `_time` column is required in the [next operation](#unwindow-aggregate-tables).
-To add one, use the [`duplicate()` function](/v2.0/reference/flux/functions/built-in/transformations/duplicate)
+To add one, use the [`duplicate()` function](/v2.0/reference/flux/stdlib/built-in/transformations/duplicate)
to duplicate the `_stop` column as the `_time` column for each windowed table.
```js
@@ -149,7 +149,7 @@ process helps to understand how data changes "shape" as it is passed through eac
Flux provides (and allows you to create) "helper" functions that abstract many of these steps.
The same operation performed in this guide can be accomplished using the
-[`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow).
+[`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow).
```js
from(bucket:"example-bucket")
diff --git a/content/v2.0/query-data/guides/conditional-logic.md b/content/v2.0/query-data/guides/conditional-logic.md
index 63ac17ee6..22c7494c0 100644
--- a/content/v2.0/query-data/guides/conditional-logic.md
+++ b/content/v2.0/query-data/guides/conditional-logic.md
@@ -27,9 +27,9 @@ Conditional expressions are most useful in the following contexts:
- When defining variables.
- When using functions that operate on a single row at a time (
- [`filter()`](/v2.0/reference/flux/functions/built-in/transformations/filter/),
- [`map()`](/v2.0/reference/flux/functions/built-in/transformations/map/),
- [`reduce()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce) ).
+ [`filter()`](/v2.0/reference/flux/stdlib/built-in/transformations/filter/),
+ [`map()`](/v2.0/reference/flux/stdlib/built-in/transformations/map/),
+ [`reduce()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce) ).
## Examples
@@ -72,7 +72,7 @@ from(bucket: "example-bucket")
### Conditionally transform column values with map()
-The following example uses the [`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map/)
+The following example uses the [`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map/)
to conditionally transform column values.
It sets the `level` column to a specific string based on `_value` column.
@@ -119,8 +119,8 @@ from(bucket: "example-bucket")
{{< /code-tabs-wrapper >}}
### Conditionally increment a count with reduce()
-The following example uses the [`aggregateWindow()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/)
-and [`reduce()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/)
+The following example uses the [`aggregateWindow()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow/)
+and [`reduce()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/)
functions to count the number of records in every five minute window that exceed a defined threshold.
{{< code-tabs-wrapper >}}
diff --git a/content/v2.0/query-data/guides/custom-functions/_index.md b/content/v2.0/query-data/guides/custom-functions/_index.md
index d72154420..d15716bcd 100644
--- a/content/v2.0/query-data/guides/custom-functions/_index.md
+++ b/content/v2.0/query-data/guides/custom-functions/_index.md
@@ -70,14 +70,14 @@ functionName = (tables=<-) => tables |> functionOperations
###### Multiply row values by x
The example below defines a `multByX` function that multiplies the `_value` column
of each row in the input table by the `x` parameter.
-It uses the [`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map)
+It uses the [`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map)
to modify each `_value`.
```js
// Function definition
multByX = (tables=<-, x) =>
tables
- |> map(fn: (r) => r._value * x)
+ |> map(fn: (r) => ({ r with _value: r._value * x}))
// Function usage
from(bucket: "example-bucket")
@@ -104,9 +104,9 @@ Defaults are overridden by explicitly defining the parameter in the function cal
###### Get the winner or the "winner"
The example below defines a `getWinner` function that returns the record with the highest
or lowest `_value` (winner versus "winner") depending on the `noSarcasm` parameter which defaults to `true`.
-It uses the [`sort()` function](/v2.0/reference/flux/functions/built-in/transformations/sort)
+It uses the [`sort()` function](/v2.0/reference/flux/stdlib/built-in/transformations/sort)
to sort records in either descending or ascending order.
-It then uses the [`limit()` function](/v2.0/reference/flux/functions/built-in/transformations/limit)
+It then uses the [`limit()` function](/v2.0/reference/flux/stdlib/built-in/transformations/limit)
to return the first record from the sorted table.
```js
diff --git a/content/v2.0/query-data/guides/custom-functions/custom-aggregate.md b/content/v2.0/query-data/guides/custom-functions/custom-aggregate.md
index 60e580ab6..b56d68dfc 100644
--- a/content/v2.0/query-data/guides/custom-functions/custom-aggregate.md
+++ b/content/v2.0/query-data/guides/custom-functions/custom-aggregate.md
@@ -10,9 +10,9 @@ weight: 301
---
To aggregate your data, use the Flux
-[built-in aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates/)
+[built-in aggregate functions](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/)
or create custom aggregate functions using the
-[`reduce()`function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/).
+[`reduce()`function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/).
## Aggregate function characteristics
Aggregate functions all have the same basic characteristics:
@@ -22,7 +22,7 @@ Aggregate functions all have the same basic characteristics:
## How reduce() works
The `reduce()` function operates on one row at a time using the function defined in
-the [`fn` parameter](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/#fn).
+the [`fn` parameter](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/#fn).
The `fn` function maps keys to specific values using two [objects](/v2.0/query-data/get-started/syntax-basics/#objects)
specified by the following parameters:
@@ -32,7 +32,7 @@ specified by the following parameters:
| `accumulator` | An object that contains values used in each row's aggregate calculation. |
{{% note %}}
-The `reduce()` function's [`identity` parameter](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/#identity)
+The `reduce()` function's [`identity` parameter](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/#identity)
defines the initial `accumulator` object.
{{% /note %}}
@@ -50,7 +50,7 @@ in an input table.
```
{{% note %}}
-To preserve existing columns, [use the `with` operator](/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/#preserve-columns)
+To preserve existing columns, [use the `with` operator](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/#preserve-columns)
when mapping values in the `r` object.
{{% /note %}}
@@ -150,7 +150,7 @@ and the `reduce()` function to aggregate rows in each input table.
### Create a custom average function
This example illustrates how to create a function that averages values in a table.
_This is meant for demonstration purposes only.
-The built-in [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean/)
+The built-in [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean/)
does the same thing and is much more performant._
{{< code-tabs-wrapper >}}
diff --git a/content/v2.0/query-data/guides/exists.md b/content/v2.0/query-data/guides/exists.md
new file mode 100644
index 000000000..15b172bb9
--- /dev/null
+++ b/content/v2.0/query-data/guides/exists.md
@@ -0,0 +1,69 @@
+---
+title: Check if a value exists
+seotitle: Use Flux to check if a value exists
+description: >
+ Use the Flux `exists` operator to check if an object contains a key or if that
+ key's value is `null`.
+v2.0/tags: [exists]
+menu:
+ v2_0:
+ name: Check if a value exists
+ parent: How-to guides
+weight: 209
+---
+
+Use the Flux `exists` operator to check if an object contains a key or if that
+key's value is `null`.
+
+```js
+p = {firstName: "John", lastName: "Doe", age: 42}
+
+exists p.firstName
+// Returns true
+
+exists p.height
+// Returns false
+```
+
+Use `exists` with row functions (
+[`filter()`](/v2.0/reference/flux/stdlib/built-in/transformations/filter/),
+[`map()`](/v2.0/reference/flux/stdlib/built-in/transformations/map/),
+[`reduce()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce/))
+to check if a row includes a column or if the value for that column is `null`.
+
+#### Filter out null values
+```js
+from(bucket: "example-bucket")
+ |> range(start: -5m)
+ |> filter(fn: (r) => exists r._value)
+```
+
+#### Map values based on existence
+```js
+from(bucket: "default")
+ |> range(start: -30s)
+ |> map(fn: (r) => ({
+ r with
+ human_readable:
+ if exists r._value then "${r._field} is ${string(v:r._value)}."
+ else "${r._field} has no value."
+ }))
+```
+
+#### Ignore null values in a custom aggregate function
+```js
+customSumProduct = (tables=<-) =>
+ tables
+ |> reduce(
+ identity: {sum: 0.0, product: 1.0},
+ fn: (r, accumulator) => ({
+ r with
+ sum:
+ if exists r._value then r._value + accumulator.sum
+ else accumulator.sum,
+ product:
+ if exists r._value then r.value * accumulator.product
+ else accumulator.product
+ })
+ )
+```
diff --git a/content/v2.0/query-data/guides/group-data.md b/content/v2.0/query-data/guides/group-data.md
index 50a3c4fde..fd3c56eb9 100644
--- a/content/v2.0/query-data/guides/group-data.md
+++ b/content/v2.0/query-data/guides/group-data.md
@@ -28,7 +28,7 @@ Understanding how modifying group keys shapes output data is key to successfully
grouping and transforming data into your desired output.
## group() Function
-Flux's [`group()` function](/v2.0/reference/flux/functions/built-in/transformations/group) defines the
+Flux's [`group()` function](/v2.0/reference/flux/stdlib/built-in/transformations/group) defines the
group key for output tables, i.e. grouping records based on values for specific columns.
###### group() example
diff --git a/content/v2.0/query-data/guides/histograms.md b/content/v2.0/query-data/guides/histograms.md
index 88fda21eb..4253e8183 100644
--- a/content/v2.0/query-data/guides/histograms.md
+++ b/content/v2.0/query-data/guides/histograms.md
@@ -14,7 +14,7 @@ Histograms provide valuable insight into the distribution of your data.
This guide walks through using Flux's `histogram()` function to transform your data into a **cumulative histogram**.
## histogram() function
-The [`histogram()` function](/v2.0/reference/flux/functions/built-in/transformations/histogram) approximates the
+The [`histogram()` function](/v2.0/reference/flux/stdlib/built-in/transformations/histogram) approximates the
cumulative distribution of a dataset by counting data frequencies for a list of "bins."
A **bin** is simply a range in which a data point falls.
All data points that are less than or equal to the bound are counted in the bin.
@@ -41,7 +41,7 @@ Flux provides two helper functions for generating histogram bins.
Each generates an array of floats designed to be used in the `histogram()` function's `bins` parameter.
### linearBins()
-The [`linearBins()` function](/v2.0/reference/flux/functions/built-in/misc/linearbins) generates a list of linearly separated floats.
+The [`linearBins()` function](/v2.0/reference/flux/stdlib/built-in/misc/linearbins) generates a list of linearly separated floats.
```js
linearBins(start: 0.0, width: 10.0, count: 10)
@@ -50,10 +50,10 @@ linearBins(start: 0.0, width: 10.0, count: 10)
```
### logarithmicBins()
-The [`logarithmicBins()` function](/v2.0/reference/flux/functions/built-in/misc/logarithmicbins) generates a list of exponentially separated floats.
+The [`logarithmicBins()` function](/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins) generates a list of exponentially separated floats.
```js
-logarithmicBins(start: 1.0, factor: 2.0, count: 10, infinty: true)
+logarithmicBins(start: 1.0, factor: 2.0, count: 10, infinity: true)
// Generated list: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, +Inf]
```
@@ -74,7 +74,7 @@ Because the Histogram visualization uses visualization controls to creates bins
{{% note %}}
Output of the [`histogram()` function](#histogram-function) is **not** compatible
with the Histogram visualization type.
-View the example [below](#visualize-error-counts-by-severity-over-time).
+View the example [below](#visualize-errors-by-severity).
{{% /note %}}
## Examples
@@ -160,7 +160,8 @@ Table: keys: [_start, _stop, _field, _measurement, host]
```
### Visualize errors by severity
-Use the [Telegraf Syslog plugin](Telegraf Syslog plugin) to collect error information from your system.
+Use the [Telegraf Syslog plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/syslog)
+to collect error information from your system.
Query the `severity_code` field in the `syslog` measurement:
```js
diff --git a/content/v2.0/query-data/guides/join.md b/content/v2.0/query-data/guides/join.md
index bb97dc73b..e0932ba3c 100644
--- a/content/v2.0/query-data/guides/join.md
+++ b/content/v2.0/query-data/guides/join.md
@@ -10,7 +10,7 @@ menu:
weight: 205
---
-The [`join()` function](/v2.0/reference/flux/functions/built-in/transformations/join) merges two or more
+The [`join()` function](/v2.0/reference/flux/stdlib/built-in/transformations/join) merges two or more
input streams, whose values are equal on a set of common columns, into a single output stream.
Flux allows you to join on any columns common between two data streams and opens the door
for operations such as cross-measurement joins and math across measurements.
@@ -205,7 +205,7 @@ These represent the columns with values unique to the two input tables.
## Calculate and create a new table
With the two streams of data joined into a single table, use the
-[`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map)
+[`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map)
to build a new table by mapping the existing `_time` column to a new `_time`
column and dividing `_value_mem` by `_value_proc` and mapping it to a
new `_value` column.
diff --git a/content/v2.0/query-data/guides/manipulate-timestamps.md b/content/v2.0/query-data/guides/manipulate-timestamps.md
new file mode 100644
index 000000000..c15afdf6f
--- /dev/null
+++ b/content/v2.0/query-data/guides/manipulate-timestamps.md
@@ -0,0 +1,108 @@
+---
+title: Manipulate timestamps with Flux
+description: >
+ Use Flux to process and manipulate timestamps.
+menu:
+ v2_0:
+ name: Manipulate timestamps
+ parent: How-to guides
+weight: 209
+---
+
+Every point stored in InfluxDB has an associated timestamp.
+Use Flux to process and manipulate timestamps to suit your needs.
+
+- [Convert timestamp format](#convert-timestamp-format)
+- [Time-related Flux functions](#time-related-flux-functions)
+
+## Convert timestamp format
+
+### Convert nanosecond epoch timestamp to RFC3339
+Use the [`time()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/time/)
+to convert a **nanosecond** epoch timestamp to an RFC3339 timestamp.
+
+```js
+time(v: 1568808000000000000)
+// Returns 2019-09-18T12:00:00.000000000Z
+```
+
+### Convert RFC3339 to nanosecond epoch timestamp
+Use the [`uint()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/unit/)
+to convert an RFC3339 timestamp to a nanosecond epoch timestamp.
+
+```js
+uint(v: 2019-09-18T12:00:00.000000000Z)
+// Returns 1568808000000000000
+```
+
+### Calculate the duration between two timestamps
+Flux doesn't support mathematical operations using [time type](/v2.0/reference/flux/language/types/#time-types) values.
+To calculate the duration between two timestamps:
+
+1. Use the `uint()` function to convert each timestamp to a nanosecond epoch timestamp.
+2. Subtract one nanosecond epoch timestamp from the other.
+3. Use the `duration()` function to convert the result into a duration.
+
+```js
+time1 = uint(v: 2019-09-17T21:12:05Z)
+time2 = uint(v: 2019-09-18T22:16:35Z)
+
+duration(v: time2 - time1)
+// Returns 25h4m30s
+```
+
+{{% note %}}
+Flux doesn't support duration column types.
+To store a duration in a column, use the [`string()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string/)
+to convert the duration to a string.
+{{% /note %}}
+
+## Time-related Flux functions
+
+### Retrieve the current time
+Use the [`now()` function](/v2.0/reference/flux/stdlib/built-in/misc/now/) to
+return the current UTC time in RFC3339 format.
+
+```js
+now()
+```
+
+### Add a duration to a timestamp
+The [`experimental.addDuration()` function](/v2.0/reference/flux/stdlib/experimental/addduration/)
+adds a duration to a specified time and returns the resulting time.
+
+{{% warn %}}
+By using `experimental.addDuration()`, you accept the
+[risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.addDuration(
+ d: 6h,
+ to: 2019-09-16T12:00:00Z,
+)
+
+// Returns 2019-09-16T18:00:00.000000000Z
+```
+
+### Subtract a duration from a timestamps
+The [`experimental.addDuration()` function](/v2.0/reference/flux/stdlib/experimental/subduration/)
+subtracts a duration from a specified time and returns the resulting time.
+
+{{% warn %}}
+By using `experimental.addDuration()`, you accept the
+[risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.subDuration(
+ d: 6h,
+ from: 2019-09-16T12:00:00Z,
+)
+
+// Returns 2019-09-16T06:00:00.000000000Z
+```
diff --git a/content/v2.0/query-data/guides/mathematic-operations.md b/content/v2.0/query-data/guides/mathematic-operations.md
index 0c8c9f27b..39cbb7380 100644
--- a/content/v2.0/query-data/guides/mathematic-operations.md
+++ b/content/v2.0/query-data/guides/mathematic-operations.md
@@ -40,7 +40,7 @@ Otherwise, you will get an error similar to:
Error: type error: float != int
```
-To convert operands to the same type, use [type-conversion functions](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/)
+To convert operands to the same type, use [type-conversion functions](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/)
or manually format operands.
The operand data type determines the output data type.
For example:
@@ -82,7 +82,7 @@ percent(sample: 20.0, total: 80.0)
To transform multiple values in an input stream, your function needs to:
- [Handle piped-forward data](/v2.0/query-data/guides/custom-functions/#functions-that-manipulate-piped-forward-data).
-- Use the [`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map) to iterate over each row.
+- Use the [`map()` function](/v2.0/reference/flux/stdlib/built-in/transformations/map) to iterate over each row.
The example `multiplyByX()` function below includes:
@@ -146,7 +146,7 @@ data
#### Include partial gigabytes
Because the original metric (bytes) is an integer, the output of the operation is an integer and does not include partial GBs.
To calculate partial GBs, convert the `_value` column and its values to floats using the
-[`float()` function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/float)
+[`float()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/float)
and format the denominator in the division operation as a float.
```js
diff --git a/content/v2.0/query-data/guides/sort-limit.md b/content/v2.0/query-data/guides/sort-limit.md
index 4dd175588..5d053a0ad 100644
--- a/content/v2.0/query-data/guides/sort-limit.md
+++ b/content/v2.0/query-data/guides/sort-limit.md
@@ -12,7 +12,7 @@ menu:
weight: 206
---
-The [`sort()`function](/v2.0/reference/flux/functions/built-in/transformations/sort)
+The [`sort()`function](/v2.0/reference/flux/stdlib/built-in/transformations/sort)
orders the records within each table.
The following example orders system uptime first by region, then host, then value.
@@ -26,7 +26,7 @@ from(bucket:"example-bucket")
|> sort(columns:["region", "host", "_value"])
```
-The [`limit()` function](/v2.0/reference/flux/functions/built-in/transformations/limit)
+The [`limit()` function](/v2.0/reference/flux/stdlib/built-in/transformations/limit)
limits the number of records in output tables to a fixed number, `n`.
The following example shows up to 10 records from the past hour.
@@ -52,6 +52,6 @@ from(bucket:"example-bucket")
```
You now have created a Flux query that sorts and limits data.
-Flux also provides the [`top()`](/v2.0/reference/flux/functions/built-in/transformations/selectors/top)
-and [`bottom()`](/v2.0/reference/flux/functions/built-in/transformations/selectors/bottom)
+Flux also provides the [`top()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/top)
+and [`bottom()`](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom)
functions to perform both of these functions at the same time.
diff --git a/content/v2.0/query-data/guides/sql.md b/content/v2.0/query-data/guides/sql.md
index 19d49c54d..76845d1f3 100644
--- a/content/v2.0/query-data/guides/sql.md
+++ b/content/v2.0/query-data/guides/sql.md
@@ -12,7 +12,7 @@ weight: 207
---
The [Flux](/v2.0/reference/flux) `sql` package provides functions for working with SQL data sources.
-[`sql.from()`](/v2.0/reference/flux/functions/sql/from/) lets you query SQL data sources
+[`sql.from()`](/v2.0/reference/flux/stdlib/sql/from/) lets you query SQL data sources
like [PostgreSQL](https://www.postgresql.org/) and [MySQL](https://www.mysql.com/)
and use the results with InfluxDB dashboards, tasks, and other operations.
@@ -59,7 +59,7 @@ sql.from(
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
-_See the [`sql.from()` documentation](/v2.0/reference/flux/functions/sql/from/) for
+_See the [`sql.from()` documentation](/v2.0/reference/flux/stdlib/sql/from/) for
information about required function parameters._
## Join SQL data with data in InfluxDB
@@ -94,7 +94,7 @@ join(tables: {metric: sensorMetrics, info: sensorInfo}, on: ["sensor_id"])
## Use SQL results to populate dashboard variables
Use `sql.from()` to [create dashboard variables](/v2.0/visualize-data/variables/create-variable/)
from SQL query results.
-The following example uses the [air sensor sample data](#sample-data) below to
+The following example uses the [air sensor sample data](#sample-sensor-data) below to
create a variable that lets you select the location of a sensor.
```js
@@ -167,7 +167,7 @@ To use `air-sensor-data.rb`:
_**Note:** Use the `--help` flag to view other configuration options._
-5. [Query your target bucket](v2.0/query-data/execute-queries/) to ensure the
+5. [Query your target bucket](/v2.0/query-data/execute-queries/) to ensure the
generated data is writing successfully.
The generator doesn't catch errors from write requests, so it will continue running
even if data is not writing to InfluxDB successfully.
@@ -212,6 +212,6 @@ To use `air-sensor-data.rb`:
#### Import the sample data dashboard
Download and import the Air Sensors dashboard to visualize the generated data:
-Download Air Sensors dashboard
+Download Air Sensors dashboard
_For information about importing a dashboard, see [Create a dashboard](/v2.0/visualize-data/dashboards/create-dashboard/#create-a-new-dashboard)._
diff --git a/content/v2.0/query-data/guides/window-aggregate.md b/content/v2.0/query-data/guides/window-aggregate.md
index b47759063..d9320d394 100644
--- a/content/v2.0/query-data/guides/window-aggregate.md
+++ b/content/v2.0/query-data/guides/window-aggregate.md
@@ -86,7 +86,7 @@ Table: keys: [_start, _stop, _field, _measurement]
{{% /truncate %}}
## Windowing data
-Use the [`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window)
+Use the [`window()` function](/v2.0/reference/flux/stdlib/built-in/transformations/window)
to group your data based on time bounds.
The most common parameter passed with the `window()` is `every` which
defines the duration of time between windows.
@@ -170,14 +170,14 @@ When visualized in the InfluxDB UI, each window table is displayed in a differen
![Windowed data](/img/simple-windowed-data.png)
## Aggregate data
-[Aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates) take the values
+[Aggregate functions](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates) take the values
of all rows in a table and use them to perform an aggregate operation.
The result is output as a new value in a single-row table.
Since windowed data is split into separate tables, aggregate operations run against
each table separately and output new tables containing only the aggregated value.
-For this example, use the [`mean()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean)
+For this example, use the [`mean()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean)
to output the average of each window:
```js
@@ -241,7 +241,7 @@ These represent the lower and upper bounds of the time window.
Many Flux functions rely on the `_time` column.
To further process your data after an aggregate function, you need to re-add `_time`.
-Use the [`duplicate()` function](/v2.0/reference/flux/functions/built-in/transformations/duplicate) to
+Use the [`duplicate()` function](/v2.0/reference/flux/stdlib/built-in/transformations/duplicate) to
duplicate either the `_start` or `_stop` column as a new `_time` column.
```js
@@ -329,7 +329,7 @@ With the aggregate values in a single table, data points in the visualization ar
You have now created a Flux query that windows and aggregates data.
The data transformation process outlined in this guide should be used for all aggregation operations.
-Flux also provides the [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow)
+Flux also provides the [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow)
which performs all these separate functions for you.
The following Flux query will return the same results:
diff --git a/content/v2.0/reference/annotated-csv.md b/content/v2.0/reference/annotated-csv.md
index 0cf966ad5..9d8a462ab 100644
--- a/content/v2.0/reference/annotated-csv.md
+++ b/content/v2.0/reference/annotated-csv.md
@@ -8,11 +8,12 @@ menu:
name: Annotated CSV
---
-Annotated CSV (comma-separated values) format is used to encode HTTP responses and results returned to the Flux [`csv.from()` function](https://v2.docs.influxdata.com/v2.0/reference/flux/functions/csv/from/).
+Annotated CSV (comma-separated values) format is used to encode HTTP responses and results returned to the Flux [`csv.from()` function](https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/csv/from/).
CSV tables must be encoded in UTF-8 and Unicode Normal Form C as defined in [UAX15](http://www.unicode.org/reports/tr15/). Line endings must be CRLF (Carriage Return Line Feed) as defined by the `text/csv` MIME type in [RFC 4180](https://tools.ietf.org/html/rfc4180).
## Examples
+
In this topic, you'll find examples of valid CSV syntax for responses to the following query:
```js
@@ -23,12 +24,15 @@ from(bucket:"mydb/autogen")
```
## CSV response format
+
Flux supports encodings listed below.
### Tables
+
A table may have the following rows and columns.
#### Rows
+
- **Annotation rows**: describe column properties.
- **Header row**: defines column labels (one header row per table).
@@ -36,6 +40,7 @@ A table may have the following rows and columns.
- **Record row**: describes data in the table (one record per row).
##### Example
+
Encoding of a table with and without a header row.
{{< code-tabs-wrapper >}}
@@ -63,6 +68,7 @@ my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,
{{< /code-tabs-wrapper >}}
#### Columns
+
In addition to the data columns, a table may include the following columns:
- **Annotation column**: Only used in annotation rows. Always the first column. Displays the name of an annotation. Value can be empty or a supported [annotation](#annotations). You'll notice a space for this column for the entire length of the table, so rows appear to start with `,`.
@@ -72,6 +78,7 @@ In addition to the data columns, a table may include the following columns:
- **Table column**: Contains a unique ID for each table in a result.
### Multiple tables and results
+
If a file or data stream contains multiple tables or results, the following requirements must be met:
- A table column indicates which table a row belongs to.
@@ -82,6 +89,7 @@ If a file or data stream contains multiple tables or results, the following requ
- Each new table boundary starts with new annotation and header rows.
##### Example
+
Encoding of two tables in the same result with the same schema (header row) and different schema.
{{< code-tabs-wrapper >}}
@@ -119,6 +127,7 @@ my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,west,
{{< /code-tabs-wrapper >}}
### Dialect options
+
Flux supports the following dialect options for `text/csv` format.
| Option | Description| Default |
@@ -130,27 +139,28 @@ Flux supports the following dialect options for `text/csv` format.
| **commentPrefix** | String prefix to identify a comment. Always added to annotations. |`#`|
### Annotations
-Annotation rows are optional, describe column properties, and start with `#` (or commentPrefix value). The first column in an annotation row always contains the annotation name. Subsequent columns contain annotation values as shown in the table below.
+
+Annotation rows describe column properties, and start with `#` (or commentPrefix value). The first column in an annotation row always contains the annotation name. Subsequent columns contain annotation values as shown in the table below.
|Annotation name | Values| Description |
| :-------- | :--------- | :-------|
-| **datatype** | a [valid data type](#Valid-data-types) | Describes the type of data. |
+| **datatype** | a [valid data type](#valid-data-types) | Describes the type of data. |
| **group** | boolean flag `true` or `false` | Indicates the column is part of the group key.|
-| **default** | a [valid data type](#Valid-data-types) |Value to use for rows with an empty string value.|
+| **default** | a [valid data type](#valid-data-types) |Value to use for rows with an empty string value.|
+
+{{% note %}}
+To encode a table with its group key, the `datatype`, `group`, and `default` annotations must be included. If a table has no rows, the `default` annotation provides the group key values.
+{{% /note %}}
##### Example
-Encoding of datatype and group annotations for two tables.
-{{< code-tabs-wrapper >}}
-{{% code-tabs %}}
-[Datatype annotation](#)
-[Group annotation](#)
-[Datatype and group annotations](#)
-{{% /code-tabs %}}
+Example encoding of datatype, group, and default annotations.
-{{% code-tab-content %}}
```js
-#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
+import "csv"
+a = "#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
+#group,false,false,false,false,false,false,false,false
+#default,,,,,,,,
,result,table,_start,_stop,_time,region,host,_value
,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43
,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25
@@ -158,46 +168,9 @@ Encoding of datatype and group annotations for two tables.
,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,west,A,62.73
,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,west,B,12.83
,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,west,C,51.62
+"
+csv.from(csv:a) |> yield()
```
-{{% /code-tab-content %}}
-
-{{% code-tab-content %}}
-```js
-#group,false,false,true,true,false,true,false,false
-,result,table,_start,_stop,_time,region,host,_value
-,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43
-,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25
-,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62
-,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,west,A,62.73
-,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,west,B,12.83
-,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,west,C,51.62
-```
-{{% /code-tab-content %}}
-
-
-{{% code-tab-content %}}
-```js
-#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string,string,double
-,result,table,_start,_stop,_time,region,host,_value
-#group,false,false,true,true,false,true,false,false
-,result,table,_start,_stop,_time,region,host,_value
-,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43
-,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25
-,my-result,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62
-,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,west,A,62.73
-,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,west,B,12.83
-,my-result,1,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,west,C,51.62
-```
-{{% /code-tab-content %}}
-{{< /code-tabs-wrapper >}}
-
-
-**Notes:**
-{{% note %}}
-To encode a table with its group key, the `datatype`, `group`, and `default` annotations must be included.
-
-If a table has no rows, the `default` annotation provides the group key values.
-{{% /note %}}
### Valid data types
@@ -213,6 +186,7 @@ If a table has no rows, the `default` annotation provides the group key values.
| duration | duration | a length of time represented as an unsigned 64-bit integer number of nanoseconds |
## Errors
+
If an error occurs during execution, a table returns with:
- An error column that contains an error message.
@@ -225,6 +199,7 @@ If an error occurs:
- After partial results are sent to the client, the error is encoded as the next table and remaining results are discarded. In this case, the HTTP status code remains 200 OK.
##### Example
+
Encoding for an error with the datatype annotation:
```js
#datatype,string,long
diff --git a/content/v2.0/reference/cli/influxd/inspect/_index.md b/content/v2.0/reference/cli/influxd/inspect/_index.md
index 834a4a675..0c3dd0e90 100644
--- a/content/v2.0/reference/cli/influxd/inspect/_index.md
+++ b/content/v2.0/reference/cli/influxd/inspect/_index.md
@@ -16,12 +16,18 @@ influxd inspect [subcommand]
```
## Subcommands
-| Subcommand | Description |
-|:---------- |:----------- |
-| [export-blocks](/v2.0/reference/cli/influxd/inspect/export-blocks/) | Export block data |
-| [report-tsm](/v2.0/reference/cli/influxd/inspect/report-tsm/) | Run TSM report |
-| [verify-tsm](/v2.0/reference/cli/influxd/inspect/verify-tsm/) | Check the consistency of TSM files |
-| [verify-wal](/v2.0/reference/cli/influxd/inspect/verify-wal/) | Check for corrupt WAL files |
+| Subcommand | Description |
+|:---------- |:----------- |
+| [build-tsi](/v2.0/reference/cli/influxd/inspect/build-tsi/) | Rebuild the TSI index and series file. |
+| [dump-tsi](/v2.0/reference/cli/influxd/inspect/dump-tsi/) | Output low level TSI information |
+| [dumpwal](/v2.0/reference/cli/influxd/inspect/dumpwal/) | Output TSM data from WAL files |
+| [export-blocks](/v2.0/reference/cli/influxd/inspect/export-blocks/) | Export block data |
+| [export-index](/v2.0/reference/cli/influxd/inspect/export-index/) | Export TSI index data |
+| [report-tsi](/v2.0/reference/cli/influxd/inspect/report-tsi/) | Report the cardinality of TSI files |
+| [report-tsm](/v2.0/reference/cli/influxd/inspect/report-tsm/) | Run TSM report |
+| [verify-seriesfile](/v2.0/reference/cli/influxd/inspect/verify-seriesfile/) | Verify the integrity of series files |
+| [verify-tsm](/v2.0/reference/cli/influxd/inspect/verify-tsm/) | Check the consistency of TSM files |
+| [verify-wal](/v2.0/reference/cli/influxd/inspect/verify-wal/) | Check for corrupt WAL files |
## Flags
| Flag | Description |
diff --git a/content/v2.0/reference/cli/influxd/inspect/build-tsi.md b/content/v2.0/reference/cli/influxd/inspect/build-tsi.md
new file mode 100644
index 000000000..7d873b4a6
--- /dev/null
+++ b/content/v2.0/reference/cli/influxd/inspect/build-tsi.md
@@ -0,0 +1,58 @@
+---
+title: influxd inspect build-tsi
+description: >
+ The `influxd inspect build-tsi` command rebuilds the TSI index and, if necessary,
+ the series file.
+v2.0/tags: [tsi]
+menu:
+ v2_0_ref:
+ parent: influxd inspect
+weight: 301
+---
+
+The `influxd inspect build-tsi` command rebuilds the TSI index and, if necessary,
+the series file.
+
+## Usage
+```sh
+influxd inspect build-tsi [flags]
+```
+
+InfluxDB builds the index by reading all Time-Structured Merge tree (TSM) indexes
+and Write Ahead Log (WAL) entries in the TSM and WAL data directories.
+If the series file directory is missing, it rebuilds the series file.
+If the TSI index directory already exists, the command will fail.
+
+### Adjust performance
+Use the following options to adjust the performance of the indexing process:
+
+##### --max-log-file-size
+`--max-log-file-size` determines how much of an index to store in memory before
+compacting it into memory-mappable index files.
+If you find the memory requirements of your TSI index are too high, consider
+decreasing this setting.
+
+##### --max-cache-size
+`--max-cache-size` defines the maximum cache size.
+The indexing process replays WAL files into a `tsm1.Cache`.
+If the maximum cache size is too low, the indexing process will fail.
+Increase `--max-cache-size` to account for the size of your WAL files.
+
+##### --batch-size
+`--batch-size` defines the size of the batches written into the index.
+Altering the batch size can improve performance but may result in significantly
+higher memory usage.
+
+## Flags
+| Flag | Description | Input Type |
+|:---- |:----------- |:----------:|
+| `--batch-size` | The size of the batches to write to the index. Defaults to `10000`. [See above](#batch-size). | integer |
+| `--concurrency` | Number of workers to dedicate to shard index building. Defaults to `GOMAXPROCS` (8 by default). | integer |
+| `-h`, `--help` | Help for `build-tsi`. | |
+| `--max-cache-size` | Maximum cache size. Defaults to `1073741824`. [See above](#max-cache-size). | uinteger |
+| `--max-log-file-size` | Maximum log file size. Defaults to `1048576`. [See above](#max-log-file-size) . | integer |
+| `--sfile-path` | Path to the series file directory. Defaults to `~/.influxdbv2/engine/_series`. | string |
+| `--tsi-path` | Path to the TSI index directory. Defaults to `~/.influxdbv2/engine/index`. | string |
+| `--tsm-path` | Path to the TSM data directory. Defaults to `~/.influxdbv2/engine/data`. | string |
+| `-v`, `--verbose` | Enable verbose output. | |
+| `--wal-path` | Path to the WAL data directory. Defaults to `~/.influxdbv2/engine/wal`. | string |
diff --git a/content/v2.0/reference/cli/influxd/inspect/dump-tsi.md b/content/v2.0/reference/cli/influxd/inspect/dump-tsi.md
new file mode 100644
index 000000000..a15bc1020
--- /dev/null
+++ b/content/v2.0/reference/cli/influxd/inspect/dump-tsi.md
@@ -0,0 +1,33 @@
+---
+title: influxd inspect dump-tsi
+description: >
+ The `influxd inspect dump-tsi` command outputs low-level information about `tsi1` files.
+v2.0/tags: [tsi, inspect]
+menu:
+ v2_0_ref:
+ parent: influxd inspect
+weight: 301
+---
+
+The `influxd inspect dump-tsi` command outputs low-level information about
+Time Series Index (`tsi1`) files.
+
+## Usage
+```sh
+influxd inspect dump-tsi [flags]
+```
+
+## Flags
+| Flag | Description | Input Type |
+|:---- |:----------- |:----------:|
+| `-h`, `--help` | Help for `dump-tsi`. | |
+| `--index-path` | Path to data engine index directory (defaults to `~/.influxdbv2/engine/index`). | string |
+| `--measurement-filter` | Regular expression measurement filter. | string |
+| `--measurements` | Show raw measurement data. | |
+| `--series` | Show raw series data. | |
+| `--series-path` | Path to series file (defaults to `~/.influxdbv2/engine/_series`). | string |
+| `--tag-key-filter` | Regular expression tag key filter. | string |
+| `--tag-keys` | Show raw tag key data. | |
+| `--tag-value-filter` | Regular expression tag value filter. | string |
+| `--tag-value-series` | Show raw series data for each value. | |
+| `--tag-values` | Show raw tag value data. | |
diff --git a/content/v2.0/reference/cli/influxd/inspect/dumpwal.md b/content/v2.0/reference/cli/influxd/inspect/dumpwal.md
new file mode 100644
index 000000000..854226983
--- /dev/null
+++ b/content/v2.0/reference/cli/influxd/inspect/dumpwal.md
@@ -0,0 +1,68 @@
+---
+title: influxd inspect dumpwal
+description: >
+ The `influxd inspect dumpwal` command outputs data from WAL files.
+v2.0/tags: [wal, inspect]
+menu:
+ v2_0_ref:
+ parent: influxd inspect
+weight: 301
+---
+
+The `influxd inspect dumpwal` command outputs data from Write Ahead Log (WAL) files.
+Given a list of file path globs (patterns that match `.wal` file paths),
+the command parses and prints out entries in each file.
+
+## Usage
+```sh
+influxd inspect dumpwal [flags]
+```
+
+## Output details
+The `--find-duplicates` flag determines the `influxd inspect dumpwal` output.
+
+**Without `--find-duplicates`**, the command outputs the following for each file
+that matches the specified [globbing patterns](#globbing-patterns):
+
+- The file name
+- For each entry in a file:
+ - The type of the entry (`[write]` or `[delete-bucket-range]`)
+ - The formatted entry contents
+
+**With `--find-duplicates`**, the command outputs the following for each file
+that matches the specified [globbing patterns](#globbing-patterns):
+
+- The file name
+- A list of keys with timestamps in the wrong order
+
+## Arguments
+
+### Globbing patterns
+Globbing patterns provide partial paths used to match file paths and names.
+
+##### Example globbing patterns
+```sh
+# Match any file or folder starting with "foo"
+foo*
+
+# Match any file or folder starting with "foo" and ending with .txt
+foo*.txt
+
+# Match any file or folder ending with "foo"
+*foo
+
+# Match foo/bar/baz but not foo/bar/bin/baz
+foo/*/baz
+
+# Match foo/baz and foo/bar/baz and foo/bar/bin/baz
+foo/**/baz
+
+# Matches cat but not can or c/t
+/c?t
+```
+
+## Flags
+| Flag | Description |
+|:---- |:----------- |
+| `--find-duplicates` | Ignore dumping entries; only report keys in the WAL that are out of order. |
+| `-h`, `--help` | Help for `dumpwal`. |
diff --git a/content/v2.0/reference/cli/influxd/inspect/export-blocks.md b/content/v2.0/reference/cli/influxd/inspect/export-blocks.md
index dbd848b26..18f187d30 100644
--- a/content/v2.0/reference/cli/influxd/inspect/export-blocks.md
+++ b/content/v2.0/reference/cli/influxd/inspect/export-blocks.md
@@ -3,7 +3,7 @@ title: influxd inspect export-blocks
description: >
The `influxd inspect export-blocks` command exports all blocks in one or more
TSM1 files to another format for easier inspection and debugging.
-v2.0/tags: [wal, inspect]
+v2.0/tags: [inspect]
menu:
v2_0_ref:
parent: influxd inspect
diff --git a/content/v2.0/reference/cli/influxd/inspect/export-index.md b/content/v2.0/reference/cli/influxd/inspect/export-index.md
new file mode 100644
index 000000000..71d0e260a
--- /dev/null
+++ b/content/v2.0/reference/cli/influxd/inspect/export-index.md
@@ -0,0 +1,26 @@
+---
+title: influxd inspect export-index
+description: >
+ The `influxd inspect export-index` command exports all series in a TSI index to
+ SQL format for inspection and debugging.
+v2.0/tags: [inspect]
+menu:
+ v2_0_ref:
+ parent: influxd inspect
+weight: 301
+---
+
+The `influxd inspect export-index` command exports all series in a TSI index to
+SQL format for inspection and debugging.
+
+## Usage
+```sh
+influxd inspect export-index [flags]
+```
+
+## Flags
+| Flag | Description | Input type |
+|:---- |:----------- |:----------:|
+| `-h`, `--help` | Help for `export-index`. | |
+| `--index-path` | Path to the index directory. Defaults to `~/.influxdbv2/engine/index`). | string |
+| `--series-path` | Path to series file. Defaults to `~/.influxdbv2/engine/_series`). | string |
diff --git a/content/v2.0/reference/cli/influxd/inspect/report-tsi.md b/content/v2.0/reference/cli/influxd/inspect/report-tsi.md
new file mode 100644
index 000000000..630a38755
--- /dev/null
+++ b/content/v2.0/reference/cli/influxd/inspect/report-tsi.md
@@ -0,0 +1,44 @@
+---
+title: influxd inspect report-tsi
+description: >
+ The `influxd inspect report-tsi` command analyzes Time Series Index (TSI) files
+ in a storage directory and reports the cardinality of data stored in the files.
+v2.0/tags: [tsi, cardinality, inspect]
+menu:
+ v2_0_ref:
+ parent: influxd inspect
+weight: 301
+---
+
+The `influxd inspect report-tsi` command analyzes Time Series Index (TSI) files
+in a storage directory and reports the cardinality of data stored in the files
+by organization and bucket.
+
+## Output details
+`influxd inspect report-tsi` outputs the following:
+
+- All organizations and buckets in the index.
+- The series cardinality within each organization and bucket.
+- Time to read the index.
+
+When the `--measurements` flag is included, series cardinality is grouped by:
+
+- organization
+- bucket
+- measurement
+
+## Usage
+```sh
+influxd inspect report-tsi [flags]
+```
+
+## Flags
+| Flag | Description | Input Type |
+|:---- |:----------- |:----------:|
+| `--bucket-id` | Process data for specified bucket ID. _Requires `org-id` flag to be set._ | string |
+| `-h`, `--help` | View help for `report-tsi`. | |
+| `-m`, `--measurements` | Group cardinality by measurements. | |
+| `-o`, `--org-id` | Process data for specified organization ID. | string |
+| `--path` | Specify path to index. Defaults to `~/.influxdbv2/engine/index`. | string |
+| `--series-file` | Specify path to series file. Defaults to `~/.influxdbv2/engine/_series`. | string |
+| `-t`, `-top` | Limit results to the top n. | integer |
diff --git a/content/v2.0/reference/cli/influxd/inspect/report-tsm.md b/content/v2.0/reference/cli/influxd/inspect/report-tsm.md
index 85413c1a2..80e23c00f 100644
--- a/content/v2.0/reference/cli/influxd/inspect/report-tsm.md
+++ b/content/v2.0/reference/cli/influxd/inspect/report-tsm.md
@@ -49,7 +49,7 @@ in the following ways:
| Flag | Description | Input Type |
|:---- |:----------- |:----------:|
| `--bucket-id` | Process only data belonging to bucket ID. _Requires `org-id` flag to be set._ | string |
-| `--data-dir` | Use provided data directory (defaults to ~/.influxdbv2/engine/data). | string |
+| `--data-dir` | Use provided data directory (defaults to `~/.influxdbv2/engine/data`). | string |
| `--detailed` | Emit series cardinality segmented by measurements, tag keys, and fields. _**May take a while**_. | |
| `--exact` | Calculate an exact cardinality count. _**May use significant memory**_. | |
| `-h`, `--help` | Help for `report-tsm`. | |
diff --git a/content/v2.0/reference/cli/influxd/inspect/verify-seriesfile.md b/content/v2.0/reference/cli/influxd/inspect/verify-seriesfile.md
new file mode 100644
index 000000000..28563678f
--- /dev/null
+++ b/content/v2.0/reference/cli/influxd/inspect/verify-seriesfile.md
@@ -0,0 +1,25 @@
+---
+title: influxd inspect verify-seriesfile
+description: >
+ The `influxd inspect verify-seriesfile` command verifies the integrity of series files.
+v2.0/tags: [inspect]
+menu:
+ v2_0_ref:
+ parent: influxd inspect
+weight: 301
+---
+
+The `influxd inspect verify-seriesfile` command verifies the integrity of series files.
+
+## Usage
+```sh
+influxd inspect verify-seriesfile [flags]
+```
+
+## Flags
+| Flag | Description | Input Type |
+|:---- |:----------- |:----------:|
+| `-c`, `--c` | Number of workers to run concurrently (defaults to 8). | integer |
+| `-h`, `--help` | Help for `verify-seriesfile`. | |
+| `--series-file` | Path to series file (defaults to `~/.influxdbv2/engine/_series`). | string |
+| `-v`, `--verbose` | Enable verbose output. | |
diff --git a/content/v2.0/reference/cli/influxd/inspect/verify-tsm.md b/content/v2.0/reference/cli/influxd/inspect/verify-tsm.md
index cd8ad2f4b..e2c5cac84 100644
--- a/content/v2.0/reference/cli/influxd/inspect/verify-tsm.md
+++ b/content/v2.0/reference/cli/influxd/inspect/verify-tsm.md
@@ -3,7 +3,7 @@ title: influxd inspect verify-tsm
description: >
The `influxd inspect verify-tsm` command analyzes a set of TSM files for inconsistencies
between the TSM index and the blocks.
-v2.0/tags: [wal, inspect]
+v2.0/tags: [tsm, inspect]
menu:
v2_0_ref:
parent: influxd inspect
diff --git a/content/v2.0/reference/client-libraries.md b/content/v2.0/reference/client-libraries.md
index 8d9eec75e..7411ec317 100644
--- a/content/v2.0/reference/client-libraries.md
+++ b/content/v2.0/reference/client-libraries.md
@@ -18,5 +18,8 @@ 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 %}}
+- [C#](https://github.com/influxdata/influxdb-client-csharp)
- [Go](https://github.com/influxdata/influxdb-client-go)
+- [Java](https://github.com/influxdata/influxdb-client-java)
- [JavaScript/Node.js](https://github.com/influxdata/influxdb-client-js)
+- [Python](https://github.com/influxdata/influxdb-client-python)
diff --git a/content/v2.0/reference/flux/_index.md b/content/v2.0/reference/flux/_index.md
index 647a0407d..a1b77af63 100644
--- a/content/v2.0/reference/flux/_index.md
+++ b/content/v2.0/reference/flux/_index.md
@@ -8,7 +8,7 @@ menu:
weight: 4
---
-The following articles are meant as a reference for Flux functions and the
-Flux language specification.
+The following articles are meant as a reference for the Flux standard library and
+the Flux language specification.
{{< children >}}
diff --git a/content/v2.0/reference/flux/functions/_index.md b/content/v2.0/reference/flux/functions/_index.md
deleted file mode 100644
index ee315518b..000000000
--- a/content/v2.0/reference/flux/functions/_index.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: Flux packages and functions
-description: Flux packages and functions allows you to retrieve, transform, process, and output data easily.
-v2.0/tags: [flux, functions, package]
-menu:
- v2_0_ref:
- name: Flux packages and functions
- parent: Flux query language
-weight: 102
----
-
-Flux's functional syntax allows you to retrieve, transform, process, and output data easily.
-There is a large library of built-in functions and importable packages:
-
-{{< children >}}
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/limit.md b/content/v2.0/reference/flux/functions/built-in/transformations/limit.md
deleted file mode 100644
index 8a216e38f..000000000
--- a/content/v2.0/reference/flux/functions/built-in/transformations/limit.md
+++ /dev/null
@@ -1,48 +0,0 @@
----
-title: limit() function
-description: The `limit()` function limits the number of records in output tables to a fixed number (n).
-aliases:
- - /v2.0/reference/flux/functions/transformations/limit
-menu:
- v2_0_ref:
- name: limit
- parent: built-in-transformations
-weight: 401
----
-
-The `limit()` function limits the number of records in output tables to a fixed number ([`n`](#n)).
-One output table is produced for each input table.
-Each output table contains the first `n` records after the first `offset` records of the input table.
-If the input table has less than `offset + n` records, all records except the first `offset` ones are output.
-
-_**Function type:** Filter_
-_**Output data type:** Object_
-
-```js
-limit(n:10, offset: 0)
-```
-
-## Parameters
-
-### n
-The maximum number of records to output.
-
-_**Data type:** Integer_
-
-### offset
-The number of records to skip per table before limiting to `n`.
-Defaults to `0`.
-
-_**Data type:** Integer_
-
-## Examples
-```js
-from(bucket:"example-bucket")
- |> range(start:-1h)
- |> limit(n:10, offset: 1)
-```
-
-
-
-##### Related InfluxQL functions and statements:
-[LIMIT](https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-limit-and-slimit-clauses)
diff --git a/content/v2.0/reference/flux/language/assignment-scope.md b/content/v2.0/reference/flux/language/assignment-scope.md
index 99e03231a..2b20f7ce8 100644
--- a/content/v2.0/reference/flux/language/assignment-scope.md
+++ b/content/v2.0/reference/flux/language/assignment-scope.md
@@ -8,12 +8,6 @@ menu:
weight: 202
---
-{{% note %}}
-This document is a living document and may not represent the current implementation of Flux.
-Any section that is not currently implemented is commented with a **[IMPL#XXX]** where
-**XXX** is an issue number tracking discussion and progress towards implementation.
-{{% /note %}}
-
An assignment binds an identifier to a variable, option, or function.
Every identifier in a program must be assigned.
@@ -32,10 +26,6 @@ Note that the package clause is not an assignment.
The package name does not appear in any scope.
Its purpose is to identify the files belonging to the same package and to specify the default package name for import declarations.
-{{% note %}}
-[IMPL#247](https://github.com/influxdata/platform/issues/247) Add package/namespace support.
-{{% /note %}}
-
## Variable assignment
A variable assignment creates a variable bound to an identifier and gives it a type and value.
A variable keeps the same type and value for the remainder of its lifetime.
diff --git a/content/v2.0/reference/flux/language/expressions.md b/content/v2.0/reference/flux/language/expressions.md
index 28392fb47..1dc60a210 100644
--- a/content/v2.0/reference/flux/language/expressions.md
+++ b/content/v2.0/reference/flux/language/expressions.md
@@ -269,4 +269,8 @@ PostfixOperator = MemberExpression
| IndexExpression .
```
+{{% warn %}}
+Dividing by 0 or using the mod operator with a divisor of 0 will result in an error.
+{{% /warn %}}
+
_Also see [Flux Operators](/v2.0/reference/flux/language/operators)._
diff --git a/content/v2.0/reference/flux/language/lexical-elements.md b/content/v2.0/reference/flux/language/lexical-elements.md
index ee588967b..c39f9f7b6 100644
--- a/content/v2.0/reference/flux/language/lexical-elements.md
+++ b/content/v2.0/reference/flux/language/lexical-elements.md
@@ -269,8 +269,7 @@ String literals support several escape sequences.
\t U+0009 horizontal tab
\" U+0022 double quote
\\ U+005C backslash
-\{ U+007B open curly bracket
-\} U+007D close curly bracket
+\${ U+0024 U+007B dollar sign and opening curly bracket
```
Additionally, any byte value may be specified via a hex encoding using `\x` as the prefix.
@@ -281,15 +280,9 @@ byte_value = `\` "x" hex_digit hex_digit .
hex_digit = "0" … "9" | "A" … "F" | "a" … "f" .
unicode_value = unicode_char | escaped_char .
escaped_char = `\` ( "n" | "r" | "t" | `\` | `"` ) .
-StringExpression = "{" Expression "}" .
+StringExpression = "${" Expression "}" .
```
-{{% note %}}
-To be added: TODO: With string interpolation `string_lit` is not longer a lexical token as part of a literal, but an entire expression in and of itself.
-
-[IMPL#252](https://github.com/influxdata/platform/issues/252) Parse string literals.
-{{% /note %}}
-
##### Examples of string literals
```js
@@ -301,12 +294,12 @@ To be added: TODO: With string interpolation `string_lit` is not longer a lexica
```
String literals are also interpolated for embedded expressions to be evaluated as strings.
-Embedded expressions are enclosed in curly brackets (`{}`).
+Embedded expressions are enclosed in a dollar sign and curly braces (`${}`).
The expressions are evaluated in the scope containing the string literal.
-The result of an expression is formatted as a string and replaces the string content between the brackets.
+The result of an expression is formatted as a string and replaces the string content between the braces.
All types are formatted as strings according to their literal representation.
A function `printf` exists to allow more precise control over formatting of various types.
-To include the literal curly brackets within a string they must be escaped.
+To include the literal `${` within a string, it must be escaped.
{{% note %}}
[IMPL#248](https://github.com/influxdata/platform/issues/248) Add printf function.
@@ -316,14 +309,13 @@ To include the literal curly brackets within a string they must be escaped.
```js
n = 42
-"the answer is {n}" // the answer is 42
-"the answer is not {n+1}" // the answer is not 43
-"openinng curly bracket \{" // openinng curly bracket {
-"closing curly bracket \}" // closing curly bracket }
+"the answer is ${n}" // the answer is 42
+"the answer is not ${n+1}" // the answer is not 43
+"dollar sign opening curly bracket \${" // dollar sign opening curly bracket ${
```
{{% note %}}
-[IMPL#251](https://github.com/influxdata/platform/issues/251) Add string interpolation support
+[IMPL#1775](https://github.com/influxdata/flux/issues/1775) Interpolate arbitrary expressions in string literals
{{% /note %}}
### Regular expression literals
diff --git a/content/v2.0/reference/flux/language/packages.md b/content/v2.0/reference/flux/language/packages.md
index ce7d0f459..a04d6173c 100644
--- a/content/v2.0/reference/flux/language/packages.md
+++ b/content/v2.0/reference/flux/language/packages.md
@@ -13,12 +13,6 @@ menu:
weight: 207
---
-{{% note %}}
-This document is a living document and may not represent the current implementation of Flux.
-Any section that is not currently implemented is commented with a **[IMPL#XXX]** where
-**XXX** is an issue number tracking discussion and progress towards implementation.
-{{% /note %}}
-
Flux source is organized into packages.
A package consists of one or more source files.
Each source file is parsed individually and composed into a single package.
@@ -41,10 +35,6 @@ All files in the same package must declare the same package name.
When a file does not declare a package clause, all identifiers in that
file will belong to the special `main` package.
-{{% note %}}
-[IMPL#247](https://github.com/influxdata/platform/issues/247) Add package/namespace support.
-{{% /note %}}
-
### Package main
The `main` package is special for a few reasons:
diff --git a/content/v2.0/reference/flux/language/statements.md b/content/v2.0/reference/flux/language/statements.md
index 5ae6b94c0..e3335228b 100644
--- a/content/v2.0/reference/flux/language/statements.md
+++ b/content/v2.0/reference/flux/language/statements.md
@@ -119,6 +119,7 @@ duration // duration of time
time // time
string // utf-8 encoded string
regexp // regular expression
+bytes // sequence of byte values
type // a type that itself describes a type
```
diff --git a/content/v2.0/reference/flux/language/string-interpolation.md b/content/v2.0/reference/flux/language/string-interpolation.md
new file mode 100644
index 000000000..fcb2ea593
--- /dev/null
+++ b/content/v2.0/reference/flux/language/string-interpolation.md
@@ -0,0 +1,96 @@
+---
+title: String interpolation
+description: >
+ Flux string interpolation evaluates string literals containing one or more placeholders
+ and returns a result with placeholders replaced with their corresponding values.
+menu:
+ v2_0_ref:
+ parent: Flux specification
+ name: String interpolation
+weight: 211
+---
+
+Flux string interpolation evaluates string literals containing one or more placeholders
+and returns a result with placeholders replaced with their corresponding values.
+
+## String interpolation syntax
+To use Flux string interpolation, enclose embedded [expressions](/v2.0/reference/flux/language/expressions/)
+in a dollar sign and curly braces `${}`.
+Flux replaces the content between the braces with the result of the expression and
+returns a string literal.
+
+```js
+name = "John"
+
+"My name is ${name}."
+
+// My name is John.
+```
+
+{{% note %}}
+#### Flux only interpolates string values
+Flux currently interpolates only string values ([IMP#1775](https://github.com/influxdata/flux/issues/1775)).
+Use the [string() function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string/)
+to convert non-string values to strings.
+
+```js
+count = 12
+
+"I currently have ${string(v: count)} cats."
+```
+{{% /note %}}
+
+
+## Use dot notation to interpolate object values
+[Objects](/v2.0/reference/flux/language/expressions/#object-literals) consist of key-value pairs.
+Use [dot notation](/v2.0/reference/flux/language/expressions/#member-expressions)
+to interpolate values from an object.
+
+```js
+person = {
+ name: "John",
+ age: 42
+}
+
+"My name is ${person.name} and I'm ${string(v: person.age)} years old."
+
+// My name is John and I'm 42 years old.
+```
+
+Flux returns each record in query results as an object.
+In Flux row functions, each row object is represented by `r`.
+Use dot notation to interpolate specific column values from the `r` object.
+
+##### Use string interpolation to add a human-readable message
+```js
+from(bucket: "example-bucket")
+ |> range(start: -30m)
+ |> map(fn: (r) => ({
+ r with
+ human-readable: "${r._field} is ${r._value} at ${string(v: r._time)}."
+ }))
+```
+
+## String interpolation versus concatenation
+Flux supports both string interpolation and string concatenation.
+String interpolation is a more concise method for achieving the same result.
+
+```js
+person = {
+ name: "John",
+ age: 42
+}
+
+// String interpolation
+"My name is ${person.name} and I'm ${string(v: person.age)} years old."
+
+// String concatenation
+"My name is " + person.name + " and I'm " + string(v: person.age) + " years old."
+
+// Both return: My name is John and I'm 42 years old.
+```
+
+{{% note %}}
+Check and notification message templates configured in the InfluxDB user interface
+**do not** support string concatenation.
+{{% /note %}}
diff --git a/content/v2.0/reference/flux/language/types.md b/content/v2.0/reference/flux/language/types.md
index 486140d6c..495e6450a 100644
--- a/content/v2.0/reference/flux/language/types.md
+++ b/content/v2.0/reference/flux/language/types.md
@@ -105,7 +105,12 @@ The string type is nullable.
An empty string is **not** a _null_ value.
{{% /note %}}
-The length of a string is its size in bytes, not the number of characters, since a single character may be multiple bytes.
+The length of a string is its size in bytes, not the number of characters,
+since a single character may be multiple bytes.
+
+### Bytes types
+A _bytes type_ represents a sequence of byte values.
+The bytes type name is `bytes`.
## Regular expression types
A _regular expression type_ represents the set of all patterns for regular expressions.
diff --git a/content/v2.0/reference/flux/stdlib/_index.md b/content/v2.0/reference/flux/stdlib/_index.md
new file mode 100644
index 000000000..a3b1b89e1
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/_index.md
@@ -0,0 +1,18 @@
+---
+title: Flux standard library
+description: >
+ The Flux standard library includes built-in functions and importable packages
+ that retrieve, transform, process, and output data.
+aliases:
+ - /v2.0/reference/flux/functions/
+v2.0/tags: [flux, functions, package]
+menu:
+ v2_0_ref:
+ parent: Flux query language
+weight: 102
+---
+
+The Flux standard library includes built-in functions and importable packages
+that retrieve, transform,rocess, and output data.
+
+{{< children >}}
diff --git a/content/v2.0/reference/flux/functions/all-functions.md b/content/v2.0/reference/flux/stdlib/all-functions.md
similarity index 73%
rename from content/v2.0/reference/flux/functions/all-functions.md
rename to content/v2.0/reference/flux/stdlib/all-functions.md
index f0a0f821a..19e879712 100644
--- a/content/v2.0/reference/flux/functions/all-functions.md
+++ b/content/v2.0/reference/flux/stdlib/all-functions.md
@@ -1,10 +1,12 @@
---
title: Complete list of Flux functions
description: View the full library of documented Flux functions.
+aliases:
+ - /v2.0/reference/flux/functions/all-functions/
menu:
v2_0_ref:
name: View all functions
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 299
---
diff --git a/content/v2.0/reference/flux/functions/built-in/_index.md b/content/v2.0/reference/flux/stdlib/built-in/_index.md
similarity index 87%
rename from content/v2.0/reference/flux/functions/built-in/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/_index.md
index d46c12140..7d3a305d4 100644
--- a/content/v2.0/reference/flux/functions/built-in/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/_index.md
@@ -4,10 +4,12 @@ list_title: Built-in functions
description: >
Built-in functions provide a foundation for working with data using Flux.
They do not require an import statement and are usable without any extra setup.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/
menu:
v2_0_ref:
name: Built-in
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 201
v2.0/tags: [built-in, functions, package]
---
diff --git a/content/v2.0/reference/flux/functions/built-in/inputs/_index.md b/content/v2.0/reference/flux/stdlib/built-in/inputs/_index.md
similarity index 84%
rename from content/v2.0/reference/flux/functions/built-in/inputs/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/inputs/_index.md
index 064ac6442..ae684634a 100644
--- a/content/v2.0/reference/flux/functions/built-in/inputs/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/inputs/_index.md
@@ -3,7 +3,8 @@ title: Flux built-in input functions
list_title: Built-in input functions
description: Flux's built-in input functions define sources of data or or display information about data sources.
aliases:
- - /v2.0/reference/flux/functions/inputs
+ - /v2.0/reference/flux/functions/inputs
+ - /v2.0/reference/flux/functions/built-in/inputs/
menu:
v2_0_ref:
parent: Built-in
diff --git a/content/v2.0/reference/flux/functions/built-in/inputs/buckets.md b/content/v2.0/reference/flux/stdlib/built-in/inputs/buckets.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/built-in/inputs/buckets.md
rename to content/v2.0/reference/flux/stdlib/built-in/inputs/buckets.md
index 79aa46686..c759c932f 100644
--- a/content/v2.0/reference/flux/functions/built-in/inputs/buckets.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/inputs/buckets.md
@@ -3,6 +3,7 @@ title: buckets() function
description: The `buckets()` function returns a list of buckets in the organization.
aliases:
- /v2.0/reference/flux/functions/inputs/buckets
+ - /v2.0/reference/flux/functions/built-in/inputs/buckets/
menu:
v2_0_ref:
name: buckets
diff --git a/content/v2.0/reference/flux/functions/built-in/inputs/from.md b/content/v2.0/reference/flux/stdlib/built-in/inputs/from.md
similarity index 95%
rename from content/v2.0/reference/flux/functions/built-in/inputs/from.md
rename to content/v2.0/reference/flux/stdlib/built-in/inputs/from.md
index f7cf1b583..6c9cbe39a 100644
--- a/content/v2.0/reference/flux/functions/built-in/inputs/from.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/inputs/from.md
@@ -3,6 +3,7 @@ title: from() function
description: The `from()` function retrieves data from an InfluxDB data source.
aliases:
- /v2.0/reference/flux/functions/inputs/from
+ - /v2.0/reference/flux/functions/built-in/inputs/from/
menu:
v2_0_ref:
name: from
diff --git a/content/v2.0/reference/flux/functions/built-in/misc/_index.md b/content/v2.0/reference/flux/stdlib/built-in/misc/_index.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/misc/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/misc/_index.md
index 0e5217ec5..3bedf0dfc 100644
--- a/content/v2.0/reference/flux/functions/built-in/misc/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/misc/_index.md
@@ -6,6 +6,7 @@ description: >
retrieving, transforming, or outputting data.
aliases:
- /v2.0/reference/flux/functions/misc
+ - /v2.0/reference/flux/functions/built-in/misc/
menu:
v2_0_ref:
parent: Built-in
diff --git a/content/v2.0/reference/flux/functions/built-in/misc/intervals.md b/content/v2.0/reference/flux/stdlib/built-in/misc/intervals.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/misc/intervals.md
rename to content/v2.0/reference/flux/stdlib/built-in/misc/intervals.md
index d36acade3..3ee4a7f6c 100644
--- a/content/v2.0/reference/flux/functions/built-in/misc/intervals.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/misc/intervals.md
@@ -3,11 +3,13 @@ title: intervals() function
description: The `intervals()` function generates a set of time intervals over a range of time.
aliases:
- /v2.0/reference/flux/functions/misc/intervals
+ - /v2.0/reference/flux/functions/built-in/misc/intervals/
menu:
v2_0_ref:
name: intervals
parent: built-in-misc
weight: 401
+draft: true
---
The `intervals()` function generates a set of time intervals over a range of time.
@@ -19,7 +21,7 @@ The set of intervals includes all intervals that intersect with the initial rang
{{% note %}}
The `intervals()` function is designed to be used with the intervals parameter
-of the [`window()` function](/v2.0/reference/flux/functions/built-in/transformations/window).
+of the [`window()` function](/v2.0/reference/flux/stdlib/built-in/transformations/window).
{{% /note %}}
By default the end boundary of an interval will align with the Unix epoch (zero time)
diff --git a/content/v2.0/reference/flux/functions/built-in/misc/linearbins.md b/content/v2.0/reference/flux/stdlib/built-in/misc/linearbins.md
similarity index 87%
rename from content/v2.0/reference/flux/functions/built-in/misc/linearbins.md
rename to content/v2.0/reference/flux/stdlib/built-in/misc/linearbins.md
index 0df48b679..658ec2d5a 100644
--- a/content/v2.0/reference/flux/functions/built-in/misc/linearbins.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/misc/linearbins.md
@@ -3,6 +3,7 @@ title: linearBins() function
description: The `linearBins()` function generates a list of linearly separated floats.
aliases:
- /v2.0/reference/flux/functions/misc/linearbins
+ - /v2.0/reference/flux/functions/built-in/misc/linearbins/
menu:
v2_0_ref:
name: linearBins
@@ -12,7 +13,7 @@ weight: 401
The `linearBins()` function generates a list of linearly separated floats.
It is a helper function meant to generate bin bounds for the
-[`histogram()` function](/v2.0/reference/flux/functions/built-in/transformations/histogram).
+[`histogram()` function](/v2.0/reference/flux/stdlib/built-in/transformations/histogram).
_**Function type:** Miscellaneous_
_**Output data type:** Array of floats_
diff --git a/content/v2.0/reference/flux/functions/built-in/misc/logarithmicbins.md b/content/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins.md
similarity index 82%
rename from content/v2.0/reference/flux/functions/built-in/misc/logarithmicbins.md
rename to content/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins.md
index 5d6f7270c..5a6c2d59e 100644
--- a/content/v2.0/reference/flux/functions/built-in/misc/logarithmicbins.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins.md
@@ -3,6 +3,7 @@ title: logarithmicBins() function
description: The `logarithmicBins()` function generates a list of exponentially separated floats.
aliases:
- /v2.0/reference/flux/functions/misc/logarithmicbins
+ - /v2.0/reference/flux/functions/built-in/misc/logarithmicbins/
menu:
v2_0_ref:
name: logarithmicBins
@@ -12,7 +13,7 @@ weight: 401
The `logarithmicBins()` function generates a list of exponentially separated floats.
It is a helper function meant to generate bin bounds for the
-[`histogram()` function](/v2.0/reference/flux/functions/built-in/transformations/histogram).
+[`histogram()` function](/v2.0/reference/flux/stdlib/built-in/transformations/histogram).
_**Function type:** Miscellaneous_
_**Output data type:** Array of floats_
@@ -46,7 +47,7 @@ _**Data type:** Boolean_
## Examples
```js
-logarithmicBins(start: 1.0, factor: 2.0, count: 10, infinty: true)
+logarithmicBins(start: 1.0, factor: 2.0, count: 10, infinity: true)
// Generated list: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, +Inf]
```
diff --git a/content/v2.0/reference/flux/functions/built-in/misc/now.md b/content/v2.0/reference/flux/stdlib/built-in/misc/now.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/built-in/misc/now.md
rename to content/v2.0/reference/flux/stdlib/built-in/misc/now.md
index d342ad0b0..00d6d0796 100644
--- a/content/v2.0/reference/flux/functions/built-in/misc/now.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/misc/now.md
@@ -1,6 +1,8 @@
---
title: now() function
description: The `now()` function returns the current time (UTC).
+aliases:
+ - /v2.0/reference/flux/functions/built-in/misc/now/
menu:
v2_0_ref:
name: now
diff --git a/content/v2.0/reference/flux/functions/built-in/misc/sleep.md b/content/v2.0/reference/flux/stdlib/built-in/misc/sleep.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/misc/sleep.md
rename to content/v2.0/reference/flux/stdlib/built-in/misc/sleep.md
index 7e6221048..c143a4fd2 100644
--- a/content/v2.0/reference/flux/functions/built-in/misc/sleep.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/misc/sleep.md
@@ -1,6 +1,8 @@
---
title: sleep() function
description: The `sleep()` function delays execution by a specified duration.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/misc/sleep/
menu:
v2_0_ref:
name: sleep
diff --git a/content/v2.0/reference/flux/functions/built-in/outputs/_index.md b/content/v2.0/reference/flux/stdlib/built-in/outputs/_index.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/built-in/outputs/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/outputs/_index.md
index 568746148..01432c2a4 100644
--- a/content/v2.0/reference/flux/functions/built-in/outputs/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/outputs/_index.md
@@ -4,6 +4,7 @@ list_title: Built-in output functions
description: Flux's built-in output functions yield results or send data to a specified output destination.
aliases:
- /v2.0/reference/flux/functions/outputs
+ - /v2.0/reference/flux/functions/built-in/outputs/
menu:
v2_0_ref:
parent: Built-in
diff --git a/content/v2.0/reference/flux/functions/built-in/outputs/to.md b/content/v2.0/reference/flux/stdlib/built-in/outputs/to.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/built-in/outputs/to.md
rename to content/v2.0/reference/flux/stdlib/built-in/outputs/to.md
index 0d6e900e8..63ec618b5 100644
--- a/content/v2.0/reference/flux/functions/built-in/outputs/to.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/outputs/to.md
@@ -3,6 +3,7 @@ title: to() function
description: The `to()` function writes data to an InfluxDB v2.0 bucket.
aliases:
- /v2.0/reference/flux/functions/outputs/to
+ - /v2.0/reference/flux/functions/built-in/outputs/to/
menu:
v2_0_ref:
name: to
@@ -51,38 +52,30 @@ All output data must include the following columns:
## Parameters
{{% note %}}
-`bucket` OR `bucketID` is **required**.
+You must provide a `bucket` or `bucketID` and an `org` or `orgID`.
{{% /note %}}
### bucket
-
-The bucket to which data is written. Mutually exclusive with `bucketID`.
+The bucket to write data to.
+`bucket` and `bucketID` are mutually exclusive.
_**Data type:** String_
### bucketID
-
-The ID of the bucket to which data is written. Mutually exclusive with `bucket`.
+The ID of the bucket to write data to.
+`bucketID` and `bucket` are mutually exclusive.
_**Data type:** String_
### org
-
The organization name of the specified [`bucket`](#bucket).
-Only required when writing to a remote host.
-Mutually exclusive with `orgID`
+`org` and `orgID` are mutually exclusive.
_**Data type:** String_
-{{% note %}}
-Specify either an `org` or an `orgID`, but not both.
-{{% /note %}}
-
### orgID
-
The organization ID of the specified [`bucket`](#bucket).
-Only required when writing to a remote host.
-Mutually exclusive with `org`.
+`orgID` and `org` are mutually exclusive.
_**Data type:** String_
@@ -108,21 +101,24 @@ _**Data type:** String_
### tagColumns
The tag columns of the output.
-Defaults to all columns with type `string`, excluding all value columns and the `_field` column if present.
+Defaults to all columns with type `string`, excluding all value columns and the
+`_field` column if present.
_**Data type:** Array of strings_
### fieldFn
Function that takes a record from the input table and returns an object.
-For each record from the input table, `fieldFn` returns an object that maps output the field key to the output value.
+For each record from the input table, `fieldFn` returns an object that maps output
+the field key to the output value.
Default is `(r) => ({ [r._field]: r._value })`
_**Data type:** Function_
_**Output data type:** Object_
{{% note %}}
-Make sure `fieldFn` parameter names match each specified parameter. To learn why, see [Match parameter names](/v2.0/reference/flux/language/data-model/#match-parameter-names).
+Make sure `fieldFn` parameter names match each specified parameter.
+To learn why, see [Match parameter names](/v2.0/reference/flux/language/data-model/#match-parameter-names).
{{% /note %}}
## Examples
diff --git a/content/v2.0/reference/flux/functions/built-in/outputs/yield.md b/content/v2.0/reference/flux/stdlib/built-in/outputs/yield.md
similarity index 95%
rename from content/v2.0/reference/flux/functions/built-in/outputs/yield.md
rename to content/v2.0/reference/flux/stdlib/built-in/outputs/yield.md
index 2c5c27ef7..8a736af63 100644
--- a/content/v2.0/reference/flux/functions/built-in/outputs/yield.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/outputs/yield.md
@@ -3,6 +3,7 @@ title: yield() function
description: The `yield()` function indicates the input tables received should be delivered as a result of the query.
aliases:
- /v2.0/reference/flux/functions/outputs/yield
+ - /v2.0/reference/flux/functions/built-in/outputs/yield/
menu:
v2_0_ref:
name: yield
diff --git a/content/v2.0/reference/flux/functions/built-in/tests/_index.md b/content/v2.0/reference/flux/stdlib/built-in/tests/_index.md
similarity index 89%
rename from content/v2.0/reference/flux/functions/built-in/tests/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/tests/_index.md
index 1dd1dcc77..91ad2fcda 100644
--- a/content/v2.0/reference/flux/functions/built-in/tests/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/tests/_index.md
@@ -2,6 +2,8 @@
title: Flux built-in testing functions
list_title: Built-in testing functions
description: Flux's built-in testing functions test various aspects of piped-forward data.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/tests/
menu:
v2_0_ref:
name: Tests
diff --git a/content/v2.0/reference/flux/functions/built-in/tests/contains.md b/content/v2.0/reference/flux/stdlib/built-in/tests/contains.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/tests/contains.md
rename to content/v2.0/reference/flux/stdlib/built-in/tests/contains.md
index ab2810daf..88376e185 100644
--- a/content/v2.0/reference/flux/functions/built-in/tests/contains.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/tests/contains.md
@@ -1,6 +1,8 @@
---
title: contains() function
description: The `contains()` function tests whether a value is a member of a set.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/tests/contains/
menu:
v2_0_ref:
name: contains
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/_index.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/built-in/transformations/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/_index.md
index c75a50f9f..1b5ac3bfa 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/_index.md
@@ -4,6 +4,7 @@ list_title: Built-in transformation functions
description: Flux's built-in transformation functions transform and shape your data in specific ways.
aliases:
- /v2.0/reference/flux/functions/transformations
+ - /v2.0/reference/flux/functions/built-in/transformations/
menu:
v2_0_ref:
parent: Built-in
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/_index.md
similarity index 69%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/_index.md
index 047f02769..b14244358 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/_index.md
@@ -4,6 +4,7 @@ list_title: Built-in aggregate functions
description: Flux's built-in aggregate functions take values from an input table and aggregate them in some way.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/
menu:
v2_0_ref:
parent: built-in-transformations
@@ -29,7 +30,7 @@ Any output table will have the following properties:
- It will not have a `_time` column.
### aggregateWindow helper function
-The [`aggregateWindow()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow)
+The [`aggregateWindow()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow)
does most of the work needed when aggregating data.
It windows and aggregates the data, then combines windowed tables into a single output table.
@@ -43,9 +44,9 @@ The following functions are both aggregates and selectors.
Each returns `n` values after performing an aggregate operation.
They are categorized as selector functions in this documentation:
-- [highestAverage](/v2.0/reference/flux/functions/transformations/selectors/highestaverage)
-- [highestCurrent](/v2.0/reference/flux/functions/transformations/selectors/highestcurrent)
-- [highestMax](/v2.0/reference/flux/functions/transformations/selectors/highestmax)
-- [lowestAverage](/v2.0/reference/flux/functions/transformations/selectors/lowestaverage)
-- [lowestCurrent](/v2.0/reference/flux/functions/transformations/selectors/lowestcurrent)
-- [lowestMin](/v2.0/reference/flux/functions/transformations/selectors/lowestmin)
+- [highestAverage](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestaverage)
+- [highestCurrent](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestcurrent)
+- [highestMax](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestmax)
+- [lowestAverage](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestaverage)
+- [lowestCurrent](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestcurrent)
+- [lowestMin](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestmin)
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow.md
similarity index 70%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow.md
index 33ffd49f5..ce15d9685 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow.md
@@ -3,6 +3,7 @@ title: aggregateWindow() function
description: The `aggregateWindow()` function applies an aggregate function to fixed windows of time.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/aggregatewindow
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/aggregatewindow/
menu:
v2_0_ref:
name: aggregateWindow
@@ -10,7 +11,8 @@ menu:
weight: 501
---
-The `aggregateWindow()` function applies an aggregate function to fixed windows of time.
+The `aggregateWindow()` function applies an aggregate or selector function
+(any function with a `column` parameter) to fixed windows of time.
_**Function type:** Aggregate_
@@ -25,10 +27,14 @@ aggregateWindow(
)
```
-As data is windowed into separate tables and aggregated, the `_time` column is dropped from each group key.
+As data is windowed into separate tables and processed, the `_time` column is dropped from each group key.
This function copies the timestamp from a remaining column into the `_time` column.
View the [function definition](#function-definition).
+`aggregateWindow()` restores the original `_start` and `_stop` values of input data
+and, by default, uses `_stop` to set the `_time` value for each aggregated window.
+Each row in the output of `aggregateWindow` represents an aggregated window ending at `_time`.
+
## Parameters
{{% note %}}
@@ -43,12 +49,12 @@ _**Data type:** Duration_
### fn
-The [aggregate function](/v2.0/reference/flux/functions/built-in/transformations/aggregates) used in the operation.
+The [aggregate function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates) used in the operation.
_**Data type:** Function_
{{% note %}}
-Only aggregate functions with a `column` parameter (singular) work with `aggregateWindow()`.
+Only aggregate and selector functions with a `column` parameter (singular) work with `aggregateWindow()`.
{{% /note %}}
### column
@@ -95,11 +101,10 @@ from(bucket: "example-bucket")
fn: mean
)
```
-###### Specifying parameters of the aggregate function
-
-To use `aggregateWindow()` aggregate functions that don't provide defaults for required parameters,
-for the `fn` parameter, define an anonymous function with `columns` and `tables` parameters
-that pipe-forwards tables into the aggregate function with all required parameters defined:
+###### Specify parameters of the aggregate function
+To use functions that don't provide defaults for required parameters with `aggregateWindow()`,
+define an anonymous function with `column` and `tables` parameters that pipe-forward
+tables into the aggregate or selector function with all required parameters defined:
```js
from(bucket: "example-bucket")
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/chandemomentumoscillator.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/chandemomentumoscillator.md
new file mode 100644
index 000000000..781a5bbd4
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/chandemomentumoscillator.md
@@ -0,0 +1,112 @@
+---
+title: chandeMomentumOscillator() function
+description: >
+ The `chandeMomentumOscillator()` function applies the technical momentum indicator
+ developed by Tushar Chande.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/chandemomentumoscillator/
+menu:
+ v2_0_ref:
+ name: chandeMomentumOscillator
+ parent: built-in-aggregates
+weight: 501
+related:
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#triple-exponential-moving-average, InfluxQL CHANDE_MOMENTUM_OSCILLATOR()
+---
+
+The `chandeMomentumOscillator()` function applies the technical momentum indicator
+developed by Tushar Chande.
+
+_**Function type:** Aggregate_
+
+```js
+chandeMomentumOscillator(
+ n: 10,
+ columns: ["_value"]
+)
+```
+
+The Chande Momentum Oscillator (CMO) indicator calculates the difference between
+the sum of all recent data points with values greater than the median value of the data set
+and the sum of all recent data points with values lower than the median value of the data set,
+then divides the result by the sum of all data movement over a given time period.
+It then multiplies the result by 100 and returns a value between -100 and +100.
+
+## Parameters
+
+### n
+The period or number of points to use in the calculation.
+
+_**Data type: Integer**_
+
+### columns
+The columns to operate on.
+Defaults to `["_value"]`.
+
+_**Data type: Array of Strings**_
+
+## Examples
+
+#### Table transformation with a ten point Chande Momentum Oscillator
+
+###### Input table
+| _time | _value |
+|:-----:|:------:|
+| 0001 | 1 |
+| 0002 | 2 |
+| 0003 | 3 |
+| 0004 | 4 |
+| 0005 | 5 |
+| 0006 | 6 |
+| 0007 | 7 |
+| 0008 | 8 |
+| 0009 | 9 |
+| 0010 | 10 |
+| 0011 | 11 |
+| 0012 | 12 |
+| 0013 | 13 |
+| 0014 | 14 |
+| 0015 | 15 |
+| 0016 | 14 |
+| 0017 | 13 |
+| 0018 | 12 |
+| 0019 | 11 |
+| 0020 | 10 |
+| 0021 | 9 |
+| 0022 | 8 |
+| 0023 | 7 |
+| 0024 | 6 |
+| 0025 | 5 |
+| 0026 | 4 |
+| 0027 | 3 |
+| 0028 | 2 |
+| 0029 | 1 |
+
+###### Query
+```js
+// ...
+ |> chandeMomentumOscillator(n: 10)
+```
+
+###### Output table
+| _time | _value |
+|:-----:|:------:|
+| 0011 | 100 |
+| 0012 | 100 |
+| 0013 | 100 |
+| 0014 | 100 |
+| 0015 | 100 |
+| 0016 | 80 |
+| 0017 | 60 |
+| 0018 | 40 |
+| 0019 | 20 |
+| 0020 | 0 |
+| 0021 | -20 |
+| 0022 | -40 |
+| 0023 | -60 |
+| 0024 | -80 |
+| 0025 | -100 |
+| 0026 | -100 |
+| 0027 | -100 |
+| 0028 | -100 |
+| 0029 | -100 |
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/count.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/count.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/count.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/count.md
index 3f30cd2f9..3b2540a71 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/count.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/count.md
@@ -3,6 +3,7 @@ title: count() function
description: The `count()` function outputs the number of non-null records in a column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/count
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/count/
menu:
v2_0_ref:
name: count
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/cov.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/cov.md
similarity index 95%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/cov.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/cov.md
index 708c9375c..af138115a 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/cov.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/cov.md
@@ -3,6 +3,7 @@ title: cov() function
description: The `cov()` function computes the covariance between two streams by first joining the streams, then performing the covariance operation.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/cov
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/cov/
menu:
v2_0_ref:
name: cov
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/covariance.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/covariance.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/covariance.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/covariance.md
index 7f7254bcc..f4e7ecbbc 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/covariance.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/covariance.md
@@ -3,6 +3,7 @@ title: covariance() function
description: The `covariance()` function computes the covariance between two columns.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/covariance
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/covariance/
menu:
v2_0_ref:
name: covariance
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/derivative.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/derivative.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md
index cffc3973b..fbfebd257 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/derivative.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/derivative.md
@@ -3,6 +3,7 @@ title: derivative() function
description: The `derivative()` function computes the rate of change per unit of time between subsequent non-null records.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/derivative
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/derivative/
menu:
v2_0_ref:
name: derivative
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/difference.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md
similarity index 72%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/difference.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md
index f864f6626..45179da67 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/difference.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/difference.md
@@ -3,6 +3,7 @@ title: difference() function
description: The `difference()` function computes the difference between subsequent non-null records.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/difference
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/difference/
menu:
v2_0_ref:
name: difference
@@ -11,13 +12,17 @@ weight: 501
---
The `difference()` function computes the difference between subsequent records.
-The user-specified column of numeric type is subtracted while others are kept intact.
+The user-specified columns of numeric type are subtracted while others are kept intact.
_**Function type:** Aggregate_
_**Output data type:** Float_
```js
-difference(nonNegative: false, column: "_value")
+difference(
+ nonNegative: false,
+ columns: ["_value"],
+ keepFirst: false
+)
```
## Parameters
@@ -28,11 +33,18 @@ When set to `true`, if a value is less than the previous value, it is assumed th
_**Data type:** Boolean_
-### column
-The column to use to compute the difference.
-Defaults to `"_value"`.
+### columns
+The columns to use to compute the difference.
+Defaults to `["_value"]`.
-_**Data type:** String_
+_**Data type:** Array of Strings_
+
+### keepFirst
+Indicates the first row should be kept.
+If `true`, the difference will be `null`.
+Defaults to `false`.
+
+_**Data type:** Boolean_
## Subtraction rules for numeric types
- The difference between two non-null values is their algebraic difference;
@@ -90,6 +102,20 @@ from(bucket: "example-bucket")
| 0004 | 6 | tv |
| 0005 | null | tv |
+
+#### With keepFirst set to true
+```js
+|> difference(nonNegative: false, keepfirst: true):
+```
+###### Output table
+| _time | _value | tag |
+|:-----:|:------:|:---:|
+| 0001 | null | tv |
+| 0002 | null | tv |
+| 0003 | -2 | tv |
+| 0004 | 6 | tv |
+| 0005 | null | tv |
+
##### Related InfluxQL functions and statements:
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema.md
new file mode 100644
index 000000000..54799e1e1
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema.md
@@ -0,0 +1,65 @@
+---
+title: doubleEMA() function
+description: >
+ The `doubleEMA()` function calculates the exponential moving average of values
+ grouped into `n` number of points, giving more weight to recent data at double
+ the rate of `exponentialMovingAverage()`.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
+menu:
+ v2_0_ref:
+ name: doubleEMA
+ parent: built-in-aggregates
+weight: 501
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#double-exponential-moving-average, InfluxQL DOUBLE_EXPONENTIAL_MOVING_AVERAGE()
+---
+
+The `doubleEMA()` function calculates the exponential moving average of values in
+the `_value` column grouped into `n` number of points, giving more weight to recent
+data at double the rate of [`exponentialMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/).
+
+_**Function type:** Aggregate_
+
+```js
+doubleEMA(n: 5)
+```
+
+##### Double exponential moving average rules
+- A double exponential moving average is defined as `doubleEMA = 2 * EMA_N - EMA of EMA_N`.
+ - `EMA` is an exponential moving average.
+ - `N = n` is the period used to calculate the EMA.
+- A true double exponential moving average requires at least `2 * n - 1` values.
+ If not enough values exist to calculate the double EMA, it returns a `NaN` value.
+- `doubleEMA()` inherits all [exponential moving average rules](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/#exponential-moving-average-rules).
+
+## Parameters
+
+### n
+The number of points to average.
+
+_**Data type:** Integer_
+
+## Examples
+
+#### Calculate a five point double exponential moving average
+```js
+from(bucket: "example-bucket"):
+ |> range(start: -12h)
+ |> doubleEMA(n: 5)
+```
+
+## Function definition
+```js
+doubleEMA = (n, tables=<-) =>
+ tables
+ |> exponentialMovingAverage(n:n)
+ |> duplicate(column:"_value", as:"ema")
+ |> exponentialMovingAverage(n:n)
+ |> map(fn: (r) => ({r with _value: 2.0 * r.ema - r._value}))
+ |> drop(columns: ["ema"])
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage.md
similarity index 53%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage.md
index da132b4ab..960768f25 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage.md
@@ -1,32 +1,33 @@
---
title: exponentialMovingAverage() function
description: >
- The `exponentialMovingAverage()` function calculates the exponential moving average
- of values grouped into `n` number of points, giving more weight to recent data.
+ The `exponentialMovingAverage()` function calculates the exponential moving average of values
+ in the `_value` column grouped into `n` number of points, giving more weight to recent data.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
menu:
v2_0_ref:
name: exponentialMovingAverage
parent: built-in-aggregates
weight: 501
related:
- - /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- - /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- - https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#exponential-moving-average, InfluxQL EXPONENTIAL_MOVING_AVERAGE()
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#exponential-moving-average, InfluxQL EXPONENTIAL_MOVING_AVERAGE()
---
-The `exponentialMovingAverage()` function calculates the exponential moving average
-of values grouped into `n` number of points, giving more weight to recent data.
+The `exponentialMovingAverage()` function calculates the exponential moving average of values
+in the `_value` column grouped into `n` number of points, giving more weight to recent data.
_**Function type:** Aggregate_
```js
-exponentialMovingAverage(
- n: 5,
- columns: ["_value"]
-)
+exponentialMovingAverage(n: 5)
```
-##### Exponential moving average rules:
+##### Exponential moving average rules
- The first value of an exponential moving average over `n` values is the
algebraic mean of `n` values.
- Subsequent values are calculated as `y(t) = x(t) * k + y(t-1) * (1 - k)`, where:
@@ -43,11 +44,6 @@ The number of points to average.
_**Data type:** Integer_
-### columns
-Columns to operate on. _Defaults to `["_value"]`_.
-
-_**Data type:** Array of Strings_
-
## Examples
#### Calculate a five point exponential moving average
@@ -60,23 +56,20 @@ from(bucket: "example-bucket"):
#### Table transformation with a two point exponential moving average
###### Input table:
-| _time | A | B | C | tag |
-|:-----:|:----:|:----:|:----:|:---:|
-| 0001 | 2 | null | 2 | tv |
-| 0002 | null | 10 | 4 | tv |
-| 0003 | 8 | 20 | 5 | tv |
+| _time | tag | _value |
+|:-----:|:---:|:------:|
+| 0001 | tv | null |
+| 0002 | tv | 10 |
+| 0003 | tv | 20 |
###### Query:
```js
// ...
- |> exponentialMovingAverage(
- n: 2,
- columns: ["A", "B", "C"]
- )
+ |> exponentialMovingAverage(n: 2)
```
###### Output table:
-| _time | A | B | C | tag |
-|:-----:|:----:|:----:|:----:|:---:|
-| 0002 | 2 | 10 | 3 | tv |
-| 0003 | 6 | 16.67| 4.33 | tv |
+| _time | tag | _value |
+|:-----:|:---:|:------:|
+| 0002 | tv | 10 |
+| 0003 | tv | 16.67 |
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/histogramquantile.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/histogramquantile.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/histogramquantile.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/histogramquantile.md
index 7b135a9d8..5cda2d839 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/histogramquantile.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/histogramquantile.md
@@ -5,6 +5,7 @@ description: >
that approximates the cumulative distribution of the dataset.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/histogramquantile
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/histogramquantile/
menu:
v2_0_ref:
name: histogramQuantile
@@ -75,7 +76,7 @@ _**Data type:** String_
The assumed minimum value of the dataset.
When the quantile falls below the lowest upper bound, interpolation is performed between `minValue` and the lowest upper bound.
When `minValue` is equal to negative infinity, the lowest upper bound is used.
-Defaults to `0`.
+Defaults to `0.0`.
_**Data type:** Float_
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/holtwinters.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/holtwinters.md
new file mode 100644
index 000000000..2fd9bc218
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/holtwinters.md
@@ -0,0 +1,115 @@
+---
+title: holtWinters() function
+description: >
+ The `holtWinters()` function applies the Holt-Winters forecasting method to input tables.
+aliases:
+ - /v2.0/reference/flux/functions/transformations/aggregates/holtwinters
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/holtwinters/
+menu:
+ v2_0_ref:
+ name: holtWinters
+ parent: built-in-aggregates
+weight: 501
+related:
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters, InfluxQL HOLT_WINTERS()
+---
+
+The `holtWinters()` function applies the Holt-Winters forecasting method to input tables.
+
+_**Function type:** Aggregate_
+_**Output data type:** Float_
+
+```js
+holtWinters(
+ n: 10,
+ seasonality: 4,
+ interval: 30d,
+ withFit: false,
+ timeColumn: "_time",
+ column: "_value",
+)
+```
+
+The Holt-Winters method predicts [`n`](#n) seasonally-adjusted values for the
+specified [`column`](#column) at the specified [`interval`](#interval).
+For example, if `interval` is `6m` and `n` is `3`, results include three predicted
+values six minutes apart.
+
+#### Seasonality
+[`seasonality`](#seasonality) delimits the length of a seasonal pattern according to `interval`.
+If your `interval` is `2m` and `seasonality` is `4`, then the seasonal pattern occurs every
+eight minutes or every four data points.
+If data doesn't have a seasonal pattern, set `seasonality` to `0`.
+
+#### Space values evenly in time
+`holtWinters()` expects values evenly spaced in time.
+To ensure `holtWinters()` values are spaced evenly in time, the following rules apply:
+
+- Data is grouped into time-based "buckets" determined by the `interval`.
+- If a bucket includes many values, the first value is used.
+- If a bucket includes no values, a missing value (`null`) is added for that bucket.
+
+By default, `holtWinters()` uses the first value in each time bucket to run the Holt-Winters calculation.
+To specify other values to use in the calculation, use:
+
+- [`window()`](/v2.0/reference/flux/stdlib/built-in/transformations/window/)
+ with [selectors](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/)
+ or [aggregates](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/)
+- [`aggregateWindow()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/aggregatewindow)
+
+#### Fitted model
+The `holtWinters()` function applies the [Nelder-Mead optimization](https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method)
+to include "fitted" data points in results when [`withFit`](#withfit) is set to `true`.
+
+#### Null timestamps
+`holtWinters()` discards rows with `null` timestamps before running the Holt-Winters calculation.
+
+#### Null values
+`holtWinters()` treats `null` values as missing data points and includes them in the Holt-Winters calculation.
+
+## Parameters
+
+### n
+The number of values to predict.
+
+_**Data type: Integer**_
+
+### seasonality
+The number of points in a season.
+Defaults to `0`.
+
+_**Data type: Integer**_
+
+### interval
+The interval between two data points.
+
+_**Data type: Duration**_
+
+### withFit
+Return [fitted data](#fitted-model) in results.
+Defaults to `false`.
+
+_**Data type: Boolean**_
+
+### timeColumn
+The time column to use.
+Defaults to `"_time"`.
+
+_**Data type: String**_
+
+### column
+The column to operate on.
+Defaults to `"_value"`.
+
+_**Data type: String**_
+
+## Examples
+
+##### Use aggregateWindow to prepare data for holtWinters
+```js
+from(bucket: "example-bucket")
+ |> range(start: -7y)
+ |> filter(fn: (r) => r._field == "water_level")
+ |> aggregateWindow(every: 379m, fn: first).
+ |> holtWinters(n: 10, seasonality: 4, interval: 379m)
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/increase.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md
similarity index 84%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/increase.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md
index b948fb865..7528cca0f 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/increase.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/increase.md
@@ -3,6 +3,7 @@ title: increase() function
description: The `increase()` function calculates the total non-negative difference between values in a table.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/increase
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/increase/
menu:
v2_0_ref:
name: increase
@@ -10,7 +11,8 @@ menu:
weight: 501
---
-The `increase()` function calculates the total non-negative difference between values in a table.
+The `increase()` function calculates the total non-negative difference between
+subsequent values.
A main use case is tracking changes in counter values which may wrap over time
when they hit a threshold or are reset.
In the case of a wrap/reset, we can assume that the absolute delta between two
@@ -20,16 +22,16 @@ _**Function type:** Aggregate_
_**Output data type:** Float_
```js
-increase(column: "_values")
+increase(columns: ["_value"])
```
## Parameters
-### column
-The column for which the increase is calculated.
-Defaults to `"_value"`.
+### columns
+The columns to use in the operation.
+Defaults to `["_value"]`.
-_**Data type:** Strings_
+_**Data type:** Array of strings_
## Examples
```js
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/integral.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/integral.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md
index 862b417d8..c3593844f 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/integral.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md
@@ -3,6 +3,7 @@ title: integral() function
description: The `integral()` function computes the area under the curve per unit of time of subsequent non-null records.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/integral
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/integral/
menu:
v2_0_ref:
name: integral
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmansama.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmansama.md
new file mode 100644
index 000000000..dfa323057
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmansama.md
@@ -0,0 +1,54 @@
+---
+title: kaufmansAMA() function
+description: >
+ The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)
+ using values in an input table.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmansama/
+menu:
+ v2_0_ref:
+ name: kaufmansAMA
+ parent: built-in-aggregates
+weight: 501
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmanser/
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#kaufmans-adaptive-moving-average, InfluxQL KAUFMANS_ADAPTIVE_MOVING_AVERAGE()
+---
+
+The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)
+using values in an input table.
+
+_**Function type:** Aggregate_
+
+```js
+kaufmansAMA(
+ n: 10,
+ column: "_value"
+)
+```
+
+Kaufman's Adaptive Moving Average is a trend-following indicator designed to account
+for market noise or volatility.
+
+## Parameters
+
+### n
+The period or number of points to use in the calculation.
+
+_**Data type: Integer**_
+
+### column
+The column to operate on.
+Defaults to `"_value"`.
+
+_**Data type: String**_
+
+## Examples
+```js
+from(bucket: "telegraf/autogen"):
+ |> range(start: -7d)
+ |> kaufmansAMA(
+ n: 10,
+ column: "_value"
+ )
+```
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmanser.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmanser.md
new file mode 100644
index 000000000..cca6731c7
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmanser.md
@@ -0,0 +1,44 @@
+---
+title: kaufmansER() function
+description: >
+ The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using
+ values in an input table.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmanser/
+menu:
+ v2_0_ref:
+ name: kaufmansER
+ parent: built-in-aggregates
+weight: 501
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/kaufmansama/
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#kaufmans-efficiency-ratio, InfluxQL KAUFMANS_EFFICIENCY_RATIO()
+---
+
+The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using
+values in an input table.
+The function operates on the `_value` column.
+
+_**Function type:** Aggregate_
+
+```js
+kaufmansER(n: 10)
+```
+
+Kaufman's Efficiency Ratio indicator divides the absolute value of the
+Chande Momentum Oscillator by 100 to return a value between 0 and 1.
+Higher values represent a more efficient or trending market.
+
+## Parameters
+
+### n
+The period or number of points to use in the calculation.
+
+_**Data type: Integer**_
+
+## Examples
+```js
+from(bucket: "example-bucket")
+ |> range(start: -7d)
+ |> kaufmansER(n: 10)
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean.md
index 5f0cc4366..6065bdadc 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean.md
@@ -3,6 +3,7 @@ title: mean() function
description: The `mean()` function computes the mean or average of non-null records in the input table.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/mean
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/mean/
menu:
v2_0_ref:
name: mean
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/median.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/median.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median.md
index eff12a6f7..271ca394f 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/median.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median.md
@@ -5,6 +5,7 @@ description: >
in the input table with values that fall within the `0.5` quantile or 50th percentile.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/median
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/median/
menu:
v2_0_ref:
name: median
@@ -12,7 +13,7 @@ menu:
weight: 501
---
-The `median()` function is a special application of the [`quantile()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile)
+The `median()` function is a special application of the [`quantile()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile)
that returns the median `_value` of an input table or all non-null records in the input table
with values that fall within the `0.5` quantile (50th percentile) depending on the [method](#method) used.
@@ -36,9 +37,9 @@ value that represents the `0.5` quantile.
{{% note %}}
The `median()` function can only be used with float value types.
-It is a special application of the [`quantile()` function](/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile)
+It is a special application of the [`quantile()` function](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile)
which uses an approximation implementation that requires floats.
-You can convert your value column to a float column using the [`toFloat()` function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tofloat).
+You can convert your value column to a float column using the [`toFloat()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tofloat).
{{% /note %}}
## Parameters
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/mode.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mode.md
similarity index 83%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/mode.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mode.md
index ef3916c57..8afdee34e 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/mode.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mode.md
@@ -3,6 +3,8 @@ title: mode() function
description: >
The `mode()` function computes the mode or value that occurs most often in a
specified column in the input table.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/mode/
menu:
v2_0_ref:
name: mode
@@ -19,7 +21,8 @@ _**Function type:** Aggregate_
mode(column: "_value")
```
-Multiple modes are returned in a sorted table.
+If there are multiple modes, it returns all of them in a sorted table.
+Mode only considers non-null values.
If there is no mode, `mode()` returns `null`.
##### Supported data types
@@ -56,4 +59,4 @@ from(bucket: "example-bucket")
##### Related InfluxQL functions and statements:
-[MODE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#mode)
+[MODE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#mode)
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage.md
similarity index 50%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage.md
index ee4687b40..7daeee63c 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage.md
@@ -2,29 +2,31 @@
title: movingAverage() function
description: >
The `movingAverage()` function calculates the mean of values grouped into `n` number of points.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
menu:
v2_0_ref:
name: movingAverage
parent: built-in-aggregates
weight: 501
related:
- - /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
- - /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#moving-average, InfluxQL MOVING_AVERAGE()
---
-The `movingAverage()` function calculates the mean of values grouped into `n` number of points.
+The `movingAverage()` function calculates the mean of values in the `_values` column
+grouped into `n` number of points.
_**Function type:** Aggregate_
```js
-movingAverage(
- n: 5,
- columns: ["_value"]
-)
+movingAverage(n: 5)
```
-##### Moving average rules:
+##### Moving average rules
- The average over a period populated by `n` values is equal to their algebraic mean.
- The average over a period populated by only `null` values is `null`.
- Moving averages skip `null` values.
@@ -38,11 +40,6 @@ The number of points to average.
_**Data type:** Integer_
-### columns
-Columns to operate on. _Defaults to `["_value"]`_.
-
-_**Data type:** Array of Strings_
-
## Examples
#### Calculate a five point moving average
@@ -52,36 +49,23 @@ from(bucket: "example-bucket"):
|> movingAverage(n: 5)
```
-#### Calculate a ten point moving average
-```js
-movingAverage = (every, period, column="_value", tables=<-) =>
- tables
- |> window(every: every, period: period)
- |> mean(column: column)
- |> duplicate(column: "_stop", as: "_time")
- |> window(every: inf)
-```
-
#### Table transformation with a two point moving average
###### Input table:
-| _time | A | B | C | D | tag |
-|:-----:|:----:|:----:|:----:|:----:|:---:|
-| 0001 | null | 1 | 2 | null | tv |
-| 0002 | 6 | 2 | null | null | tv |
-| 0003 | 4 | null | 4 | 4 | tv |
+| _time | tag | _value |
+|:-----:|:---:|:------:|
+| 0001 | tv | null |
+| 0002 | tv | 6 |
+| 0003 | tv | 4 |
###### Query:
```js
// ...
- |> movingAverage(
- n: 2,
- columns: ["A", "B", "C", "D"]
- )
+ |> movingAverage(n: 2 )
```
###### Output table:
-| _time | A | B | C | D | tag |
-|:-----:|:----:|:----:|:----:|:----:|:---:|
-| 0002 | 6 | 1.5 | 2 | null | tv |
-| 0003 | 5 | 2 | 4 | 4 | tv |
+| _time | tag | _value |
+|:-----:|:---:|:------:|
+| 0002 | tv | 6 |
+| 0003 | tv | 5 |
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/pearsonr.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/pearsonr.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/pearsonr.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/pearsonr.md
index 8aaa439fe..f5e4bc776 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/pearsonr.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/pearsonr.md
@@ -3,6 +3,7 @@ title: pearsonr() function
description: The `pearsonr()` function computes the Pearson R correlation coefficient between two streams by first joining the streams, then performing the covariance operation normalized to compute R.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/pearsonr
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/pearsonr/
menu:
v2_0_ref:
name: pearsonr
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile.md
index c9c41436e..483455487 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile.md
@@ -4,6 +4,7 @@ description: The `quantile()` function outputs non-null records with values that
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/percentile
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/percentile
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile/
menu:
v2_0_ref:
name: quantile
@@ -66,7 +67,7 @@ A selector method that returns the data point for which at least `q` points are
### compression
Indicates how many centroids to use when compressing the dataset.
A larger number produces a more accurate result at the cost of increased memory requirements.
-Defaults to 1000.
+Defaults to `1000.0`.
_**Data type:** Float_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce.md
index 23ad32e82..72f453a62 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/reduce.md
@@ -3,11 +3,14 @@ title: reduce() function
description: >
The `reduce()` function aggregates records in each table according to the reducer,
`fn`, providing a way to create custom table aggregations.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/reduce/
menu:
v2_0_ref:
name: reduce
parent: built-in-aggregates
weight: 501
+v2.0/tags: [exists]
---
The `reduce()` function aggregates records in each table according to the reducer,
@@ -94,7 +97,7 @@ creates a new column if it doesn't exist, and includes all existing columns in
the output table.
```js
-recduce(fn: (r) => ({ r with newColumn: r._value * 2 }))
+reduce(fn: (r) => ({ r with newColumn: r._value * 2 }))
```
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/relativestrengthindex.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/relativestrengthindex.md
new file mode 100644
index 000000000..58a8cb856
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/relativestrengthindex.md
@@ -0,0 +1,105 @@
+---
+title: relativeStrengthIndex() function
+description: >
+ The `relativeStrengthIndex()` function measures the relative speed and change of
+ values in an input table.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/relativestrengthindex/
+menu:
+ v2_0_ref:
+ name: relativeStrengthIndex
+ parent: built-in-aggregates
+weight: 501
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#relative-strength-index, InfluxQL RELATIVE_STRENGTH_INDEX()
+---
+
+The `relativeStrengthIndex()` function measures the relative speed and change of
+values in an input table.
+
+_**Function type:** Aggregate_
+
+```js
+relativeStrengthIndex(
+ n: 5,
+ columns: ["_value"]
+)
+```
+
+##### Relative strength index rules
+- The general equation for calculating a relative strength index (RSI) is
+ `RSI = 100 - (100 / (1 + (AVG GAIN / AVG LOSS)))`.
+- For the first value of the RSI, `AVG GAIN` and `AVG LOSS` are averages of the `n` period.
+- For subsequent calculations:
+ - `AVG GAIN` = `((PREVIOUS AVG GAIN) * (n - 1)) / n`
+ - `AVG LOSS` = `((PREVIOUS AVG LOSS) * (n - 1)) / n`
+- `relativeStrengthIndex()` ignores `null` values.
+
+## Parameters
+
+### n
+The number of values to use to calculate the RSI.
+
+_**Data type:** Integer_
+
+### columns
+Columns to operate on. _Defaults to `["_value"]`_.
+
+_**Data type:** Array of Strings_
+
+## Examples
+
+#### Calculate a five point relative strength index
+```js
+from(bucket: "example-bucket"):
+ |> range(start: -12h)
+ |> relativeStrengthIndex(n: 5)
+```
+
+#### Table transformation with a ten point RSI
+
+###### Input table:
+| _time | A | B | tag |
+|:-----:|:----:|:----:|:---:|
+| 0001 | 1 | 1 | tv |
+| 0002 | 2 | 2 | tv |
+| 0003 | 3 | 3 | tv |
+| 0004 | 4 | 4 | tv |
+| 0005 | 5 | 5 | tv |
+| 0006 | 6 | 6 | tv |
+| 0007 | 7 | 7 | tv |
+| 0008 | 8 | 8 | tv |
+| 0009 | 9 | 9 | tv |
+| 0010 | 10 | 10 | tv |
+| 0011 | 11 | 11 | tv |
+| 0012 | 12 | 12 | tv |
+| 0013 | 13 | 13 | tv |
+| 0014 | 14 | 14 | tv |
+| 0015 | 15 | 15 | tv |
+| 0016 | 16 | 16 | tv |
+| 0017 | 17 | null | tv |
+| 0018 | 18 | 17 | tv |
+
+###### Query:
+```js
+// ...
+ |> relativeStrengthIndex(
+ n: 10,
+ columns: ["A", "B"]
+ )
+```
+
+###### Output table:
+| _time | A | B | tag |
+|:-----:|:----:|:----:|:---:|
+| 0011 | 100 | 100 | tv |
+| 0012 | 100 | 100 | tv |
+| 0013 | 100 | 100 | tv |
+| 0014 | 100 | 100 | tv |
+| 0015 | 100 | 100 | tv |
+| 0016 | 90 | 90 | tv |
+| 0017 | 81 | 90 | tv |
+| 0018 | 72.9 | 81 | tv |
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/skew.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/skew.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/skew.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/skew.md
index 529fe62b2..04e223c8c 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/skew.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/skew.md
@@ -3,6 +3,7 @@ title: skew() function
description: The `skew()` function outputs the skew of non-null records as a float.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/skew
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/skew/
menu:
v2_0_ref:
name: skew
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/spread.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/spread.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/spread.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/spread.md
index 38a8abbaa..b0ca55f65 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/spread.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/spread.md
@@ -3,6 +3,7 @@ title: spread() function
description: The `spread()` function outputs the difference between the minimum and maximum values in a specified column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/spread
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/spread/
menu:
v2_0_ref:
name: spread
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/stddev.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/stddev.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/stddev.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/stddev.md
index 66889cd76..027bb214f 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/stddev.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/stddev.md
@@ -3,6 +3,7 @@ title: stddev() function
description: The `stddev()` function computes the standard deviation of non-null records in a specified column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/stddev
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/stddev/
menu:
v2_0_ref:
name: stddev
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/sum.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/sum.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/sum.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/sum.md
index e78449591..15b614462 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/sum.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/sum.md
@@ -3,6 +3,7 @@ title: sum() function
description: The `sum()` function computes the sum of non-null records in a specified column.
aliases:
- /v2.0/reference/flux/functions/transformations/aggregates/sum
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/sum/
menu:
v2_0_ref:
name: sum
@@ -41,4 +42,4 @@ from(bucket: "example-bucket")
##### Related InfluxQL functions and statements:
-[SUM()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sum)
+[SUM()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sum)
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage.md
similarity index 83%
rename from content/v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage.md
index 8aa33b397..2d1b0be01 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage.md
@@ -3,14 +3,18 @@ title: timedMovingAverage() function
description: >
The `timedMovingAverage()` function calculates the mean of values in a defined time
range at a specified frequency.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
menu:
v2_0_ref:
name: timedMovingAverage
parent: built-in-aggregates
weight: 501
related:
- - /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
- - /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
- https://docs.influxdata.com/influxdb/latest/query_language/functions/#moving-average, InfluxQL MOVING_AVERAGE()
---
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema.md
new file mode 100644
index 000000000..140882c33
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema.md
@@ -0,0 +1,70 @@
+---
+title: tripleEMA() function
+description: >
+ The `tripleEMA()` function calculates the exponential moving average of values
+ grouped into `n` number of points, giving more weight to recent data with less lag
+ than `exponentialMovingAverage()` and `doubleEMA()`.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
+menu:
+ v2_0_ref:
+ name: tripleEMA
+ parent: built-in-aggregates
+weight: 501
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#triple-exponential-moving-average, InfluxQL TRIPLE_EXPONENTIAL_MOVING_AVERAGE()
+---
+
+The `tripleEMA()` function calculates the exponential moving average of values in
+the `_value` column grouped into `n` number of points, giving more weight to recent
+data with less lag than
+[`exponentialMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/)
+and [`doubleEMA()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/).
+
+_**Function type:** Aggregate_
+
+```js
+tripleEMA(n: 5)
+```
+
+##### Triple exponential moving average rules
+- A triple exponential moving average is defined as `tripleEMA = (3 * EMA_1) - (3 * EMA_2) + EMA_3`.
+ - `EMA_1` is the exponential moving average of the original data.
+ - `EMA_2` is the exponential moving average of `EMA_1`.
+ - `EMA_3` is the exponential moving average of `EMA_2`.
+- A true triple exponential moving average requires at least requires at least `3 * n - 2` values.
+ If not enough values exist to calculate the triple EMA, it returns a `NaN` value.
+- `tripleEMA()` inherits all [exponential moving average rules](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/#exponential-moving-average-rules).
+
+## Parameters
+
+### n
+The number of points to average.
+
+_**Data type:** Integer_
+
+## Examples
+
+#### Calculate a five point triple exponential moving average
+```js
+from(bucket: "example-bucket"):
+ |> range(start: -12h)
+ |> tripleEMA(n: 5)
+```
+
+## Function definition
+```js
+tripleEMA = (n, tables=<-) =>
+ tables
+ |> exponentialMovingAverage(n:n)
+ |> duplicate(column:"_value", as:"ema1")
+ |> exponentialMovingAverage(n:n)
+ |> duplicate(column:"_value", as:"ema2")
+ |> exponentialMovingAverage(n:n)
+ |> map(fn: (r) => ({r with _value: 3.0 * r.ema1 - 3.0 * r.ema2 + r._value}))
+ |> drop(columns: ["ema1", "ema2"])
+```
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleexponentialderivative.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleexponentialderivative.md
new file mode 100644
index 000000000..9d6aee924
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleexponentialderivative.md
@@ -0,0 +1,69 @@
+---
+title: tripleExponentialDerivative() function
+description: >
+ The `tripleExponentialDerivative()` function calculates a triple exponential
+ derivative (TRIX) of input tables using `n` points.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleexponentialderivative/
+menu:
+ v2_0_ref:
+ name: tripleExponentialDerivative
+ parent: built-in-aggregates
+weight: 501
+v2.0/tags: [technical analysis]
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/movingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/doubleema/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/tripleema/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timedmovingaverage/
+ - /v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/
+ - https://docs.influxdata.com/influxdb/latest/query_language/functions/#triple-exponential-derivative, InfluxQL TRIPLE_EXPONENTIAL_DERIVATIVE()
+---
+
+The `tripleExponentialDerivative()` function calculates a triple exponential
+derivative ([TRIX](https://en.wikipedia.org/wiki/Trix_(technical_analysis))) of
+input tables using `n` points.
+
+_**Function type:** Aggregate_
+
+```js
+tripleExponentialDerivative(n: 5)
+```
+
+Triple exponential derivative, commonly referred to as “TRIX,” is a momentum indicator and oscillator.
+A triple exponential derivative uses the natural logarithm (log) of input data to
+calculate a triple exponential moving average over the period of time.
+The calculation prevents cycles shorter than the defined period from being considered by the indicator.
+`tripleExponentialDerivative()` uses the time between `n` points to define the period.
+
+Triple exponential derivative oscillates around a zero line.
+A positive momentum **oscillator** value indicates an overbought market;
+a negative value indicates an oversold market.
+A positive momentum **indicator** value indicates increasing momentum;
+a negative value indicates decreasing momentum.
+
+##### Triple exponential moving average rules
+- A triple exponential derivative is defined as:
+ - `TRIX[i] = ((EMA3[i] / EMA3[i - 1]) - 1) * 100`:
+ - `EMA_3 = EMA(EMA(EMA(data)))`
+- If there are not enough values to calculate a triple exponential derivative,
+ the output `_value` is `NaN`; all other columns are the same as the _last_ record of the input table.
+- The function behaves the same way as the [`exponentialMovingAverage()`](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/exponentialmovingaverage/) function:
+ - The function does not include `null` values in the calculation.
+ - The function acts only on the `_value` column.
+
+## Parameters
+
+### n
+The number of points to use in the calculation.
+
+_**Data type:** Integer_
+
+## Examples
+
+#### Calculate a five point triple exponential derivative
+```js
+from(bucket: "example-bucket"):
+ |> range(start: -12h)
+ |> tripleExponentialDerivative(n: 5)
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/columns.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/columns.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/columns.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/columns.md
index e76f5bdc6..2703ce387 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/columns.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/columns.md
@@ -6,6 +6,7 @@ description: >
plus a new column containing the labels of the input table's columns.
aliases:
- /v2.0/reference/flux/functions/transformations/columns
+ - /v2.0/reference/flux/functions/built-in/transformations/columns/
menu:
v2_0_ref:
name: columns
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/cumulativesum.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/transformations/cumulativesum.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum.md
index c63d5f054..72d4087e6 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/cumulativesum.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/cumulativesum.md
@@ -3,6 +3,7 @@ title: cumulativeSum() function
description: The `cumulativeSum()` function computes a running sum for non-null records in the table.
aliases:
- /v2.0/reference/flux/functions/transformations/cumulativesum
+ - /v2.0/reference/flux/functions/built-in/transformations/cumulativesum/
menu:
v2_0_ref:
name: cumulativeSum
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/drop.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/drop.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/drop.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/drop.md
index cfef40929..2c2f70133 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/drop.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/drop.md
@@ -3,6 +3,7 @@ title: drop() function
description: The `drop()` function removes specified columns from a table.
aliases:
- /v2.0/reference/flux/functions/transformations/drop
+ - /v2.0/reference/flux/functions/built-in/transformations/drop/
menu:
v2_0_ref:
name: drop
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/duplicate.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/duplicate.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/transformations/duplicate.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/duplicate.md
index 54a90f9b2..cbc060dc0 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/duplicate.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/duplicate.md
@@ -3,6 +3,7 @@ title: duplicate() function
description: The `duplicate()` function duplicates a specified column in a table.
aliases:
- /v2.0/reference/flux/functions/transformations/duplicate
+ - /v2.0/reference/flux/functions/built-in/transformations/duplicate/
menu:
v2_0_ref:
name: duplicate
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/elapsed.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/elapsed.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/transformations/elapsed.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/elapsed.md
index 0c410b1f0..b297476c2 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/elapsed.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/elapsed.md
@@ -1,6 +1,8 @@
---
title: elapsed() function
description: The `elapsed()` function returns the time between subsequent records.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/elapsed/
menu:
v2_0_ref:
name: elapsed
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/fill.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/fill.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/fill.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/fill.md
index ff534a98d..9cd01d630 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/fill.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/fill.md
@@ -3,6 +3,7 @@ title: fill() function
description: The `fill()` function replaces all null values in an input stream and replace them with a non-null value.
aliases:
- /v2.0/reference/flux/functions/transformations/fill
+ - /v2.0/reference/flux/functions/built-in/transformations/fill/
menu:
v2_0_ref:
name: fill
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/filter.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/filter.md
similarity index 78%
rename from content/v2.0/reference/flux/functions/built-in/transformations/filter.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/filter.md
index 76c82962b..7dec4df8c 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/filter.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/filter.md
@@ -3,11 +3,13 @@ title: filter() function
description: The `filter()` function filters data based on conditions defined in a predicate function (fn).
aliases:
- /v2.0/reference/flux/functions/transformations/filter
+ - /v2.0/reference/flux/functions/built-in/transformations/filter/
menu:
v2_0_ref:
name: filter
parent: built-in-transformations
weight: 401
+v2.0/tags: [exists]
---
The `filter()` function filters data based on conditions defined in a predicate function ([`fn`](#fn)).
@@ -41,6 +43,7 @@ Objects evaluated in `fn` functions are represented by `r`, short for "record" o
## Examples
+##### Filter based on measurement, field, and tag
```js
from(bucket:"example-bucket")
|> range(start:-1h)
@@ -51,6 +54,20 @@ from(bucket:"example-bucket")
)
```
+##### Filter out null values
+```js
+from(bucket:"example-bucket")
+ |> range(start:-1h)
+ |> filter(fn: (r) => exists r._value )
+```
+
+##### Filter values based on thresholds
+```js
+from(bucket:"example-bucket")
+ |> range(start:-1h)
+ |> filter(fn: (r) => r._value > 50.0 and r._value < 65.0 )
+```
+
##### Related InfluxQL functions and statements:
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/group.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/group.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/group.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/group.md
index 17412ee6c..f968ed990 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/group.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/group.md
@@ -3,6 +3,7 @@ title: group() function
description: The `group()` function groups records based on their values for specific columns.
aliases:
- /v2.0/reference/flux/functions/transformations/group
+ - /v2.0/reference/flux/functions/built-in/transformations/group/
menu:
v2_0_ref:
name: group
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/histogram.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/histogram.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/built-in/transformations/histogram.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/histogram.md
index 669f9f222..a4e04bb96 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/histogram.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/histogram.md
@@ -3,6 +3,7 @@ title: histogram() function
description: The `histogram()` function approximates the cumulative distribution of a dataset by counting data frequencies for a list of bins.
aliases:
- /v2.0/reference/flux/functions/transformations/histogram
+ - /v2.0/reference/flux/functions/built-in/transformations/histogram/
menu:
v2_0_ref:
name: histogram
@@ -56,8 +57,8 @@ _**Data type:** Array of floats_
#### Bin helper functions
The following helper functions can be used to generated bins.
-[linearBins()](/v2.0/reference/flux/functions/built-in/misc/linearbins)
-[logarithmicBins()](/v2.0/reference/flux/functions/built-in/misc/logarithmicbins)
+[linearBins()](/v2.0/reference/flux/stdlib/built-in/misc/linearbins)
+[logarithmicBins()](/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins)
### normalize
When `true`, will convert the counts into frequency values between 0 and 1.
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/hourselection.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/hourselection.md
new file mode 100644
index 000000000..b56ad99f5
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/hourselection.md
@@ -0,0 +1,56 @@
+---
+title: hourSelection() function
+description: >
+ The `hourSelection()` function retains all rows with time values in a specified hour range.
+ Hours are specified in military time.
+aliases:
+ - /v2.0/reference/flux/functions/transformations/hourselection
+ - /v2.0/reference/flux/functions/built-in/transformations/hourselection/
+menu:
+ v2_0_ref:
+ name: hourSelection
+ parent: built-in-transformations
+weight: 401
+---
+
+The `hourSelection()` function retains all rows with time values in a specified hour range.
+
+_**Function type:** Transformation_
+
+```js
+hourSelection(
+ start: 9,
+ stop: 17,
+ timeColumn: "_time"
+)
+```
+
+## Parameters
+
+### start
+The first hour of the hour range (inclusive).
+Hours range from `[0-23]`.
+
+_**Data type:** Integer_
+
+### stop
+The last hour of the hour range (inclusive).
+Hours range from `[0-23]`.
+
+_**Data type:** Integer_
+
+### timeColumn
+The column that contains the time value.
+Default is `"_time"`.
+
+_**Data type:** String_
+
+## Examples
+
+##### Use only data from 9am to 5pm
+```js
+from(bucket:"example-bucket")
+ |> range(start:-90d)
+ |> filter(fn: (r) => r._measurement == "foot-traffic" )
+ |> hourSelection(start: 9, stop: 17)
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/join.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/join.md
similarity index 97%
rename from content/v2.0/reference/flux/functions/built-in/transformations/join.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/join.md
index 2a8f2d8dd..677fe845d 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/join.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/join.md
@@ -3,6 +3,7 @@ title: join() function
description: The `join()` function merges two or more input streams whose values are equal on a set of common columns into a single output stream.
aliases:
- /v2.0/reference/flux/functions/transformations/join
+ - /v2.0/reference/flux/functions/built-in/transformations/join/
menu:
v2_0_ref:
name: join
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/keep.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/keep.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/built-in/transformations/keep.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/keep.md
index e1ec0b872..6c4f0dada 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/keep.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/keep.md
@@ -3,6 +3,7 @@ title: keep() function
description: The `keep()` function returns a table containing only the specified columns.
aliases:
- /v2.0/reference/flux/functions/transformations/keep
+ - /v2.0/reference/flux/functions/built-in/transformations/keep/
menu:
v2_0_ref:
name: keep
@@ -12,7 +13,7 @@ weight: 401
The `keep()` function returns a table containing only the specified columns, ignoring all others.
Only columns in the group key that are also specified in the `keep()` function will be kept in the resulting group key.
-_It is the inverse of [`drop`](/v2.0/reference/flux/functions/built-in/transformations/drop)._
+_It is the inverse of [`drop`](/v2.0/reference/flux/stdlib/built-in/transformations/drop)._
_**Function type:** Transformation_
_**Output data type:** Object_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/keys.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/keys.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/keys.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/keys.md
index e4ecd1b4d..5f82e10b3 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/keys.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/keys.md
@@ -6,6 +6,7 @@ description: >
_value column containing the labels of the input table's group key.
aliases:
- /v2.0/reference/flux/functions/transformations/keys
+ - /v2.0/reference/flux/functions/built-in/transformations/keys/
menu:
v2_0_ref:
name: keys
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/keyvalues.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/keyvalues.md
similarity index 97%
rename from content/v2.0/reference/flux/functions/built-in/transformations/keyvalues.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/keyvalues.md
index cd6b6d5f7..3db7044bc 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/keyvalues.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/keyvalues.md
@@ -3,6 +3,7 @@ title: keyValues() function
description: The `keyValues()` function returns a table with the input table's group key plus two columns, _key and _value, that correspond to unique column + value pairs from the input table.
aliases:
- /v2.0/reference/flux/functions/transformations/keyvalues
+ - /v2.0/reference/flux/functions/built-in/transformations/keyvalues/
menu:
v2_0_ref:
name: keyValues
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/limit.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/limit.md
new file mode 100644
index 000000000..dd7915862
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/limit.md
@@ -0,0 +1,51 @@
+---
+title: limit() function
+description: The `limit()` function limits each output table to the first `n` records.
+aliases:
+ - /v2.0/reference/flux/functions/transformations/limit
+ - /v2.0/reference/flux/functions/built-in/transformations/limit/
+menu:
+ v2_0_ref:
+ name: limit
+ parent: built-in-transformations
+weight: 401
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/tail/
+ - https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-limit-and-slimit-clauses, InfluxQL LIMIT
+---
+
+The `limit()` function limits each output table to the first [`n`](#n) records.
+The function produces one output table for each input table.
+Each output table contains the first `n` records after the [`offset`](#offset).
+If the input table has less than `offset + n` records, `limit()` outputs all records after the `offset`.
+
+_**Function type:** Filter_
+
+```js
+limit(
+ n:10,
+ offset: 0
+)
+```
+
+## Parameters
+
+### n
+The maximum number of records to output.
+
+_**Data type:** Integer_
+
+### offset
+The number of records to skip per table before limiting to `n`.
+Defaults to `0`.
+
+_**Data type:** Integer_
+
+## Examples
+
+##### Output the first ten records in each table
+```js
+from(bucket:"example-bucket")
+ |> range(start:-1h)
+ |> limit(n:10)
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/map.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/map.md
similarity index 95%
rename from content/v2.0/reference/flux/functions/built-in/transformations/map.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/map.md
index b6c134a5c..b5327c361 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/map.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/map.md
@@ -3,11 +3,13 @@ title: map() function
description: The `map()` function applies a function to each record in the input tables.
aliases:
- /v2.0/reference/flux/functions/transformations/map
+ - /v2.0/reference/flux/functions/built-in/transformations/map/
menu:
v2_0_ref:
name: map
parent: built-in-transformations
weight: 401
+v2.0/tags: [exists]
---
The `map()` function applies a function to each record in the input tables.
@@ -73,7 +75,7 @@ from(bucket:"example-bucket")
r.cpu == "cpu-total"
)
|> range(start:-12h)
- |> map(fn: (r) => r._value * r._value)
+ |> map(fn: (r) => ({ r with _value: r._value * r._value}))
```
###### Create a new table with new format
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/pivot.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/pivot.md
similarity index 99%
rename from content/v2.0/reference/flux/functions/built-in/transformations/pivot.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/pivot.md
index 1066d1e11..db5538ce3 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/pivot.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/pivot.md
@@ -3,6 +3,7 @@ title: pivot() function
description: The `pivot()` function collects values stored vertically (column-wise) in a table and aligns them horizontally (row-wise) into logical sets.
aliases:
- /v2.0/reference/flux/functions/transformations/pivot
+ - /v2.0/reference/flux/functions/built-in/transformations/pivot/
menu:
v2_0_ref:
name: pivot
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/range.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/range.md
similarity index 67%
rename from content/v2.0/reference/flux/functions/built-in/transformations/range.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/range.md
index bb7a142b4..379d6e8ac 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/range.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/range.md
@@ -3,6 +3,7 @@ title: range() function
description: The `range()` function filters records based on time bounds.
aliases:
- /v2.0/reference/flux/functions/transformations/range
+ - /v2.0/reference/flux/functions/built-in/transformations/range/
menu:
v2_0_ref:
name: range
@@ -26,26 +27,24 @@ range(start: -15m, stop: now())
## Parameters
### start
-Specifies the oldest time to be included in the results.
+The earliest time to include in results.
+Use a relative duration or absolute time.
+For example, `-1h` or `2019-08-28T22:00:00Z`.
+Durations are relative to `now()`.
-Relative start times are defined using negative durations.
-Negative durations are relative to now.
-Absolute start times are defined using timestamps.
-
-_**Data type:** Duration or Timestamp_
+_**Data type:** Duration | Time_
### stop
-Specifies the newest time to be included in the results. Defaults to `now`.
+The latest time to include in results.
+Use a relative duration or absolute time.
+For example, `-1h` or `2019-08-28T22:00:00Z`.
+Durations are relative to `now()`.
+Defaults to `now()`.
-Relative stop times are defined using negative durations.
-Negative durations are relative to now.
-Absolute stop times are defined using timestamps.
-
-_**Data type:** Duration or Timestamp_
+_**Data type:** Duration | Time_
{{% note %}}
-Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format)
-and ignores dates and times provided in other formats.
+Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
{{% /note %}}
## Examples
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/rename.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/rename.md
similarity index 95%
rename from content/v2.0/reference/flux/functions/built-in/transformations/rename.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/rename.md
index 55c22ee0b..57e3c504f 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/rename.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/rename.md
@@ -3,6 +3,7 @@ title: rename() function
description: The `rename()` function renames specified columns in a table.
aliases:
- /v2.0/reference/flux/functions/transformations/rename
+ - /v2.0/reference/flux/functions/built-in/transformations/rename/
menu:
v2_0_ref:
name: rename
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/_index.md
similarity index 78%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/_index.md
index cf67e6d44..62cbf6955 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/_index.md
@@ -4,6 +4,7 @@ list_title: Built-in selector functions
description: Flux's built-in selector functions return one or more records based on function logic.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/
menu:
v2_0_ref:
parent: built-in-transformations
@@ -25,5 +26,5 @@ The following selector functions are available:
The following functions can be used as both selectors or aggregates, but they are
categorized as aggregate functions in this documentation:
-- [median](/v2.0/reference/flux/functions/built-in/transformations/aggregates/median)
-- [quantile](/v2.0/reference/flux/functions/built-in/transformations/aggregates/quantile)
+- [median](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/median)
+- [quantile](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/quantile)
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/bottom.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/bottom.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom.md
index 0e82501ab..cb50c166e 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/bottom.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/bottom.md
@@ -3,6 +3,7 @@ title: bottom() function
description: The `bottom()` function sorts a table by columns and keeps only the bottom n records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/bottom
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/bottom/
menu:
v2_0_ref:
name: bottom
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/distinct.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/distinct.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct.md
index 945db3889..a999c3dca 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/distinct.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct.md
@@ -3,6 +3,7 @@ title: distinct() function
description: The `distinct()` function returns the unique values for a given column.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/distinct
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/distinct/
menu:
v2_0_ref:
name: distinct
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/first.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/first.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first.md
index 5767015ca..b2d80c8fd 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/first.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/first.md
@@ -3,6 +3,7 @@ title: first() function
description: The `first()` function selects the first non-null record from an input table.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/first
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/first/
menu:
v2_0_ref:
name: first
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestaverage.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestaverage.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestaverage.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestaverage.md
index 054271bdd..7cf9d502c 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestaverage.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestaverage.md
@@ -3,6 +3,7 @@ title: highestAverage() function
description: The `highestAverage()` function calculates the average of each table in the input stream returns the top `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/highestaverage
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/highestaverage/
menu:
v2_0_ref:
name: highestAverage
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestcurrent.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestcurrent.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestcurrent.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestcurrent.md
index 3a59ce712..ca0a922b0 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestcurrent.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestcurrent.md
@@ -3,6 +3,7 @@ title: highestCurrent() function
description: The `highestCurrent()` function selects the last record of each table in the input stream and returns the top `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/highestcurrent
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/highestcurrent/
menu:
v2_0_ref:
name: highestCurrent
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestmax.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestmax.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestmax.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestmax.md
index 40dd14f26..e9268edcf 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/highestmax.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/highestmax.md
@@ -3,6 +3,7 @@ title: highestMax() function
description: The `highestMax()` function selects the maximum record from each table in the input stream and returns the top `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/highestmax
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/highestmax/
menu:
v2_0_ref:
name: highestMax
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/last.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/last.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last.md
index 83d7c3e96..52a11a4aa 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/last.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/last.md
@@ -3,6 +3,7 @@ title: last() function
description: The `last()` function selects the last non-null record from an input table.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/last
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/last/
menu:
v2_0_ref:
name: last
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestaverage.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestaverage.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestaverage.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestaverage.md
index 9020333d3..d1ea9fe7c 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestaverage.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestaverage.md
@@ -3,6 +3,7 @@ title: lowestAverage() function
description: The `lowestAverage()` function calculates the average of each table in the input stream returns the lowest `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/lowestaverage
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/lowestaverage/
menu:
v2_0_ref:
name: lowestAverage
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestcurrent.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestcurrent.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestcurrent.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestcurrent.md
index 0b2855df5..eab20a443 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestcurrent.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestcurrent.md
@@ -3,6 +3,7 @@ title: lowestCurrent() function
description: The `lowestCurrent()` function selects the last record of each table in the input stream and returns the lowest `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/lowestcurrent
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/lowestcurrent/
menu:
v2_0_ref:
name: lowestCurrent
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestmin.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestmin.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestmin.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestmin.md
index f8b1319cf..8a0cdc57a 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestmin.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestmin.md
@@ -3,6 +3,7 @@ title: lowestMin() function
description: The `lowestMin()` function selects the minimum record from each table in the input stream and returns the lowest `n` records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/lowestmin
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/lowestmin/
menu:
v2_0_ref:
name: lowestMin
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/max.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/max.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/max.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/max.md
index 3069e2393..9ec939844 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/max.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/max.md
@@ -2,7 +2,8 @@
title: max() function
description: The `max()` function selects record with the highest _value from the input table.
aliases:
- - /v2.0/reference/flux/functions/transformations/selectors/max
+ - /v2.0/reference/flux/functions/transformations/selectors/max
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/max/
menu:
v2_0_ref:
name: max
@@ -41,4 +42,4 @@ from(bucket:"example-bucket")
##### Related InfluxQL functions and statements:
-[MAX()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#max)
+[MAX()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#max)
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/min.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/min.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/min.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/min.md
index 24ea3c573..28c3ba794 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/min.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/min.md
@@ -3,6 +3,7 @@ title: min() function
description: The `min()` function selects record with the lowest _value from the input table.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/min
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/min/
menu:
v2_0_ref:
name: min
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/sample.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/sample.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/sample.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/sample.md
index 2bcc6ae83..7e6f9a7f5 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/sample.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/sample.md
@@ -3,6 +3,7 @@ title: sample() function
description: The `sample()` function selects a subset of the records from the input table.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/sample
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/sample/
menu:
v2_0_ref:
name: sample
@@ -48,4 +49,4 @@ from(bucket:"example-bucket")
##### Related InfluxQL functions and statements:
-[SAMPLE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sample)
+[SAMPLE()](https://docs.influxdata.com/influxdb/latest/query_language/functions/#sample)
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/top.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/top.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/top.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/top.md
index 87ffbed73..630bf8f4e 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/top.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/top.md
@@ -3,6 +3,7 @@ title: top() function
description: The `top()` function sorts a table by columns and keeps only the top n records.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/top
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/top/
menu:
v2_0_ref:
name: top
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/unique.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/unique.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/built-in/transformations/selectors/unique.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/unique.md
index fe5047a7f..899ca0bd2 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/selectors/unique.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/selectors/unique.md
@@ -3,6 +3,7 @@ title: unique() function
description: The `unique()` function returns all records containing unique values in a specified column.
aliases:
- /v2.0/reference/flux/functions/transformations/selectors/unique
+ - /v2.0/reference/flux/functions/built-in/transformations/selectors/unique/
menu:
v2_0_ref:
name: unique
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/set.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/set.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/built-in/transformations/set.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/set.md
index 51e88830d..812bc21b0 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/set.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/set.md
@@ -3,6 +3,7 @@ title: set() function
description: The `set()` function assigns a static value to each record in the input table.
aliases:
- /v2.0/reference/flux/functions/transformations/set
+ - /v2.0/reference/flux/functions/built-in/transformations/set/
menu:
v2_0_ref:
name: set
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/sort.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/sort.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/sort.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/sort.md
index 679885b53..a4a6f4e1d 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/sort.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/sort.md
@@ -3,6 +3,7 @@ title: sort() function
description: The `sort()` function orders the records within each table.
aliases:
- /v2.0/reference/flux/functions/transformations/sort
+ - /v2.0/reference/flux/functions/built-in/transformations/sort/
menu:
v2_0_ref:
name: sort
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/statecount.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/statecount.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/statecount.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/statecount.md
index 22dfa0c4c..58966ae86 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/statecount.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/statecount.md
@@ -3,6 +3,7 @@ title: stateCount() function
description: The `stateCount()` function computes the number of consecutive records in a given state.
aliases:
- /v2.0/reference/flux/functions/transformations/statecount
+ - /v2.0/reference/flux/functions/built-in/transformations/statecount/
menu:
v2_0_ref:
name: stateCount
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/stateduration.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stateduration.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/built-in/transformations/stateduration.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/stateduration.md
index 114299a9d..d21f16227 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/stateduration.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stateduration.md
@@ -3,6 +3,7 @@ title: stateDuration() function
description: The `stateDuration()` function computes the duration of a given state.
aliases:
- /v2.0/reference/flux/functions/transformations/stateduration
+ - /v2.0/reference/flux/functions/built-in/transformations/stateduration/
menu:
v2_0_ref:
name: stateDuration
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/_index.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/built-in/transformations/stream-table/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/_index.md
index 9206961fd..c1c0f1382 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/_index.md
@@ -5,6 +5,8 @@ seotitle: Flux built-in stream and table functions
description: >
Use stream and table functions to extract a table from a stream of tables and access its
columns and records.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/stream-table/
weight: 401
menu:
v2_0_ref:
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/getcolumn.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn.md
similarity index 69%
rename from content/v2.0/reference/flux/functions/built-in/transformations/stream-table/getcolumn.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn.md
index 2bc462efb..cbc976099 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/getcolumn.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn.md
@@ -3,6 +3,8 @@ title: getColumn() function
description: >
The `getColumn()` function extracts a column from a table given its label.
If the label is not present in the set of columns, the function errors.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/stream-table/getcolumn/
menu:
v2_0_ref:
name: getColumn
@@ -19,6 +21,13 @@ _**Function type:** Stream and table_
getColumn(column: "_value")
```
+{{% note %}}
+#### Use tableFind() to extract a single table
+`getColumn()` requires a single table as input.
+Use [`tableFind()`](/v2.0/reference/flux/functions/built-in/transformations/stream-table/tablefind/)
+to extract a single table from a stream of tables.
+{{% /note %}}
+
## Parameters
### column
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/getrecord.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord.md
similarity index 69%
rename from content/v2.0/reference/flux/functions/built-in/transformations/stream-table/getrecord.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord.md
index 9e1f35826..f660be331 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/getrecord.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord.md
@@ -3,6 +3,8 @@ title: getRecord() function
description: >
The `getRecord()` function extracts a record from a table given its index.
If the index is out of bounds, the function errors.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/stream-table/getrecord/
menu:
v2_0_ref:
name: getRecord
@@ -19,6 +21,13 @@ _**Function type:** Stream and table_
getRecord(idx: 0)
```
+{{% note %}}
+#### Use tableFind() to extract a single table
+`getRecord()` requires a single table as input.
+Use [`tableFind()`](/v2.0/reference/flux/functions/built-in/transformations/stream-table/tablefind/)
+to extract a single table from a stream of tables.
+{{% /note %}}
+
## Parameters
### idx
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/tablefind.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind.md
similarity index 71%
rename from content/v2.0/reference/flux/functions/built-in/transformations/stream-table/tablefind.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind.md
index f558c3f38..409ea3dbc 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/stream-table/tablefind.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind.md
@@ -3,6 +3,8 @@ title: tableFind() function
description: >
The `tableFind()` function extracts the first table in a stream of tables whose
group key values match a predicate. If no table is found, the function errors.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/stream-table/tablefind/
menu:
v2_0_ref:
name: tableFind
@@ -16,13 +18,14 @@ group key values match a predicate. If no table is found, the function errors.
_**Function type:** Stream and table_
```js
-tableFind(column: "_value")
+tableFind(fn: (key) => key._field == "fieldName")
```
## Parameters
{{% note %}}
-Make sure `fn` parameter names match each specified parameter. To learn why, see [Match parameter names](/v2.0/reference/flux/language/data-model/#match-parameter-names).
+Make sure `fn` parameter names match each specified parameter.
+To learn why, see [Match parameter names](/v2.0/reference/flux/language/data-model/#match-parameter-names).
{{% /note %}}
### fn
@@ -52,6 +55,6 @@ t = from(bucket:"example-bucket")
```
{{% note %}}
-You can use `t` from the example above as input for [`getColumn()`](/v2.0/reference/flux/functions/built-in/transformations/stream-table/getcolumn/)
-and [`getRecord()`](/v2.0/reference/flux/functions/built-in/transformations/stream-table/getrecord/).
+You can use `t` from the example above as input for [`getColumn()`](/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn/)
+and [`getRecord()`](/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord/).
{{% /note %}}
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/tail.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/tail.md
new file mode 100644
index 000000000..b86287b1b
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/tail.md
@@ -0,0 +1,49 @@
+---
+title: tail() function
+description: The `tail()` function limits each output table to the last `n` records.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/tail/
+menu:
+ v2_0_ref:
+ name: tail
+ parent: built-in-transformations
+weight: 401
+related:
+ - /v2.0/reference/flux/functions/built-in/transformations/limit/
+---
+
+The `tail()` function limits each output table to the last [`n`](#n) records.
+The function produces one output table for each input table.
+Each output table contains the last `n` records before the [`offset`](#offset).
+If the input table has less than `offset + n` records, `tail()` outputs all records before the `offset`.
+
+_**Function type:** Filter_
+
+```js
+tail(
+ n:10,
+ offset: 0
+)
+```
+
+## Parameters
+
+### n
+The maximum number of records to output.
+
+_**Data type:** Integer_
+
+### offset
+The number of records to skip at the end of a table table before limiting to `n`.
+Defaults to `0`.
+
+_**Data type:** Integer_
+
+## Examples
+
+##### Output the last ten records in each table
+```js
+from(bucket:"example-bucket")
+ |> range(start:-1h)
+ |> tail(n:10)
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/timeshift.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/timeshift.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/built-in/transformations/timeshift.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/timeshift.md
index a936dacaa..be365a397 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/timeshift.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/timeshift.md
@@ -4,6 +4,7 @@ description: The `timeShift()` function adds a fixed duration to time columns.
aliases:
- /v2.0/reference/flux/functions/transformations/shift
- /v2.0/reference/flux/functions/built-in/transformations/shift
+ - /v2.0/reference/flux/functions/built-in/transformations/timeshift/
menu:
v2_0_ref:
name: timeShift
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/truncatetimecolumn.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/truncatetimecolumn.md
new file mode 100644
index 000000000..6b0a0b053
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/truncatetimecolumn.md
@@ -0,0 +1,55 @@
+---
+title: truncateTimeColumn() function
+description: >
+ The `truncateTimeColumn()` function truncates all input table `_time` values to a specified unit.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/truncatetimecolumn/
+menu:
+ v2_0_ref:
+ name: truncateTimeColumn
+ parent: built-in-transformations
+weight: 401
+related:
+ - /v2.0/reference/flux/stdlib/date/truncate/
+---
+
+The `truncateTimeColumn()` function truncates all input table `_time` values to a specified unit.
+
+_**Function type:** Transformation_
+
+```js
+truncateTimeColumn(unit: 1s)
+```
+
+## Parameters
+
+### unit
+The unit of time to truncate to.
+
+_**Data type:** Duration_
+
+{{% note %}}
+Only use `1` and the unit of time to specify the `unit`.
+For example: `1s`, `1m`, `1h`.
+{{% /note %}}
+
+## Examples
+
+##### Truncate all time values to seconds
+```js
+from(bucket:"example-bucket")
+ |> range(start:-1h)
+ |> truncateTimeColumn(unit: 1s)
+```
+
+## Function definition
+```js
+import "date"
+
+truncateTimeColumn = (unit, tables=<-) =>
+ tables
+ |> map(fn: (r) => ({
+ r with _time: date.truncate(t: r._time, unit:unit)
+ })
+ )
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/_index.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/_index.md
similarity index 89%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/_index.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/_index.md
index 32dc3ad41..713e7c120 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/_index.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/_index.md
@@ -4,6 +4,7 @@ list_title: Built-in type conversion functions
description: Flux's built-in built-in type conversion functions convert columns of the input table into a specific data type.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/
menu:
v2_0_ref:
parent: built-in-transformations
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/bool.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/bool.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/bool.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/bool.md
index 9d1f16127..03935abee 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/bool.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/bool.md
@@ -1,6 +1,8 @@
---
title: bool() function
description: The `bool()` function converts a single value to a boolean.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/bool/
menu:
v2_0_ref:
name: bool
@@ -25,8 +27,7 @@ The value to convert.
## Examples
```js
from(bucket: "sensor-data")
- |> filter(fn:(r) =>
- r._measurement == "system" and
- )
+ |> range(start: -1m)
+ |> filter(fn:(r) => r._measurement == "system" )
|> map(fn:(r) => ({ r with responsive: bool(v: r.responsive) }))
```
diff --git a/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/bytes.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/bytes.md
new file mode 100644
index 000000000..a3707bb88
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/bytes.md
@@ -0,0 +1,32 @@
+---
+title: bytes() function
+description: The `bytes()` function converts a single value to bytes.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/bytes/
+menu:
+ v2_0_ref:
+ name: bytes
+ parent: built-in-type-conversions
+weight: 502
+---
+
+The `bytes()` function converts a single value to bytes.
+
+_**Function type:** Type conversion_
+_**Output data type:** Bytes_
+
+```js
+bytes(v: "1m")
+```
+
+## Parameters
+
+### v
+The value to convert.
+
+## Examples
+```js
+from(bucket: "sensor-data")
+ |> range(start: -1m)
+ |> map(fn:(r) => ({ r with _value: bytes(v: r._value) }))
+```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/duration.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/duration.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/duration.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/duration.md
index 02c669b8b..bb52c0560 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/duration.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/duration.md
@@ -1,6 +1,8 @@
---
title: duration() function
description: The `duration()` function converts a single value to a duration.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/duration/
menu:
v2_0_ref:
name: duration
@@ -25,8 +27,7 @@ The value to convert.
## Examples
```js
from(bucket: "sensor-data")
- |> filter(fn:(r) =>
- r._measurement == "system" and
- )
+ |> range(start: -1m)
+ |> filter(fn:(r) => r._measurement == "system" )
|> map(fn:(r) => ({ r with uptime: duration(v: r.uptime) }))
```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/float.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/float.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/float.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/float.md
index 7e7251dd1..30e54c5b0 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/float.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/float.md
@@ -1,6 +1,8 @@
---
title: float() function
description: The `float()` function converts a single value to a float.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/float/
menu:
v2_0_ref:
name: float
@@ -25,8 +27,7 @@ The value to convert.
## Examples
```js
from(bucket: "sensor-data")
- |> filter(fn:(r) =>
- r._measurement == "camera" and
- )
+ |> range(start: -1m)
+ |> filter(fn:(r) => r._measurement == "camera" )
|> map(fn:(r) => ({ r with aperature: float(v: r.aperature) }))
```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/int.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/int.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/int.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/int.md
index ed495fc21..a0da92ec4 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/int.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/int.md
@@ -1,6 +1,8 @@
---
title: int() function
description: The `int()` function converts a single value to an integer.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/int/
menu:
v2_0_ref:
name: int
@@ -25,8 +27,7 @@ The value to convert.
## Examples
```js
from(bucket: "sensor-data")
- |> filter(fn:(r) =>
- r._measurement == "camera" and
- )
+ |> range(start: -1m)
+ |> filter(fn:(r) => r._measurement == "camera" )
|> map(fn:(r) => ({ r with exposures: int(v: r.exposures) }))
```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string.md
similarity index 65%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string.md
index b3c092602..d8c3648bf 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string.md
@@ -1,6 +1,8 @@
---
title: string() function
description: The `string()` function converts a single value to a string.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/string/
menu:
v2_0_ref:
name: string
@@ -25,8 +27,7 @@ The value to convert.
## Examples
```js
from(bucket: "sensor-data")
- |> filter(fn:(r) =>
- r._measurement == "system" and
- )
- |> map(fn:(r) => ({ r with model_number string(v: r.model_number) }))
+ |> range(start: -1m)
+ |> filter(fn:(r) => r._measurement == "system" )
+ |> map(fn:(r) => ({ r with model_number: string(v: r.model_number) }))
```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/time.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/time.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/time.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/time.md
index fd6afb49e..bcaa3fcaa 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/time.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/time.md
@@ -1,6 +1,8 @@
---
title: time() function
description: The `time()` function converts a single value to a time.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/time/
menu:
v2_0_ref:
name: time
@@ -25,8 +27,7 @@ The value to convert.
## Examples
```js
from(bucket: "sensor-data")
- |> filter(fn:(r) =>
- r._measurement == "system" and
- )
+ |> range(start: -1m)
+ |> filter(fn:(r) => r._measurement == "system" )
|> map(fn:(r) => ({ r with timestamp: time(v: r.timestamp) }))
```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tobool.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tobool.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tobool.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tobool.md
index 0f0ec100a..2cad528d3 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tobool.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tobool.md
@@ -3,6 +3,7 @@ title: toBool() function
description: The `toBool()` function converts all values in the `_value` column to booleans.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions/tobool
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/tobool/
menu:
v2_0_ref:
name: toBool
@@ -43,5 +44,5 @@ toBool = (tables=<-) =>
```
_**Used functions:**
-[map()](/v2.0/reference/flux/functions/built-in/transformations/map),
-[bool()](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/bool)_
+[map()](/v2.0/reference/flux/stdlib/built-in/transformations/map),
+[bool()](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/bool)_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/toduration.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/toduration.md
similarity index 81%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/toduration.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/toduration.md
index 29adcd293..6ffa8ad51 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/toduration.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/toduration.md
@@ -3,6 +3,7 @@ title: toDuration() function
description: The `toDuration()` function converts all values in the `_value` column to durations.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions/toduration
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/toduration/
menu:
v2_0_ref:
name: toDuration
@@ -47,5 +48,5 @@ toDuration = (tables=<-) =>
```
_**Used functions:**
-[map()](/v2.0/reference/flux/functions/built-in/transformations/map),
-[duration()](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/duration)_
+[map()](/v2.0/reference/flux/stdlib/built-in/transformations/map),
+[duration()](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/duration)_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tofloat.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tofloat.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tofloat.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tofloat.md
index 237babf29..cabaf654b 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tofloat.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tofloat.md
@@ -3,6 +3,7 @@ title: toFloat() function
description: The `toFloat()` function converts all values in the `_value` column to floats.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions/tofloat
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/tofloat/
menu:
v2_0_ref:
name: toFloat
@@ -43,5 +44,5 @@ toFloat = (tables=<-) =>
```
_**Used functions:**
-[map()](/v2.0/reference/flux/functions/built-in/transformations/map),
-[float()](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/float)_
+[map()](/v2.0/reference/flux/stdlib/built-in/transformations/map),
+[float()](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/float)_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/toint.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/toint.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/toint.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/toint.md
index 69bbb02c5..4053d716b 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/toint.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/toint.md
@@ -3,6 +3,7 @@ title: toInt() function
description: The `toInt()` function converts all values in the `_value` column to integers.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions/toint
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/toint/
menu:
v2_0_ref:
name: toInt
@@ -43,5 +44,5 @@ toInt = (tables=<-) =>
```
_**Used functions:**
-[map()](/v2.0/reference/flux/functions/built-in/transformations/map),
-[int()](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/int)_
+[map()](/v2.0/reference/flux/stdlib/built-in/transformations/map),
+[int()](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/int)_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tostring.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tostring.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tostring.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tostring.md
index 342052ccd..99645fa1e 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/tostring.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/tostring.md
@@ -3,6 +3,7 @@ title: toString() function
description: The `toString()` function converts all values in the `_value` column to strings.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions/tostring
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/tostring/
menu:
v2_0_ref:
name: toString
@@ -43,5 +44,5 @@ toString = (tables=<-) =>
```
_**Used functions:**
-[map()](/v2.0/reference/flux/functions/built-in/transformations/map),
-[string()](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string)_
+[map()](/v2.0/reference/flux/stdlib/built-in/transformations/map),
+[string()](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/string)_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/totime.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/totime.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/totime.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/totime.md
index 6b22ae988..ea36402ee 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/totime.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/totime.md
@@ -3,6 +3,7 @@ title: toTime() function
description: The `toTime()` function converts all values in the `_value` column to times.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions/totime
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/totime/
menu:
v2_0_ref:
name: toTime
@@ -43,5 +44,5 @@ toTime = (tables=<-) =>
```
_**Used functions:**
-[map()](/v2.0/reference/flux/functions/built-in/transformations/map),
-[time()](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/time)_
+[map()](/v2.0/reference/flux/stdlib/built-in/transformations/map),
+[time()](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/time)_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/touint.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/touint.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/touint.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/touint.md
index 5e0809358..d113d28a1 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/touint.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/touint.md
@@ -3,6 +3,7 @@ title: toUInt() function
description: The `toUInt()` function converts all values in the `_value` column to UIntegers.
aliases:
- /v2.0/reference/flux/functions/transformations/type-conversions/touint
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/touint/
menu:
v2_0_ref:
name: toUInt
@@ -43,5 +44,5 @@ toUInt = (tables=<-) =>
```
_**Used functions:**
-[map()](/v2.0/reference/flux/functions/built-in/transformations/map),
-[uint()](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/uint)_
+[map()](/v2.0/reference/flux/stdlib/built-in/transformations/map),
+[uint()](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/uint)_
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/uint.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/uint.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/uint.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/uint.md
index 68ade7713..72f12c2d0 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/type-conversions/uint.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/uint.md
@@ -1,6 +1,8 @@
---
title: uint() function
description: The `uint()` function converts a single value to a UInteger.
+aliases:
+ - /v2.0/reference/flux/functions/built-in/transformations/type-conversions/uint/
menu:
v2_0_ref:
name: uint
@@ -25,8 +27,7 @@ The value to convert.
## Examples
```js
from(bucket: "sensor-data")
- |> filter(fn:(r) =>
- r._measurement == "camera" and
- )
+ |> range(start: -1m)
+ |> filter(fn:(r) => r._measurement == "camera" )
|> map(fn:(r) => ({ r with exposures: uint(v: r.exposures) }))
```
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/union.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/union.md
similarity index 95%
rename from content/v2.0/reference/flux/functions/built-in/transformations/union.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/union.md
index 449e15ee6..eba22a466 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/union.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/union.md
@@ -3,6 +3,7 @@ title: union() function
description: The `union()` function concatenates two or more input streams into a single output stream.
aliases:
- /v2.0/reference/flux/functions/transformations/union
+ - /v2.0/reference/flux/functions/built-in/transformations/union/
menu:
v2_0_ref:
name: union
diff --git a/content/v2.0/reference/flux/functions/built-in/transformations/window.md b/content/v2.0/reference/flux/stdlib/built-in/transformations/window.md
similarity index 97%
rename from content/v2.0/reference/flux/functions/built-in/transformations/window.md
rename to content/v2.0/reference/flux/stdlib/built-in/transformations/window.md
index bd9f658aa..6611b35a6 100644
--- a/content/v2.0/reference/flux/functions/built-in/transformations/window.md
+++ b/content/v2.0/reference/flux/stdlib/built-in/transformations/window.md
@@ -3,6 +3,7 @@ title: window() function
description: The `window()` function groups records based on a time value.
aliases:
- /v2.0/reference/flux/functions/transformations/window
+ - /v2.0/reference/flux/functions/built-in/transformations/window/
menu:
v2_0_ref:
name: window
diff --git a/content/v2.0/reference/flux/functions/csv/_index.md b/content/v2.0/reference/flux/stdlib/csv/_index.md
similarity index 86%
rename from content/v2.0/reference/flux/functions/csv/_index.md
rename to content/v2.0/reference/flux/stdlib/csv/_index.md
index f1af202be..e8ebc3e22 100644
--- a/content/v2.0/reference/flux/functions/csv/_index.md
+++ b/content/v2.0/reference/flux/stdlib/csv/_index.md
@@ -4,10 +4,12 @@ list_title: CSV package
description: >
The Flux CSV package provides functions for working with data in annotated CSV format.
Import the `csv` package.
+aliases:
+ - /v2.0/reference/flux/functions/csv/
menu:
v2_0_ref:
name: CSV
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [functions, csv, package]
---
diff --git a/content/v2.0/reference/flux/functions/csv/from.md b/content/v2.0/reference/flux/stdlib/csv/from.md
similarity index 97%
rename from content/v2.0/reference/flux/functions/csv/from.md
rename to content/v2.0/reference/flux/stdlib/csv/from.md
index 712555dcd..6114f3c08 100644
--- a/content/v2.0/reference/flux/functions/csv/from.md
+++ b/content/v2.0/reference/flux/stdlib/csv/from.md
@@ -4,6 +4,7 @@ description: The `csv.from()` function retrieves data from a CSV data source.
aliases:
- /v2.0/reference/flux/functions/inputs/fromcsv
- /v2.0/reference/flux/functions/built-in/inputs/fromcsv
+ - /v2.0/reference/flux/functions/csv/from/
menu:
v2_0_ref:
name: csv.from
diff --git a/content/v2.0/reference/flux/functions/date/_index.md b/content/v2.0/reference/flux/stdlib/date/_index.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/date/_index.md
rename to content/v2.0/reference/flux/stdlib/date/_index.md
index adc7cb9b5..0d603df8b 100644
--- a/content/v2.0/reference/flux/functions/date/_index.md
+++ b/content/v2.0/reference/flux/stdlib/date/_index.md
@@ -2,14 +2,15 @@
title: Flux date package
list_title: Date package
description: >
- The Flux math package provides basic constants and mathematical functions.
- Import the `math` package.
+ The Flux date package provides date and time constants and functions.
+ Import the `date` package.
aliases:
- /v2.0/reference/flux/language/built-ins/time-constants/
+ - /v2.0/reference/flux/functions/date/
menu:
v2_0_ref:
name: Date
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [date, time, functions]
---
diff --git a/content/v2.0/reference/flux/functions/date/hour.md b/content/v2.0/reference/flux/stdlib/date/hour.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/date/hour.md
rename to content/v2.0/reference/flux/stdlib/date/hour.md
index 619d0aa8d..efdf143e7 100644
--- a/content/v2.0/reference/flux/functions/date/hour.md
+++ b/content/v2.0/reference/flux/stdlib/date/hour.md
@@ -3,6 +3,8 @@ title: date.hour() function
description: >
The `date.hour()` function returns the hour of a specified time.
Results range from `[0-23]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/hour/
menu:
v2_0_ref:
name: date.hour
diff --git a/content/v2.0/reference/flux/stdlib/date/microsecond.md b/content/v2.0/reference/flux/stdlib/date/microsecond.md
new file mode 100644
index 000000000..bd4cbba76
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/date/microsecond.md
@@ -0,0 +1,33 @@
+---
+title: date.microsecond() function
+description: >
+ The `date.microsecond()` function returns the microsecond of a specified time.
+ Results range from `[0-999999]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/microsecond/
+menu:
+ v2_0_ref:
+ name: date.microsecond
+ parent: Date
+weight: 301
+---
+
+The `date.microsecond()` function returns the microsecond of a specified time.
+Results range from `[0-999999]`.
+
+_**Function type:** Transformation_
+
+```js
+import "date"
+
+date.microsecond(t: 2019-07-17T12:05:21.012934584Z)
+
+// Returns 12934
+```
+
+## Parameters
+
+### t
+The time to operate on.
+
+_**Data type:** Time_
diff --git a/content/v2.0/reference/flux/stdlib/date/millisecond.md b/content/v2.0/reference/flux/stdlib/date/millisecond.md
new file mode 100644
index 000000000..6d7a6285e
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/date/millisecond.md
@@ -0,0 +1,33 @@
+---
+title: date.millisecond() function
+description: >
+ The `date.millisecond()` function returns the millisecond of a specified time.
+ Results range from `[0-999999]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/millisecond/
+menu:
+ v2_0_ref:
+ name: date.millisecond
+ parent: Date
+weight: 301
+---
+
+The `date.millisecond()` function returns the millisecond of a specified time.
+Results range from `[0-999]`.
+
+_**Function type:** Transformation_
+
+```js
+import "date"
+
+date.millisecond(t: 2019-07-17T12:05:21.012934584Z)
+
+// Returns 12
+```
+
+## Parameters
+
+### t
+The time to operate on.
+
+_**Data type:** Time_
diff --git a/content/v2.0/reference/flux/functions/date/minute.md b/content/v2.0/reference/flux/stdlib/date/minute.md
similarity index 89%
rename from content/v2.0/reference/flux/functions/date/minute.md
rename to content/v2.0/reference/flux/stdlib/date/minute.md
index 9a1f10fc9..5e5ec0b34 100644
--- a/content/v2.0/reference/flux/functions/date/minute.md
+++ b/content/v2.0/reference/flux/stdlib/date/minute.md
@@ -3,6 +3,8 @@ title: date.minute() function
description: >
The `date.minute()` function returns the minute of a specified time.
Results range from `[0-59]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/minute/
menu:
v2_0_ref:
name: date.minute
diff --git a/content/v2.0/reference/flux/functions/date/month.md b/content/v2.0/reference/flux/stdlib/date/month.md
similarity index 84%
rename from content/v2.0/reference/flux/functions/date/month.md
rename to content/v2.0/reference/flux/stdlib/date/month.md
index cfe91894c..6612dedd4 100644
--- a/content/v2.0/reference/flux/functions/date/month.md
+++ b/content/v2.0/reference/flux/stdlib/date/month.md
@@ -2,7 +2,9 @@
title: date.month() function
description: >
The `date.month()` function returns the month of a specified time.
- Results range from `[1-12]`
+ Results range from `[1-12]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/month/
menu:
v2_0_ref:
name: date.month
diff --git a/content/v2.0/reference/flux/functions/date/monthday.md b/content/v2.0/reference/flux/stdlib/date/monthday.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/date/monthday.md
rename to content/v2.0/reference/flux/stdlib/date/monthday.md
index 7e95af6e7..fabc7d31b 100644
--- a/content/v2.0/reference/flux/functions/date/monthday.md
+++ b/content/v2.0/reference/flux/stdlib/date/monthday.md
@@ -3,6 +3,8 @@ title: date.monthDay() function
description: >
The `date.monthDay()` function returns the day of the month for a specified time.
Results range from `[1-31]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/monthday/
menu:
v2_0_ref:
name: date.monthDay
diff --git a/content/v2.0/reference/flux/stdlib/date/nanosecond.md b/content/v2.0/reference/flux/stdlib/date/nanosecond.md
new file mode 100644
index 000000000..9d05b1f72
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/date/nanosecond.md
@@ -0,0 +1,33 @@
+---
+title: date.nanosecond() function
+description: >
+ The `date.nanosecond()` function returns the nanosecond of a specified time.
+ Results range from `[0-999999999]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/nanosecond/
+menu:
+ v2_0_ref:
+ name: date.nanosecond
+ parent: Date
+weight: 301
+---
+
+The `date.nanosecond()` function returns the nanosecond of a specified time.
+Results range from `[0-999999999]`.
+
+_**Function type:** Transformation_
+
+```js
+import "date"
+
+date.nanosecond(t: 2019-07-17T12:05:21.012934584Z)
+
+// Returns 12934584
+```
+
+## Parameters
+
+### t
+The time to operate on.
+
+_**Data type:** Time_
diff --git a/content/v2.0/reference/flux/stdlib/date/quarter.md b/content/v2.0/reference/flux/stdlib/date/quarter.md
new file mode 100644
index 000000000..a2f05b0f9
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/date/quarter.md
@@ -0,0 +1,33 @@
+---
+title: date.quarter() function
+description: >
+ The `date.quarter()` function returns the quarter of the year for a specified time.
+ Results range from `[1-4]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/quarter/
+menu:
+ v2_0_ref:
+ name: date.quarter
+ parent: Date
+weight: 301
+---
+
+The `date.quarter()` function returns the quarter of the year for a specified time.
+Results range from `[1-4]`.
+
+_**Function type:** Transformation_
+
+```js
+import "date"
+
+date.quarter(t: 2019-07-17T12:05:21.012Z)
+
+// Returns 3
+```
+
+## Parameters
+
+### t
+The time to operate on.
+
+_**Data type:** Time_
diff --git a/content/v2.0/reference/flux/functions/date/second.md b/content/v2.0/reference/flux/stdlib/date/second.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/date/second.md
rename to content/v2.0/reference/flux/stdlib/date/second.md
index 849ccea6f..e7cc28f7f 100644
--- a/content/v2.0/reference/flux/functions/date/second.md
+++ b/content/v2.0/reference/flux/stdlib/date/second.md
@@ -3,6 +3,8 @@ title: date.second() function
description: >
The `date.second()` function returns the second of a specified time.
Results range from `[0-59]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/second/
menu:
v2_0_ref:
name: date.second
diff --git a/content/v2.0/reference/flux/stdlib/date/truncate.md b/content/v2.0/reference/flux/stdlib/date/truncate.md
new file mode 100644
index 000000000..762cfffcd
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/date/truncate.md
@@ -0,0 +1,59 @@
+---
+title: date.truncate() function
+description: >
+ The `date.truncate()` function truncates a time to a specified unit.
+aliases:
+ - /v2.0/reference/flux/functions/date/truncate/
+menu:
+ v2_0_ref:
+ name: date.truncate
+ parent: Date
+weight: 301
+---
+
+The `date.truncate()` function truncates a time to a specified unit.
+
+_**Function type:** Transformation_
+
+```js
+import "date"
+
+date.truncate(
+ t: 2019-07-17T12:05:21.012Z
+ unit: 1s
+)
+
+// Returns 2019-07-17T12:05:21.000000000Z
+```
+
+## Parameters
+
+### t
+The time to operate on.
+
+_**Data type:** Time_
+
+### unit
+The unit of time to truncate to.
+
+_**Data type:** Duration_
+
+{{% note %}}
+Only use `1` and the unit of time to specify the `unit`.
+For example: `1s`, `1m`, `1h`.
+{{% /note %}}
+
+## Examples
+```js
+import "date"
+
+date.truncate(t: "2019-06-03T13:59:01.000000000Z", unit: 1s)
+// Returns 2019-06-03T13:59:01.000000000Z
+
+date.truncate(t: "2019-06-03T13:59:01.000000000Z", unit: 1m)
+// Returns 2019-06-03T13:59:00.000000000Z
+
+date.truncate(t: "2019-06-03T13:59:01.000000000Z", unit: 1h)
+// Returns 2019-06-03T13:00:00.000000000Z
+
+```
diff --git a/content/v2.0/reference/flux/stdlib/date/week.md b/content/v2.0/reference/flux/stdlib/date/week.md
new file mode 100644
index 000000000..dec8bddec
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/date/week.md
@@ -0,0 +1,33 @@
+---
+title: date.week() function
+description: >
+ The `date.week()` function returns the ISO week of the year for a specified time.
+ Results range from `[1-53]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/week/
+menu:
+ v2_0_ref:
+ name: date.week
+ parent: Date
+weight: 301
+---
+
+The `date.week()` function returns the ISO week of the year for a specified time.
+Results range from `[1-53]`.
+
+_**Function type:** Transformation_
+
+```js
+import "date"
+
+date.week(t: 2019-07-17T12:05:21.012Z)
+
+// Returns 29
+```
+
+## Parameters
+
+### t
+The time to operate on.
+
+_**Data type:** Time_
diff --git a/content/v2.0/reference/flux/functions/date/weekday.md b/content/v2.0/reference/flux/stdlib/date/weekday.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/date/weekday.md
rename to content/v2.0/reference/flux/stdlib/date/weekday.md
index 4ab512c05..6e6fdb18c 100644
--- a/content/v2.0/reference/flux/functions/date/weekday.md
+++ b/content/v2.0/reference/flux/stdlib/date/weekday.md
@@ -3,6 +3,8 @@ title: date.weekDay() function
description: >
The `date.weekDay()` function returns the day of the week for a specified time.
Results range from `[0-6]`.
+aliases:
+ - /v2.0/reference/flux/functions/date/weekday/
menu:
v2_0_ref:
name: date.weekDay
diff --git a/content/v2.0/reference/flux/stdlib/date/year.md b/content/v2.0/reference/flux/stdlib/date/year.md
new file mode 100644
index 000000000..f911a5976
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/date/year.md
@@ -0,0 +1,31 @@
+---
+title: date.year() function
+description: >
+ The `date.year()` function returns the year of a specified time.
+aliases:
+ - /v2.0/reference/flux/functions/date/year/
+menu:
+ v2_0_ref:
+ name: date.year
+ parent: Date
+weight: 301
+---
+
+The `date.year()` function returns the year of a specified time.
+
+_**Function type:** Transformation_
+
+```js
+import "date"
+
+date.year(t: 2019-07-17T12:05:21.012Z)
+
+// Returns 2019
+```
+
+## Parameters
+
+### t
+The time to operate on.
+
+_**Data type:** Time_
diff --git a/content/v2.0/reference/flux/functions/date/yearday.md b/content/v2.0/reference/flux/stdlib/date/yearday.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/date/yearday.md
rename to content/v2.0/reference/flux/stdlib/date/yearday.md
index 0725e9418..20df57afe 100644
--- a/content/v2.0/reference/flux/functions/date/yearday.md
+++ b/content/v2.0/reference/flux/stdlib/date/yearday.md
@@ -3,6 +3,8 @@ title: date.yearDay() function
description: >
The `date.yearDay()` function returns the day of the year for a specified time.
Results range from `[1-365]` for non-leap years, and `[1-366]` in leap years.
+aliases:
+ - /v2.0/reference/flux/functions/date/yearday/
menu:
v2_0_ref:
name: date.yearDay
diff --git a/content/v2.0/reference/flux/stdlib/experimental/_index.md b/content/v2.0/reference/flux/stdlib/experimental/_index.md
new file mode 100644
index 000000000..678830f89
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/_index.md
@@ -0,0 +1,43 @@
+---
+title: Flux Experimental package
+list_title: Experimental package
+description: >
+ The Flux Experimental package includes experimental functions that perform various tasks.
+ Experimental functions are subject to change at any time and are not recommended for production use.
+menu:
+ v2_0_ref:
+ name: Experimental
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [functions, experimental, package]
+---
+
+The Flux Experimental package includes experimental functions that perform various tasks.
+
+{{% warn %}}
+### Use experimental functions at your own risk
+Experimental functions are subject to change and are **not recommended for production use**.
+At any time, experimental functions and packages may:
+
+- be moved or promoted to a permanent location
+- undergo API changes
+- stop working with no planned fixes
+- be removed without warning nor published explanation
+
+**By using experimental functions and packages, you agree to these risks.**
+{{% /warn %}}
+
+## Experimental functions
+The following functions are part of the base experimental package.
+To use them, import the `experimental` package.
+
+```js
+import "experimental"
+```
+
+{{< children type="functions" show="pages" >}}
+
+## Experimental packages
+Experimental packages require different import paths than base experimental functions.
+
+{{< children show="sections" >}}
diff --git a/content/v2.0/reference/flux/stdlib/experimental/addduration.md b/content/v2.0/reference/flux/stdlib/experimental/addduration.md
new file mode 100644
index 000000000..656e796c2
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/addduration.md
@@ -0,0 +1,59 @@
+---
+title: experimental.addDuration() function
+description: >
+ The `experimental.addDuration()` function adds a duration to a time value and
+ returns the resulting time.
+menu:
+ v2_0_ref:
+ name: experimental.addDuration
+ parent: Experimental
+weight: 201
+related:
+ - /v2.0/reference/flux/stdlib/experimental/subduration/
+---
+
+The `experimental.addDuration()` function adds a duration to a time value and
+returns the resulting time value.
+
+_**Function type:** Transformation_
+
+{{% warn %}}
+The `experimental.addDuration()` function is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+
+This specific function will be removed once duration vectors are implemented.
+See [influxdata/flux#413](https://github.com/influxdata/flux/issues/413).
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.addDuration(
+ d: 12h,
+ to: now(),
+)
+```
+
+## Parameters
+
+### d
+The duration to add.
+
+_**Data type: Duration**_
+
+### to
+The time to add the [duration](#d) to.
+
+## Examples
+
+### Add six hours to a timestamp
+```js
+import "experimental"
+
+experimental.addDuration(
+ d: 6h,
+ to: 2019-09-16T12:00:00Z,
+)
+
+// Returns 2019-09-16T18:00:00.000000000Z
+```
diff --git a/content/v2.0/reference/flux/stdlib/experimental/bigtable/_index.md b/content/v2.0/reference/flux/stdlib/experimental/bigtable/_index.md
new file mode 100644
index 000000000..73fa1244d
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/bigtable/_index.md
@@ -0,0 +1,29 @@
+---
+title: Flux Bigtable package
+list_title: Bigtable package
+description: >
+ The Flux Bigtable package provides tools for working with data in Google Cloud Bigtable databases.
+ Import the `experimental/bigtable` package.
+menu:
+ v2_0_ref:
+ name: Bigtable
+ parent: Experimental
+weight: 201
+v2.0/tags: [functions, bigtable, package, google]
+---
+
+The Flux Bigtable package provides tools for working with data in
+[Google Cloud Bigtable](https://cloud.google.com/bigtable/) databases.
+
+{{% warn %}}
+The Bigtable package is currently experimental and is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+Import the `experimental/bigtable` package:
+
+```js
+import "experimental/bigtable"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/experimental/bigtable/from.md b/content/v2.0/reference/flux/stdlib/experimental/bigtable/from.md
new file mode 100644
index 000000000..af10c5e2b
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/bigtable/from.md
@@ -0,0 +1,59 @@
+---
+title: bigtable.from() function
+description: >
+ The `bigtable.from()` function retrieves data from a Google Cloud Bigtable data source.
+menu:
+ v2_0_ref:
+ name: bigtable.from
+ parent: Bigtable
+weight: 301
+---
+
+The `bigtable.from()` function retrieves data from a [Google Cloud Bigtable](https://cloud.google.com/bigtable/)
+data source.
+
+_**Function type:** Input_
+
+{{% warn %}}
+The `bigtable.from()` function is currently experimental and is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+```js
+import "experimental/bigtable"
+
+bigtable.from(
+ token: "mySuPeRseCretTokEn",
+ project: "exampleProjectID",
+ instance: "exampleInstanceID",
+ table: "example-table"
+)
+```
+
+## Parameters
+
+### token
+The Google Cloud IAM token to use to access the Cloud Bigtable database.
+
+_For more information, see the following:_
+
+- [Cloud Bigtable Access Control](https://cloud.google.com/bigtable/docs/access-control)
+- [Google Cloud IAM How-to guides](https://cloud.google.com/iam/docs/how-to)
+- [Setting Up Authentication for Server to Server Production Applications on Google Cloud](https://cloud.google.com/docs/authentication/production)
+
+_**Data type: String**_
+
+### project
+The project ID of the Cloud Bigtable project to retrieve data from.
+
+_**Data type: String**_
+
+### instance
+The instance ID of the Cloud Bigtable instance to retrieve data from.
+
+_**Data type: String**_
+
+### table
+The name of the Cloud Bigtable table to retrieve data from.
+
+_**Data type: String**_
diff --git a/content/v2.0/reference/flux/stdlib/experimental/group.md b/content/v2.0/reference/flux/stdlib/experimental/group.md
new file mode 100644
index 000000000..69c73889c
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/group.md
@@ -0,0 +1,61 @@
+---
+title: experimental.group() function
+description: >
+ The `experimental.group()` function introduces an `extend` mode to the existing
+ `group()` function.
+menu:
+ v2_0_ref:
+ name: experimental.group
+ parent: Experimental
+weight: 201
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/group/
+---
+
+The `experimental.group()` function introduces an `extend` mode to the existing
+[`group()`](/v2.0/reference/flux/stdlib/built-in/transformations/group/) function.
+
+_**Function type:** Transformation_
+
+{{% warn %}}
+The `experimental.group()` function is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+
+This specific function will be removed once the proposed `extend` mode is sufficiently vetted.
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.group(columns: ["host", "_measurement"], mode:"extend")
+```
+
+## Parameters
+
+### columns
+List of columns to use in the grouping operation.
+Defaults to `[]`.
+
+_**Data type:** Array of strings_
+
+### mode
+The mode used to group columns.
+
+_**Data type:** String_
+
+{{% note %}}
+`extend` is the only mode available to `experimental.group()`.
+{{% /note %}}
+
+#### extend
+Appends columns defined in the [`columns` parameter](#columns) to all existing
+[group keys](/v2.0/query-data/get-started/#group-keys).
+
+## Examples
+
+###### Include the value column in each groups' group key
+```js
+from(bucket: "example-bucket")
+ |> range(start: -1m)
+ |> group(columns: ["_value"], mode: "extend")
+```
diff --git a/content/v2.0/reference/flux/stdlib/experimental/mqtt/_index.md b/content/v2.0/reference/flux/stdlib/experimental/mqtt/_index.md
new file mode 100644
index 000000000..2b80764d6
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/mqtt/_index.md
@@ -0,0 +1,28 @@
+---
+title: Flux MQTT package
+list_title: MQTT package
+description: >
+ The Flux MQTT package provides functions for working with MQTT protocol.
+ Import the `experimental/mqtt` package.
+menu:
+ v2_0_ref:
+ name: MQTT
+ parent: Experimental
+weight: 201
+v2.0/tags: [functions, mqtt, package]
+---
+
+Flux MQTT functions provide tools for working with Message Queuing Telemetry Transport (MQTT) protocol.
+
+{{% warn %}}
+The MQTT package is currently experimental and is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+Import the `experimental/mqtt` package:
+
+```js
+import "experimental/mqtt"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/experimental/mqtt/to.md b/content/v2.0/reference/flux/stdlib/experimental/mqtt/to.md
new file mode 100644
index 000000000..8b55904da
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/mqtt/to.md
@@ -0,0 +1,134 @@
+---
+title: mqtt.to() function
+description: >
+ The `mqtt.to()` function outputs data to an MQTT broker using MQTT protocol.
+menu:
+ v2_0_ref:
+ name: mqtt.to
+ parent: MQTT
+weight: 301
+---
+
+The `mqtt.to()` function outputs data to an MQTT broker using MQTT protocol.
+
+_**Function type:** Output_
+
+{{% warn %}}
+The `mqtt.to()` function is currently experimental and is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+```js
+import "experimental/mqtt"
+
+mqtt.to(
+ broker: "tcp://localhost:8883",
+ topic: "example-topic",
+ message: "Example message",
+ qos: 0,
+ clientid: "flux-mqtt",
+ username: "username",
+ password: "password",
+ name: "name-example",
+ timeout: 1s,
+ timeColumn: "_time",
+ tagColumns: ["tag1", "tag2"],
+ valueColumns: ["_value"]
+)
+```
+
+## Parameters
+
+### broker
+The MQTT broker connection string.
+
+_**Data type: String**_
+
+### topic
+The MQTT topic to send data to.
+
+_**Data type: String**_
+
+### message
+The message or payload to send to the MQTT broker.
+The default payload is an output table.
+If there are multiple output tables, it sends each table as a separate MQTT message.
+
+{{% note %}}
+When you specify a message, the function sends the message string only (no output table).
+{{% /note %}}
+
+_**Data type: String**_
+
+### qos
+The [MQTT Quality of Service (QoS)](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901103) level.
+Values range from `[0-2]`.
+Default is `0`.
+
+_**Data type: Integer**_
+
+### clientid
+The MQTT client ID.
+
+_**Data type: String**_
+
+### username
+The username to send to the MQTT broker.
+Username is only required if the broker requires authentication.
+If you provide a username, you must provide a [password](#password).
+
+_**Data type: String**_
+
+### password
+The password to send to the MQTT broker.
+Password is only required if the broker requires authentication.
+If you provide a password, you must provide a [username](#username).
+
+_**Data type: String**_
+
+### name
+_(Optional)_ The name for the MQTT message.
+
+_**Data type: String**_
+
+### timeout
+The MQTT connection timeout.
+Default is `1s`.
+
+_**Data type: Duration**_
+
+### timeColumn
+The column to use as time values in the output line protocol.
+Default is `"_time"`.
+
+_**Data type: String**_
+
+### tagColumns
+The columns to use as tag sets in the output line protocol.
+Default is `[]`.
+
+_**Data type: Array of strings**_
+
+### valueColumns
+The columns to use as field values in the output line protocol.
+Default is `["_value"]`.
+
+_**Data type: Array of strings**_
+
+## Examples
+
+### Send data to an MQTT endpoint
+```js
+import "experimental/mqtt"
+
+from(bucket: "example-bucket")
+ |> range(start: -5m)
+ |> filter(fn: (r) => r._measurement == "airSensor")
+ |> mqtt.to(
+ broker: "tcp://localhost:8883",
+ topic: "air-sensors",
+ clientid: "sensor-12a4",
+ tagColumns: ["sensorID"],
+ valueColumns: ["_value"]
+ )
+```
diff --git a/content/v2.0/reference/flux/stdlib/experimental/objectkeys.md b/content/v2.0/reference/flux/stdlib/experimental/objectkeys.md
new file mode 100644
index 000000000..a40b5dd02
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/objectkeys.md
@@ -0,0 +1,53 @@
+---
+title: experimental.objectKeys() function
+description: >
+ The `experimental.objectKeys()` function returns an array of keys in a specified object.
+menu:
+ v2_0_ref:
+ name: experimental.objectKeys
+ parent: Experimental
+weight: 201
+---
+
+The `experimental.objectKeys()` function returns an array of keys in a specified object.
+
+_**Function type:** Transformation_
+
+{{% warn %}}
+The `experimental.objectKeys()` function is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.objectKeys(
+ o: {key1: "value1", key2: "value2"}
+)
+
+// Returns [key1, key2]
+```
+
+## Parameters
+
+### o
+The object to return keys from.
+
+_**Data type: Object**_
+
+## Examples
+
+### Return all keys in an object
+```js
+import "experimental"
+
+user = {
+ firstName: "John",
+ lastName: "Doe",
+ age: 42
+}
+
+experimental.objectKeys(o: user)
+
+// Returns [firstName, lastName, age]
+```
diff --git a/content/v2.0/reference/flux/stdlib/experimental/set.md b/content/v2.0/reference/flux/stdlib/experimental/set.md
new file mode 100644
index 000000000..33c6ce380
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/set.md
@@ -0,0 +1,75 @@
+---
+title: experimental.set() function
+description: >
+ The `experimental.set()` function sets multiple static column values on all records.
+menu:
+ v2_0_ref:
+ name: experimental.set
+ parent: Experimental
+weight: 201
+related:
+ - /v2.0/reference/flux/stdlib/built-in/transformations/set/
+---
+
+The `experimental.set()` function sets multiple static column values on all records.
+If a column already exists, the function updates the existing value.
+If a column does not exist, the function adds it with the specified value.
+
+_Once sufficiently vetted, `experimental.set()` will replace the existing
+[`set()` function](/v2.0/reference/flux/stdlib/built-in/transformations/set/)._
+
+_**Function type:** Transformation_
+
+{{% warn %}}
+The `experimental.set()` function is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.set(
+ o: {column1: "value1", column2: "value2"}
+)
+```
+
+## Parameters
+
+### o
+An object that defines the columns and values to set.
+The key of each key-value pair defines the column name.
+The value of each key-value pair defines the column value.
+
+_**Data type: Object**_
+
+## Examples
+
+### Set values for multiple columns
+
+##### Example input table
+| _time | _field | _value |
+|:----- |:------ | ------:|
+| 2019-09-16T12:00:00Z | temp | 71.2 |
+| 2019-09-17T12:00:00Z | temp | 68.4 |
+| 2019-09-18T12:00:00Z | temp | 70.8 |
+
+##### Example query
+```js
+import "experimental"
+
+data
+ |> experimental.set(
+ o: {
+ _field: "temperature",
+ unit: "°F",
+ location: "San Francisco"
+ }
+ )
+```
+
+##### Example output table
+| _time | _field | _value | unit | location |
+|:----- |:------ | ------:|:----:| -------- |
+| 2019-09-16T12:00:00Z | temperature | 71.2 | °F | San Francisco |
+| 2019-09-17T12:00:00Z | temperature | 68.4 | °F | San Francisco |
+| 2019-09-18T12:00:00Z | temperature | 70.8 | °F | San Francisco |
diff --git a/content/v2.0/reference/flux/stdlib/experimental/subduration.md b/content/v2.0/reference/flux/stdlib/experimental/subduration.md
new file mode 100644
index 000000000..060227568
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/subduration.md
@@ -0,0 +1,59 @@
+---
+title: experimental.subDuration() function
+description: >
+ The `experimental.subDuration()` function subtracts a duration from a time value and
+ returns a the resulting time value.
+menu:
+ v2_0_ref:
+ name: experimental.subDuration
+ parent: Experimental
+weight: 201
+related:
+ - /v2.0/reference/flux/stdlib/experimental/addduration/
+---
+
+The `experimental.subDuration()` function subtracts a duration from a time value and
+returns the resulting time value.
+
+_**Function type:** Transformation_
+
+{{% warn %}}
+The `experimental.subDuration()` function is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+
+This specific function will be removed once duration vectors are implemented.
+See [influxdata/flux#413](https://github.com/influxdata/flux/issues/413).
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.subDuration(
+ d: 12h,
+ from: now(),
+)
+```
+
+## Parameters
+
+### d
+The duration to subtract.
+
+_**Data type: Duration**_
+
+### from
+The time to subtract the [duration](#d) from.
+
+## Examples
+
+### Subtract six hours from a timestamp
+```js
+import "experimental"
+
+experimental.subDuration(
+ d: 6h,
+ from: 2019-09-16T12:00:00Z,
+)
+
+// Returns 2019-09-16T06:00:00.000000000Z
+```
diff --git a/content/v2.0/reference/flux/stdlib/experimental/to.md b/content/v2.0/reference/flux/stdlib/experimental/to.md
new file mode 100644
index 000000000..2eece5f3d
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/experimental/to.md
@@ -0,0 +1,110 @@
+---
+title: experimental.to() function
+description: >
+ The `experimental.to()` function writes data to an InfluxDB v2.0 bucket.
+ The function structures data differently than the built-in `to()` function.
+menu:
+ v2_0_ref:
+ name: experimental.to
+ parent: Experimental
+weight: 201
+related:
+ - /v2.0/reference/flux/stdlib/built-in/outputs/to/
+---
+
+The `experimental.to()` function writes data to an InfluxDB v2.0 bucket, but in
+a [different structure](#expected-data-structure) than the
+[built-in `to()` function](/v2.0/reference/flux/stdlib/built-in/outputs/to/).
+
+_**Function type:** Output_
+
+{{% warn %}}
+The `experimental.to()` function is subject to change at any time.
+By using it, you accept the [risks of experimental functions](/v2.0/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk).
+{{% /warn %}}
+
+```js
+import "experimental"
+
+experimental.to(
+ bucket: "my-bucket",
+ org: "my-org"
+)
+
+// OR
+
+experimental.to(
+ bucketID: "1234567890",
+ orgID: "0987654321"
+)
+```
+
+### Expected data structure
+
+#### Data structure expected by built-in to()
+The built-in `to()` function requires `_time`, `_measurement`, `_field`, and `_value` columns.
+The `_field` column stores the **field key** and the `_value` column stores the **field value**.
+
+| _time | _measurement | _field | _value |
+| ----- | ------------ | ------ | ------ |
+| timestamp | measurement-name | field key | field value |
+
+#### Data structure expected by experimental to()
+`experimental.to()` requires `_time` and `measurement` columns, but field keys
+and values are stored in single columns with the **field key** as the **column name** and
+the **field value** as the **column value**.
+
+| _time | _measurement | field_key |
+| ----- | ------------ | --------- |
+| timestamp | measurement-name | field value |
+
+If using the built-in `from()` function, use [`pivot()`](/v2.0/reference/flux/stdlib/transformations/pivot/)
+to transform data into the structure `experimetnal.to()` expects.
+_[See the example below](#use-pivot-to-shape-data-for-experimental-to)._
+
+## Parameters
+
+### bucket
+The bucket to write data to.
+`bucket` and `bucketID` are mutually exclusive.
+
+_**Data type: String**_
+
+### bucketID
+The ID of the bucket to write data to.
+`bucketID` and `bucket` are mutually exclusive.
+
+_**Data type: String**_
+
+### org
+The organization name of the specified [`bucket`](#bucket).
+Only required when writing to a different organization or a remote host.
+`org` and `orgID` are mutually exclusive.
+
+_**Data type: String**_
+
+### orgID
+The organization ID of the specified [`bucket`](#bucket).
+Only required when writing to a different organization or a remote host.
+`orgID` and `org` are mutually exclusive.
+
+_**Data type: String**_
+
+
+## Examples
+
+##### Use pivot() to shape data for experimental.to()
+```js
+import "experimental"
+
+from(bucket: "example-bucket")
+ |> range(start: -1h)
+ |> pivot(
+ rowKey:["_time"],
+ columnKey: ["_field"],
+ valueColumn: "_value")
+ |> experimental.to(
+ bucket: "bucket-name",
+ org: "org-name"
+ )
+```
diff --git a/content/v2.0/reference/flux/stdlib/http/_index.md b/content/v2.0/reference/flux/stdlib/http/_index.md
new file mode 100644
index 000000000..7145da674
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/http/_index.md
@@ -0,0 +1,24 @@
+---
+title: Flux HTTP package
+list_title: HTTP package
+description: >
+ The Flux HTTP package provides functions for transferring data using the HTTP protocol.
+ Import the `http` package.
+aliases:
+ - /v2.0/reference/flux/functions/http/
+menu:
+ v2_0_ref:
+ name: HTTP
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [functions, http, package]
+---
+
+The Flux HTTP package provides functions for transferring data using the HTTP protocol.
+Import the `http` package:
+
+```js
+import "http"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/http/basicauth.md b/content/v2.0/reference/flux/stdlib/http/basicauth.md
new file mode 100644
index 000000000..746f84ba2
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/http/basicauth.md
@@ -0,0 +1,58 @@
+---
+title: http.basicAuth() function
+description: >
+ The `http.basicAuth()` function returns a Base64-encoded basic authentication
+ header using a specified username and password combination.
+aliases:
+ - /v2.0/reference/flux/functions/http/basicauth/
+menu:
+ v2_0_ref:
+ name: http.basicAuth
+ parent: HTTP
+weight: 202
+---
+
+The `http.basicAuth()` function returns a Base64-encoded basic authentication
+header using a specified username and password combination.
+
+_**Function type:** Miscellaneous_
+
+```js
+import "http"
+
+http.basicAuth(
+ u: "username"
+ p: "passw0rd"
+)
+
+// Returns "Basic dXNlcm5hbWU6cGFzc3cwcmQ="
+```
+
+## Parameters
+
+### u
+The username to use in the basic authentication header.
+
+_**Data type:** String_
+
+### p
+The password to use in the basic authentication header.
+
+_**Data type:** String_
+
+## Examples
+
+##### Set a basic authentication header in an HTTP POST request
+```js
+import "monitor"
+import "http"
+
+username = "myawesomeuser"
+password = "mySupErSecRetPasSW0rD"
+
+http.post(
+ url: "http://myawesomesite.com/api/",
+ headers: {Authorization: http.basicAuth(u:username, p:password)},
+ data: bytes(v: "something I want to send.")
+)
+```
diff --git a/content/v2.0/reference/flux/stdlib/http/endpoint.md b/content/v2.0/reference/flux/stdlib/http/endpoint.md
new file mode 100644
index 000000000..054f6b54b
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/http/endpoint.md
@@ -0,0 +1,66 @@
+---
+title: http.endpoint() function
+description: >
+ The `http.endpoint()` function sends output data to an HTTP URL using the POST request method.
+aliases:
+ - /v2.0/reference/flux/functions/http/endpoint/
+menu:
+ v2_0_ref:
+ name: http.endpoint
+ parent: HTTP
+weight: 202
+v2.0/tags: [endpoints]
+---
+
+The `http.endpoint()` function sends output data to an HTTP URL using the POST request method.
+
+_**Function type:** Output_
+
+```js
+import "http"
+
+http.endpoint(
+ url: "http://localhost:1234/"
+)
+```
+
+## Parameters
+
+### url
+The URL to POST to.
+
+_**Data type:** String_
+
+### mapFn
+A function that builds the object used to generate the POST request.
+
+{{% note %}}
+_You should rarely need to override the default `mapFn` parameter.
+To see the default `mapFn` value or for insight into possible overrides, view the
+[`http.endpoint()` source code](https://github.com/influxdata/flux/blob/master/stdlib/http/http.flux)._
+{{% /note %}}
+
+_**Data type:** Function_
+
+The returned object must include the following fields:
+
+- `headers`
+- `data`
+
+_For more information, see [`http.post()`](/v2.0/reference/flux/stdlib/http/post/)_
+
+## Examples
+
+##### Send critical statuses to an HTTP endpoint
+```js
+import "monitor"
+import "http"
+
+endpoint = http.endpoint(url: "http://myawsomeurl.com/api/notify")
+
+from(bucket: "example-bucket")
+ |> range(start: -1m)
+ |> filter(fn: (r) => r._measurement == "statuses" and status == "crit")
+ |> map(fn: (r) => { return {status: r._status} })
+ |> monitor.notify(endpoint: endpoint)
+```
diff --git a/content/v2.0/reference/flux/stdlib/http/post.md b/content/v2.0/reference/flux/stdlib/http/post.md
new file mode 100644
index 000000000..bc694a8aa
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/http/post.md
@@ -0,0 +1,66 @@
+---
+title: http.post() function
+description: >
+ The `http.post()` function submits an HTTP POST request to the specified URL with headers and data.
+ The HTTP status code is returned.
+aliases:
+ - /v2.0/reference/flux/functions/http/post/
+menu:
+ v2_0_ref:
+ name: http.post
+ parent: HTTP
+weight: 202
+---
+
+The `http.post()` function submits an HTTP POST request to the specified URL with
+headers and data and returns the HTTP status code.
+
+_**Function type:** Output_
+
+```js
+import "http"
+
+http.post(
+ url: "http://localhost:9999/",
+ headers: {x:"a", y:"b", z:"c"},
+ data: bytes(v: "body")
+)
+```
+
+## Parameters
+
+### url
+The URL to POST to.
+
+_**Data type:** String_
+
+### headers
+Headers to include with the POST request.
+
+_**Data type:** Object_
+
+### data
+The data body to include with the POST request.
+
+_**Data type:** Bytes_
+
+## Examples
+
+##### Send the last reported status to a URL
+```js
+import "json"
+import "http"
+
+lastReported =
+ from(bucket: "example-bucket")
+ |> range(start: -1m)
+ |> filter(fn: (r) => r._measurement == "statuses")
+ |> last()
+ |> map(fn: (r) => { return {status: r._status} })
+
+http.post(
+ url: "http://myawsomeurl.com/api/notify",
+ headers: {Authorization: "Bearer mySuPerSecRetTokEn"},
+ data: bytes(v: lastReported)
+)
+```
diff --git a/content/v2.0/reference/flux/functions/influxdb-v1/_index.md b/content/v2.0/reference/flux/stdlib/influxdb-v1/_index.md
similarity index 87%
rename from content/v2.0/reference/flux/functions/influxdb-v1/_index.md
rename to content/v2.0/reference/flux/stdlib/influxdb-v1/_index.md
index 18b00d1cc..325f1e8d0 100644
--- a/content/v2.0/reference/flux/functions/influxdb-v1/_index.md
+++ b/content/v2.0/reference/flux/stdlib/influxdb-v1/_index.md
@@ -5,10 +5,12 @@ description: >
The Flux InfluxDB v1 package provides functions for managing data from an InfluxDB v1.x
database or structured using the InfluxDB v1 data structure.
Import the `influxdata/influxdb/v1` package.
+aliases:
+ - /v2.0/reference/flux/functions/influxdb-v1/
menu:
v2_0_ref:
name: InfluxDB v1
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [functions, influxdb-v1, package]
---
diff --git a/content/v2.0/reference/flux/functions/influxdb-v1/fieldsascols.md b/content/v2.0/reference/flux/stdlib/influxdb-v1/fieldsascols.md
similarity index 89%
rename from content/v2.0/reference/flux/functions/influxdb-v1/fieldsascols.md
rename to content/v2.0/reference/flux/stdlib/influxdb-v1/fieldsascols.md
index 0d7b2da64..a1596f8a6 100644
--- a/content/v2.0/reference/flux/functions/influxdb-v1/fieldsascols.md
+++ b/content/v2.0/reference/flux/stdlib/influxdb-v1/fieldsascols.md
@@ -4,6 +4,7 @@ description: The v1.fieldsAsCols() function is pivots a table and automatically
aliases:
- /v2.0/reference/flux/functions/inputs/fromrows
- /v2.0/reference/flux/functions/transformations/influxfieldsascols
+ - /v2.0/reference/flux/functions/influxdb-v1/fieldsascols/
menu:
v2_0_ref:
name: v1.fieldsAsCols
@@ -45,4 +46,4 @@ fieldsAsCols = (tables=<-) =>
```
_**Used functions:**
-[pivot()](/v2.0/reference/flux/functions/built-in/transformations/pivot)_
+[pivot()](/v2.0/reference/flux/stdlib/built-in/transformations/pivot)_
diff --git a/content/v2.0/reference/flux/functions/influxdb-v1/measurements.md b/content/v2.0/reference/flux/stdlib/influxdb-v1/measurements.md
similarity index 84%
rename from content/v2.0/reference/flux/functions/influxdb-v1/measurements.md
rename to content/v2.0/reference/flux/stdlib/influxdb-v1/measurements.md
index a13e77ae0..8ffd2b9bb 100644
--- a/content/v2.0/reference/flux/functions/influxdb-v1/measurements.md
+++ b/content/v2.0/reference/flux/stdlib/influxdb-v1/measurements.md
@@ -1,6 +1,8 @@
---
title: v1.measurements() function
description: The v1.measurements() function returns a list of measurements in a specific bucket.
+aliases:
+ - /v2.0/reference/flux/functions/influxdb-v1/measurements/
menu:
v2_0_ref:
name: v1.measurements
@@ -32,4 +34,4 @@ measurements = (bucket) =>
```
_**Used functions:**
-[tagValues()](/v2.0/reference/flux/functions/influxdb-v1/tagvalues)_
+[tagValues()](/v2.0/reference/flux/stdlib/influxdb-v1/tagvalues)_
diff --git a/content/v2.0/reference/flux/functions/influxdb-v1/measurementtagkeys.md b/content/v2.0/reference/flux/stdlib/influxdb-v1/measurementtagkeys.md
similarity index 87%
rename from content/v2.0/reference/flux/functions/influxdb-v1/measurementtagkeys.md
rename to content/v2.0/reference/flux/stdlib/influxdb-v1/measurementtagkeys.md
index dc1382b25..460908f39 100644
--- a/content/v2.0/reference/flux/functions/influxdb-v1/measurementtagkeys.md
+++ b/content/v2.0/reference/flux/stdlib/influxdb-v1/measurementtagkeys.md
@@ -1,6 +1,8 @@
---
title: v1.measurementTagKeys() function
description: The v1.measurementTagKeys() function returns a list of tag keys for a specific measurement.
+aliases:
+ - /v2.0/reference/flux/functions/influxdb-v1/measurementtagkeys/
menu:
v2_0_ref:
name: v1.measurementTagKeys
@@ -42,4 +44,4 @@ measurementTagKeys = (bucket, measurement) =>
```
_**Used functions:**
-[tagKeys()](/v2.0/reference/flux/functions/influxdb-v1/tagkeys)_
+[tagKeys()](/v2.0/reference/flux/stdlib/influxdb-v1/tagkeys)_
diff --git a/content/v2.0/reference/flux/functions/influxdb-v1/measurementtagvalues.md b/content/v2.0/reference/flux/stdlib/influxdb-v1/measurementtagvalues.md
similarity index 88%
rename from content/v2.0/reference/flux/functions/influxdb-v1/measurementtagvalues.md
rename to content/v2.0/reference/flux/stdlib/influxdb-v1/measurementtagvalues.md
index 979f07b9e..89a2281c7 100644
--- a/content/v2.0/reference/flux/functions/influxdb-v1/measurementtagvalues.md
+++ b/content/v2.0/reference/flux/stdlib/influxdb-v1/measurementtagvalues.md
@@ -1,6 +1,8 @@
---
title: v1.measurementTagValues() function
description: The v1.measurementTagValues() function returns a list of tag values for a specific measurement.
+aliases:
+ - /v2.0/reference/flux/functions/influxdb-v1/measurementtagvalues/
menu:
v2_0_ref:
name: v1.measurementTagValues
@@ -53,4 +55,4 @@ measurementTagValues = (bucket, measurement, tag) =>
```
_**Used functions:**
-[tagValues()](/v2.0/reference/flux/functions/influxdb-v1/tagvalues)_
+[tagValues()](/v2.0/reference/flux/stdlib/influxdb-v1/tagvalues)_
diff --git a/content/v2.0/reference/flux/functions/influxdb-v1/tagkeys.md b/content/v2.0/reference/flux/stdlib/influxdb-v1/tagkeys.md
similarity index 73%
rename from content/v2.0/reference/flux/functions/influxdb-v1/tagkeys.md
rename to content/v2.0/reference/flux/stdlib/influxdb-v1/tagkeys.md
index 7a65ac062..63d8a370d 100644
--- a/content/v2.0/reference/flux/functions/influxdb-v1/tagkeys.md
+++ b/content/v2.0/reference/flux/stdlib/influxdb-v1/tagkeys.md
@@ -1,6 +1,8 @@
---
title: v1.tagKeys() function
description: The v1.tagKeys() function returns a list of tag keys for all series that match the predicate.
+aliases:
+ - /v2.0/reference/flux/functions/influxdb-v1/tagkeys/
menu:
v2_0_ref:
name: v1.tagKeys
@@ -65,9 +67,9 @@ tagKeys = (bucket, predicate=(r) => true, start=-30d) =>
```
_**Used functions:**
-[from](/v2.0/reference/flux/functions/built-in/inputs/from/),
-[range](/v2.0/reference/flux/functions/built-in/transformations/range/),
-[filter](/v2.0/reference/flux/functions/built-in/transformations/filter/),
-[keys](/v2.0/reference/flux/functions/built-in/transformations/keys/),
-[keep](/v2.0/reference/flux/functions/built-in/transformations/keep/),
-[distinct](/v2.0/reference/flux/functions/built-in/transformations/selectors/distinct/)_
+[from](/v2.0/reference/flux/stdlib/built-in/inputs/from/),
+[range](/v2.0/reference/flux/stdlib/built-in/transformations/range/),
+[filter](/v2.0/reference/flux/stdlib/built-in/transformations/filter/),
+[keys](/v2.0/reference/flux/stdlib/built-in/transformations/keys/),
+[keep](/v2.0/reference/flux/stdlib/built-in/transformations/keep/),
+[distinct](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct/)_
diff --git a/content/v2.0/reference/flux/functions/influxdb-v1/tagvalues.md b/content/v2.0/reference/flux/stdlib/influxdb-v1/tagvalues.md
similarity index 74%
rename from content/v2.0/reference/flux/functions/influxdb-v1/tagvalues.md
rename to content/v2.0/reference/flux/stdlib/influxdb-v1/tagvalues.md
index 7db47cb88..51266ccce 100644
--- a/content/v2.0/reference/flux/functions/influxdb-v1/tagvalues.md
+++ b/content/v2.0/reference/flux/stdlib/influxdb-v1/tagvalues.md
@@ -1,6 +1,8 @@
---
title: v1.tagValues() function
description: The `v1.tagValues()` function returns a list unique values for a given tag.
+aliases:
+ - /v2.0/reference/flux/functions/influxdb-v1/tagvalues/
menu:
v2_0_ref:
name: v1.tagValues
@@ -73,9 +75,9 @@ tagValues = (bucket, tag, predicate=(r) => true, start=-30d) =>
```
_**Used functions:**
-[from](/v2.0/reference/flux/functions/built-in/inputs/from/),
-[range](/v2.0/reference/flux/functions/built-in/transformations/range/),
-[filter](/v2.0/reference/flux/functions/built-in/transformations/filter/),
-[group](/v2.0/reference/flux/functions/built-in/transformations/group/),
-[distinct](/v2.0/reference/flux/functions/built-in/transformations/selectors/distinct/),
-[keep](/v2.0/reference/flux/functions/built-in/transformations/keep/)_
+[from](/v2.0/reference/flux/stdlib/built-in/inputs/from/),
+[range](/v2.0/reference/flux/stdlib/built-in/transformations/range/),
+[filter](/v2.0/reference/flux/stdlib/built-in/transformations/filter/),
+[group](/v2.0/reference/flux/stdlib/built-in/transformations/group/),
+[distinct](/v2.0/reference/flux/stdlib/built-in/transformations/selectors/distinct/),
+[keep](/v2.0/reference/flux/stdlib/built-in/transformations/keep/)_
diff --git a/content/v2.0/reference/flux/stdlib/json/_index.md b/content/v2.0/reference/flux/stdlib/json/_index.md
new file mode 100644
index 000000000..00d4e266c
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/json/_index.md
@@ -0,0 +1,24 @@
+---
+title: Flux JSON package
+list_title: JSON package
+description: >
+ The Flux JSON package provides functions for working with JSON.
+ Import the `json` package.
+aliases:
+ - /v2.0/reference/flux/functions/json/
+menu:
+ v2_0_ref:
+ name: JSON
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [functions, json, package]
+---
+
+JSON Flux functions provide tools for working with JSON.
+Import the `json` package:
+
+```js
+import "json"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/json/encode.md b/content/v2.0/reference/flux/stdlib/json/encode.md
new file mode 100644
index 000000000..0c6f42cd9
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/json/encode.md
@@ -0,0 +1,49 @@
+---
+title: json.encode() function
+description: The `json.encode()` function converts a value into JSON bytes.
+aliases:
+ - /v2.0/reference/flux/functions/json/encode/
+menu:
+ v2_0_ref:
+ name: json.encode
+ parent: JSON
+weight: 202
+---
+
+The `json.encode()` function converts a value into JSON bytes.
+
+_**Function type:** Type conversion_
+
+```js
+import "json"
+
+json.encode(v: "some value")
+```
+
+This function encodes [Flux types](/v2.0/reference/flux/language/types/) as follows:
+
+- `time` values in [RFC3339](https://tools.ietf.org/html/rfc3339) format
+- `duration` values in number of milliseconds since the epoch
+- `regexp` values as their string representation
+- `bytes` values as base64-encoded strings
+- `function` values are not encoded and produce an error
+
+## Parameters
+
+### v
+The value to convert.
+
+_**Data type:** Boolean | Duration | Float | Integer | String | Time | UInteger_
+
+## Examples
+
+### Encode all values in a column in JSON bytes
+```js
+import "json"
+
+from(bucket: "example-bucket")
+ |> range(start: -1h)
+ |> map(fn: (r) => ({
+ r with _value: json.encode(v: r._value)
+ }))
+```
diff --git a/content/v2.0/reference/flux/functions/math/_index.md b/content/v2.0/reference/flux/stdlib/math/_index.md
similarity index 95%
rename from content/v2.0/reference/flux/functions/math/_index.md
rename to content/v2.0/reference/flux/stdlib/math/_index.md
index bb0ef8f25..1ad8fa2fb 100644
--- a/content/v2.0/reference/flux/functions/math/_index.md
+++ b/content/v2.0/reference/flux/stdlib/math/_index.md
@@ -4,10 +4,12 @@ list_title: Math package
description: >
The Flux math package provides basic constants and mathematical functions.
Import the `math` package.
+aliases:
+ - /v2.0/reference/flux/functions/math/
menu:
v2_0_ref:
name: Math
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [math, functions]
---
diff --git a/content/v2.0/reference/flux/functions/math/abs.md b/content/v2.0/reference/flux/stdlib/math/abs.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/abs.md
rename to content/v2.0/reference/flux/stdlib/math/abs.md
index 8db0c56b7..ac946c108 100644
--- a/content/v2.0/reference/flux/functions/math/abs.md
+++ b/content/v2.0/reference/flux/stdlib/math/abs.md
@@ -1,6 +1,8 @@
---
title: math.abs() function
description: The math.abs() function returns the absolute value of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/abs/
menu:
v2_0_ref:
name: math.abs
diff --git a/content/v2.0/reference/flux/functions/math/acos.md b/content/v2.0/reference/flux/stdlib/math/acos.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/acos.md
rename to content/v2.0/reference/flux/stdlib/math/acos.md
index 5b6b88fd8..528edc827 100644
--- a/content/v2.0/reference/flux/functions/math/acos.md
+++ b/content/v2.0/reference/flux/stdlib/math/acos.md
@@ -1,6 +1,8 @@
---
title: math.acos() function
description: The math.acos() function returns the arccosine of `x` in radians.
+aliases:
+ - /v2.0/reference/flux/functions/math/acos/
menu:
v2_0_ref:
name: math.acos
diff --git a/content/v2.0/reference/flux/functions/math/acosh.md b/content/v2.0/reference/flux/stdlib/math/acosh.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/acosh.md
rename to content/v2.0/reference/flux/stdlib/math/acosh.md
index 95cead337..80ccad2c2 100644
--- a/content/v2.0/reference/flux/functions/math/acosh.md
+++ b/content/v2.0/reference/flux/stdlib/math/acosh.md
@@ -1,6 +1,8 @@
---
title: math.acosh() function
description: The math.acosh() function returns the inverse hyperbolic cosine of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/acosh/
menu:
v2_0_ref:
name: math.acosh
diff --git a/content/v2.0/reference/flux/functions/math/asin.md b/content/v2.0/reference/flux/stdlib/math/asin.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/asin.md
rename to content/v2.0/reference/flux/stdlib/math/asin.md
index 614e12174..9e667f686 100644
--- a/content/v2.0/reference/flux/functions/math/asin.md
+++ b/content/v2.0/reference/flux/stdlib/math/asin.md
@@ -1,6 +1,8 @@
---
title: math.asin() function
description: The math.asin() function returns the arcsine of `x` in radians.
+aliases:
+ - /v2.0/reference/flux/functions/math/asin/
menu:
v2_0_ref:
name: math.asin
diff --git a/content/v2.0/reference/flux/functions/math/asinh.md b/content/v2.0/reference/flux/stdlib/math/asinh.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/asinh.md
rename to content/v2.0/reference/flux/stdlib/math/asinh.md
index 9800d3ad0..4ff4ca9bc 100644
--- a/content/v2.0/reference/flux/functions/math/asinh.md
+++ b/content/v2.0/reference/flux/stdlib/math/asinh.md
@@ -1,6 +1,8 @@
---
title: math.asinh() function
description: The math.asinh() function returns the inverse hyperbolic sine of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/asinh/
menu:
v2_0_ref:
name: math.asinh
diff --git a/content/v2.0/reference/flux/functions/math/atan.md b/content/v2.0/reference/flux/stdlib/math/atan.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/atan.md
rename to content/v2.0/reference/flux/stdlib/math/atan.md
index 524a3fe96..77a360dc1 100644
--- a/content/v2.0/reference/flux/functions/math/atan.md
+++ b/content/v2.0/reference/flux/stdlib/math/atan.md
@@ -1,6 +1,8 @@
---
title: math.atan() function
description: The math.atan() function returns the arctangent of `x` in radians.
+aliases:
+ - /v2.0/reference/flux/functions/math/atan/
menu:
v2_0_ref:
name: math.atan
diff --git a/content/v2.0/reference/flux/functions/math/atan2.md b/content/v2.0/reference/flux/stdlib/math/atan2.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/math/atan2.md
rename to content/v2.0/reference/flux/stdlib/math/atan2.md
index 1556dcbf5..69049aafc 100644
--- a/content/v2.0/reference/flux/functions/math/atan2.md
+++ b/content/v2.0/reference/flux/stdlib/math/atan2.md
@@ -3,6 +3,8 @@ title: math.atan2() function
description: >
The math.atan2() function returns the arc tangent of `y`/`x`, using the signs of
the parameters to determine the quadrant of the return value.
+aliases:
+ - /v2.0/reference/flux/functions/math/atan2/
menu:
v2_0_ref:
name: math.atan2
diff --git a/content/v2.0/reference/flux/functions/math/atanh.md b/content/v2.0/reference/flux/stdlib/math/atanh.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/atanh.md
rename to content/v2.0/reference/flux/stdlib/math/atanh.md
index d3a551543..ea01f337a 100644
--- a/content/v2.0/reference/flux/functions/math/atanh.md
+++ b/content/v2.0/reference/flux/stdlib/math/atanh.md
@@ -1,6 +1,8 @@
---
title: math.atanh() function
description: The math.atanh() function returns the inverse hyperbolic tangent of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/atanh/
menu:
v2_0_ref:
name: math.atanh
diff --git a/content/v2.0/reference/flux/functions/math/cbrt.md b/content/v2.0/reference/flux/stdlib/math/cbrt.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/cbrt.md
rename to content/v2.0/reference/flux/stdlib/math/cbrt.md
index 6054dacf3..f7018bb68 100644
--- a/content/v2.0/reference/flux/functions/math/cbrt.md
+++ b/content/v2.0/reference/flux/stdlib/math/cbrt.md
@@ -1,6 +1,8 @@
---
title: math.cbrt() function
description: The math.cbrt() function returns the cube root of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/cbrt/
menu:
v2_0_ref:
name: math.cbrt
diff --git a/content/v2.0/reference/flux/functions/math/ceil.md b/content/v2.0/reference/flux/stdlib/math/ceil.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/ceil.md
rename to content/v2.0/reference/flux/stdlib/math/ceil.md
index 091ffbedb..397fd53e3 100644
--- a/content/v2.0/reference/flux/functions/math/ceil.md
+++ b/content/v2.0/reference/flux/stdlib/math/ceil.md
@@ -1,6 +1,8 @@
---
title: math.ceil() function
description: The math.ceil() function returns the least integer value greater than or equal to `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/ceil/
menu:
v2_0_ref:
name: math.ceil
diff --git a/content/v2.0/reference/flux/functions/math/copysign.md b/content/v2.0/reference/flux/stdlib/math/copysign.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/copysign.md
rename to content/v2.0/reference/flux/stdlib/math/copysign.md
index 26466573f..ecc4b0267 100644
--- a/content/v2.0/reference/flux/functions/math/copysign.md
+++ b/content/v2.0/reference/flux/stdlib/math/copysign.md
@@ -1,6 +1,8 @@
---
title: math.copysign() function
description: The math.copysign() function returns a value with the magnitude of `x` and the sign of `y`.
+aliases:
+ - /v2.0/reference/flux/functions/math/copysign/
menu:
v2_0_ref:
name: math.copysign
diff --git a/content/v2.0/reference/flux/functions/math/cos.md b/content/v2.0/reference/flux/stdlib/math/cos.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/cos.md
rename to content/v2.0/reference/flux/stdlib/math/cos.md
index 7c1b6bd2f..f06e07a50 100644
--- a/content/v2.0/reference/flux/functions/math/cos.md
+++ b/content/v2.0/reference/flux/stdlib/math/cos.md
@@ -1,6 +1,8 @@
---
title: math.cos() function
description: The math.cos() function returns the cosine of the radian argument `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/cos/
menu:
v2_0_ref:
name: math.cos
diff --git a/content/v2.0/reference/flux/functions/math/cosh.md b/content/v2.0/reference/flux/stdlib/math/cosh.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/cosh.md
rename to content/v2.0/reference/flux/stdlib/math/cosh.md
index 22fff8771..a23477022 100644
--- a/content/v2.0/reference/flux/functions/math/cosh.md
+++ b/content/v2.0/reference/flux/stdlib/math/cosh.md
@@ -1,6 +1,8 @@
---
title: math.cosh() function
description: The math.cosh() function returns the hyperbolic cosine of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/cosh/
menu:
v2_0_ref:
name: math.cosh
diff --git a/content/v2.0/reference/flux/functions/math/dim.md b/content/v2.0/reference/flux/stdlib/math/dim.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/dim.md
rename to content/v2.0/reference/flux/stdlib/math/dim.md
index b52a3c8b2..135bb4356 100644
--- a/content/v2.0/reference/flux/functions/math/dim.md
+++ b/content/v2.0/reference/flux/stdlib/math/dim.md
@@ -1,6 +1,8 @@
---
title: math.dim() function
description: The math.dim() function returns the maximum of `x`-`y` or 0.
+aliases:
+ - /v2.0/reference/flux/functions/math/dim/
menu:
v2_0_ref:
name: math.dim
diff --git a/content/v2.0/reference/flux/functions/math/erf.md b/content/v2.0/reference/flux/stdlib/math/erf.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/erf.md
rename to content/v2.0/reference/flux/stdlib/math/erf.md
index ebc8cca16..18c23441e 100644
--- a/content/v2.0/reference/flux/functions/math/erf.md
+++ b/content/v2.0/reference/flux/stdlib/math/erf.md
@@ -1,6 +1,8 @@
---
title: math.erf() function
description: The math.erf() function returns the error function of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/erf/
menu:
v2_0_ref:
name: math.erf
diff --git a/content/v2.0/reference/flux/functions/math/erfc.md b/content/v2.0/reference/flux/stdlib/math/erfc.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/erfc.md
rename to content/v2.0/reference/flux/stdlib/math/erfc.md
index a2a7e2ac5..176ccd6bb 100644
--- a/content/v2.0/reference/flux/functions/math/erfc.md
+++ b/content/v2.0/reference/flux/stdlib/math/erfc.md
@@ -1,6 +1,8 @@
---
title: math.erfc() function
description: The math.erfc() function returns the complementary error function of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/erfc/
menu:
v2_0_ref:
name: math.erfc
diff --git a/content/v2.0/reference/flux/functions/math/erfcinv.md b/content/v2.0/reference/flux/stdlib/math/erfcinv.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/erfcinv.md
rename to content/v2.0/reference/flux/stdlib/math/erfcinv.md
index c5f2c473f..4a1ba079e 100644
--- a/content/v2.0/reference/flux/functions/math/erfcinv.md
+++ b/content/v2.0/reference/flux/stdlib/math/erfcinv.md
@@ -1,6 +1,8 @@
---
title: math.erfcinv() function
description: The math.erfcinv() function returns the inverse of `math.erfc()`.
+aliases:
+ - /v2.0/reference/flux/functions/math/erfcinv/
menu:
v2_0_ref:
name: math.erfcinv
diff --git a/content/v2.0/reference/flux/functions/math/erfinv.md b/content/v2.0/reference/flux/stdlib/math/erfinv.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/erfinv.md
rename to content/v2.0/reference/flux/stdlib/math/erfinv.md
index 2c4511397..1abdc350c 100644
--- a/content/v2.0/reference/flux/functions/math/erfinv.md
+++ b/content/v2.0/reference/flux/stdlib/math/erfinv.md
@@ -1,6 +1,8 @@
---
title: math.erfinv() function
description: The math.erfinv() function returns the inverse error function of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/erfinv/
menu:
v2_0_ref:
name: math.erfinv
diff --git a/content/v2.0/reference/flux/functions/math/exp.md b/content/v2.0/reference/flux/stdlib/math/exp.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/exp.md
rename to content/v2.0/reference/flux/stdlib/math/exp.md
index 14228533a..5d530b556 100644
--- a/content/v2.0/reference/flux/functions/math/exp.md
+++ b/content/v2.0/reference/flux/stdlib/math/exp.md
@@ -1,6 +1,8 @@
---
title: math.exp() function
description: The math.exp() function returns `e**x`, the base-e exponential of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/exp/
menu:
v2_0_ref:
name: math.exp
diff --git a/content/v2.0/reference/flux/functions/math/exp2.md b/content/v2.0/reference/flux/stdlib/math/exp2.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/exp2.md
rename to content/v2.0/reference/flux/stdlib/math/exp2.md
index d66b572d0..599bf86ff 100644
--- a/content/v2.0/reference/flux/functions/math/exp2.md
+++ b/content/v2.0/reference/flux/stdlib/math/exp2.md
@@ -1,6 +1,8 @@
---
title: math.exp2() function
description: The math.exp2() function returns `2**x`, the base-2 exponential of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/exp2/
menu:
v2_0_ref:
name: math.exp2
diff --git a/content/v2.0/reference/flux/functions/math/expm1.md b/content/v2.0/reference/flux/stdlib/math/expm1.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/expm1.md
rename to content/v2.0/reference/flux/stdlib/math/expm1.md
index 953926420..02df8ce1a 100644
--- a/content/v2.0/reference/flux/functions/math/expm1.md
+++ b/content/v2.0/reference/flux/stdlib/math/expm1.md
@@ -3,6 +3,8 @@ title: math.expm1() function
description: >
The math.expm1() function returns `e**x - 1`, the base-e exponential of `x` minus 1.
It is more accurate than `math.exp(x:x) - 1` when `x` is near zero.
+aliases:
+ - /v2.0/reference/flux/functions/math/expm1/
menu:
v2_0_ref:
name: math.expm1
diff --git a/content/v2.0/reference/flux/functions/math/float64bits.md b/content/v2.0/reference/flux/stdlib/math/float64bits.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/float64bits.md
rename to content/v2.0/reference/flux/stdlib/math/float64bits.md
index 95a16dcb9..20d233052 100644
--- a/content/v2.0/reference/flux/functions/math/float64bits.md
+++ b/content/v2.0/reference/flux/stdlib/math/float64bits.md
@@ -1,6 +1,8 @@
---
title: math.float64bits() function
description: The math.float64bits() function returns the IEEE 754 binary representation of `f`, with the sign bit of `f` and the result in the same bit position.
+aliases:
+ - /v2.0/reference/flux/functions/math/float64bits/
menu:
v2_0_ref:
name: math.float64bits
diff --git a/content/v2.0/reference/flux/functions/math/floor.md b/content/v2.0/reference/flux/stdlib/math/floor.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/floor.md
rename to content/v2.0/reference/flux/stdlib/math/floor.md
index bea8631d9..4e87ee103 100644
--- a/content/v2.0/reference/flux/functions/math/floor.md
+++ b/content/v2.0/reference/flux/stdlib/math/floor.md
@@ -1,6 +1,8 @@
---
title: math.floor() function
description: The math.floor() function returns the greatest integer value less than or equal to `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/floor/
menu:
v2_0_ref:
name: math.floor
diff --git a/content/v2.0/reference/flux/functions/math/frexp.md b/content/v2.0/reference/flux/stdlib/math/frexp.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/math/frexp.md
rename to content/v2.0/reference/flux/stdlib/math/frexp.md
index 622a1006c..6b4a043f7 100644
--- a/content/v2.0/reference/flux/functions/math/frexp.md
+++ b/content/v2.0/reference/flux/stdlib/math/frexp.md
@@ -4,6 +4,8 @@ description: >
The math.frexp() function breaks `f` into a normalized fraction and an integral power of two.
It returns `frac` and `exp` satisfying `f == frac × 2**exp`, with the absolute
value of `frac` in the interval [½, 1).
+aliases:
+ - /v2.0/reference/flux/functions/math/frexp/
menu:
v2_0_ref:
name: math.frexp
diff --git a/content/v2.0/reference/flux/functions/math/gamma.md b/content/v2.0/reference/flux/stdlib/math/gamma.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/gamma.md
rename to content/v2.0/reference/flux/stdlib/math/gamma.md
index 744d5cdc8..81fb2f936 100644
--- a/content/v2.0/reference/flux/functions/math/gamma.md
+++ b/content/v2.0/reference/flux/stdlib/math/gamma.md
@@ -1,6 +1,8 @@
---
title: math.gamma() function
description: The math.gamma() function returns the Gamma function of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/gamma/
menu:
v2_0_ref:
name: math.gamma
diff --git a/content/v2.0/reference/flux/functions/math/hypot.md b/content/v2.0/reference/flux/stdlib/math/hypot.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/hypot.md
rename to content/v2.0/reference/flux/stdlib/math/hypot.md
index c9d6af266..459f83f31 100644
--- a/content/v2.0/reference/flux/functions/math/hypot.md
+++ b/content/v2.0/reference/flux/stdlib/math/hypot.md
@@ -3,6 +3,8 @@ title: math.hypot() function
description: >
The math.hypot() function returns the square root of `p*p + q*q`,
taking care to avoid unnecessary overflow and underflow.
+aliases:
+ - /v2.0/reference/flux/functions/math/hypot/
menu:
v2_0_ref:
name: math.hypot
diff --git a/content/v2.0/reference/flux/functions/math/ilogb.md b/content/v2.0/reference/flux/stdlib/math/ilogb.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/ilogb.md
rename to content/v2.0/reference/flux/stdlib/math/ilogb.md
index 22b87b558..ec18d023c 100644
--- a/content/v2.0/reference/flux/functions/math/ilogb.md
+++ b/content/v2.0/reference/flux/stdlib/math/ilogb.md
@@ -1,6 +1,8 @@
---
title: math.ilogb() function
description: The math.ilogb() function returns the binary exponent of `x` as an integer.
+aliases:
+ - /v2.0/reference/flux/functions/math/ilogb/
menu:
v2_0_ref:
name: math.ilogb
diff --git a/content/v2.0/reference/flux/functions/math/isinf.md b/content/v2.0/reference/flux/stdlib/math/isinf.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/isinf.md
rename to content/v2.0/reference/flux/stdlib/math/isinf.md
index 900dc54cf..e1d69151b 100644
--- a/content/v2.0/reference/flux/functions/math/isinf.md
+++ b/content/v2.0/reference/flux/stdlib/math/isinf.md
@@ -1,6 +1,8 @@
---
title: math.isInf() function
description: The math.isInf() function reports whether `f` is an infinity, according to `sign`.
+aliases:
+ - /v2.0/reference/flux/functions/math/isinf/
menu:
v2_0_ref:
name: math.isInf
diff --git a/content/v2.0/reference/flux/functions/math/isnan.md b/content/v2.0/reference/flux/stdlib/math/isnan.md
similarity index 89%
rename from content/v2.0/reference/flux/functions/math/isnan.md
rename to content/v2.0/reference/flux/stdlib/math/isnan.md
index dfcf73ae1..f2736f93e 100644
--- a/content/v2.0/reference/flux/functions/math/isnan.md
+++ b/content/v2.0/reference/flux/stdlib/math/isnan.md
@@ -1,6 +1,8 @@
---
title: math.isNaN() function
description: The math.isNaN() function reports whether `f` is an IEEE 754 “not-a-number” value.
+aliases:
+ - /v2.0/reference/flux/functions/math/isnan/
menu:
v2_0_ref:
name: math.isNaN
@@ -26,8 +28,3 @@ math.isNaN(f: 12.345)
The value used in the evaluation.
_**Data type:** Float_
-
-## Special cases
-```js
-
-```
diff --git a/content/v2.0/reference/flux/functions/math/j0.md b/content/v2.0/reference/flux/stdlib/math/j0.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/j0.md
rename to content/v2.0/reference/flux/stdlib/math/j0.md
index 74338fd03..1d8faf6fe 100644
--- a/content/v2.0/reference/flux/functions/math/j0.md
+++ b/content/v2.0/reference/flux/stdlib/math/j0.md
@@ -1,6 +1,8 @@
---
title: math.j0() function
description: The math.j0() function returns the order-zero Bessel function of the first kind.
+aliases:
+ - /v2.0/reference/flux/functions/math/j0/
menu:
v2_0_ref:
name: math.j0
diff --git a/content/v2.0/reference/flux/functions/math/j1.md b/content/v2.0/reference/flux/stdlib/math/j1.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/j1.md
rename to content/v2.0/reference/flux/stdlib/math/j1.md
index 594b3c81d..0160d3915 100644
--- a/content/v2.0/reference/flux/functions/math/j1.md
+++ b/content/v2.0/reference/flux/stdlib/math/j1.md
@@ -1,6 +1,8 @@
---
title: math.j1() function
description: The math.j1() function returns the order-one Bessel function of the first kind.
+aliases:
+ - /v2.0/reference/flux/functions/math/j1/
menu:
v2_0_ref:
name: math.j1
diff --git a/content/v2.0/reference/flux/functions/math/jn.md b/content/v2.0/reference/flux/stdlib/math/jn.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/jn.md
rename to content/v2.0/reference/flux/stdlib/math/jn.md
index 80e0f6acf..2bda3bc79 100644
--- a/content/v2.0/reference/flux/functions/math/jn.md
+++ b/content/v2.0/reference/flux/stdlib/math/jn.md
@@ -1,6 +1,8 @@
---
title: math.jn() function
description: The math.jn() function returns the order-n Bessel function of the first kind.
+aliases:
+ - /v2.0/reference/flux/functions/math/jn/
menu:
v2_0_ref:
name: math.jn
diff --git a/content/v2.0/reference/flux/functions/math/ldexp.md b/content/v2.0/reference/flux/stdlib/math/ldexp.md
similarity index 88%
rename from content/v2.0/reference/flux/functions/math/ldexp.md
rename to content/v2.0/reference/flux/stdlib/math/ldexp.md
index 8ecfb26eb..9213320a7 100644
--- a/content/v2.0/reference/flux/functions/math/ldexp.md
+++ b/content/v2.0/reference/flux/stdlib/math/ldexp.md
@@ -1,6 +1,8 @@
---
title: math.ldexp() function
description: The math.ldexp() function is the inverse of `math.frexp()`. It returns `frac × 2**exp`.
+aliases:
+ - /v2.0/reference/flux/functions/math/ldexp/
menu:
v2_0_ref:
name: math.ldexp
@@ -8,7 +10,7 @@ menu:
weight: 301
---
-The `math.ldexp()` function is the inverse of [`math.frexp()`](/v2.0/reference/flux/functions/math/frexp).
+The `math.ldexp()` function is the inverse of [`math.frexp()`](/v2.0/reference/flux/stdlib/math/frexp).
It returns `frac × 2**exp`.
_**Output data type:** Float_
diff --git a/content/v2.0/reference/flux/functions/math/lgamma.md b/content/v2.0/reference/flux/stdlib/math/lgamma.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/lgamma.md
rename to content/v2.0/reference/flux/stdlib/math/lgamma.md
index 2be3b19e5..327505a88 100644
--- a/content/v2.0/reference/flux/functions/math/lgamma.md
+++ b/content/v2.0/reference/flux/stdlib/math/lgamma.md
@@ -1,6 +1,8 @@
---
title: math.lgamma() function
description: The math.lgamma() function returns the natural logarithm and sign (-1 or +1) of `math.gamma(x:x)`.
+aliases:
+ - /v2.0/reference/flux/functions/math/lgamma/
menu:
v2_0_ref:
name: math.lgamma
diff --git a/content/v2.0/reference/flux/functions/math/log.md b/content/v2.0/reference/flux/stdlib/math/log.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/log.md
rename to content/v2.0/reference/flux/stdlib/math/log.md
index 84eb17fc8..8e2672f6d 100644
--- a/content/v2.0/reference/flux/functions/math/log.md
+++ b/content/v2.0/reference/flux/stdlib/math/log.md
@@ -1,6 +1,8 @@
---
title: math.log() function
description: The math.log() function returns the natural logarithm of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/log/
menu:
v2_0_ref:
name: math.log
diff --git a/content/v2.0/reference/flux/functions/math/log10.md b/content/v2.0/reference/flux/stdlib/math/log10.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/log10.md
rename to content/v2.0/reference/flux/stdlib/math/log10.md
index 1b3a7ed72..7f6ab2843 100644
--- a/content/v2.0/reference/flux/functions/math/log10.md
+++ b/content/v2.0/reference/flux/stdlib/math/log10.md
@@ -1,6 +1,8 @@
---
title: math.log10() function
description: The math.log10() function returns the decimal logarithm of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/log10/
menu:
v2_0_ref:
name: math.log10
diff --git a/content/v2.0/reference/flux/functions/math/log1p.md b/content/v2.0/reference/flux/stdlib/math/log1p.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/log1p.md
rename to content/v2.0/reference/flux/stdlib/math/log1p.md
index 463ccc078..a5ced2f8b 100644
--- a/content/v2.0/reference/flux/functions/math/log1p.md
+++ b/content/v2.0/reference/flux/stdlib/math/log1p.md
@@ -3,6 +3,8 @@ title: math.log1p() function
description: >
The math.log1p() function returns the natural logarithm of 1 plus its argument `x`.
It is more accurate than `math.log(x: 1 + x)` when `x` is near zero.
+aliases:
+ - /v2.0/reference/flux/functions/math/log1p/
menu:
v2_0_ref:
name: math.log1p
diff --git a/content/v2.0/reference/flux/functions/math/log2.md b/content/v2.0/reference/flux/stdlib/math/log2.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/log2.md
rename to content/v2.0/reference/flux/stdlib/math/log2.md
index a44fd54f0..f61944d2f 100644
--- a/content/v2.0/reference/flux/functions/math/log2.md
+++ b/content/v2.0/reference/flux/stdlib/math/log2.md
@@ -1,6 +1,8 @@
---
title: math.log2() function
description: The math.log2() function returns the binary logarithm of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/log2/
menu:
v2_0_ref:
name: math.log2
diff --git a/content/v2.0/reference/flux/functions/math/logb.md b/content/v2.0/reference/flux/stdlib/math/logb.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/logb.md
rename to content/v2.0/reference/flux/stdlib/math/logb.md
index cd5049a70..313c116be 100644
--- a/content/v2.0/reference/flux/functions/math/logb.md
+++ b/content/v2.0/reference/flux/stdlib/math/logb.md
@@ -1,6 +1,8 @@
---
title: math.logb() function
description: The math.logb() function returns the binary exponent of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/logb/
menu:
v2_0_ref:
name: math.logb
diff --git a/content/v2.0/reference/flux/functions/math/m_inf.md b/content/v2.0/reference/flux/stdlib/math/m_inf.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/m_inf.md
rename to content/v2.0/reference/flux/stdlib/math/m_inf.md
index da77b79ec..91aa392ec 100644
--- a/content/v2.0/reference/flux/functions/math/m_inf.md
+++ b/content/v2.0/reference/flux/stdlib/math/m_inf.md
@@ -1,8 +1,8 @@
---
title: math.m_inf() function
description: The math.m_inf() function returns positive infinity if `sign >= 0`, negative infinity if `sign < 0`.
-
-
+aliases:
+ - /v2.0/reference/flux/functions/math/m_inf/
menu:
v2_0_ref:
name: math.m_inf
diff --git a/content/v2.0/reference/flux/functions/math/m_max.md b/content/v2.0/reference/flux/stdlib/math/m_max.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/m_max.md
rename to content/v2.0/reference/flux/stdlib/math/m_max.md
index 3dd4c422e..408f3bc33 100644
--- a/content/v2.0/reference/flux/functions/math/m_max.md
+++ b/content/v2.0/reference/flux/stdlib/math/m_max.md
@@ -1,6 +1,8 @@
---
title: math.m_max() function
description: The math.m_max() function returns the larger of `x` or `y`.
+aliases:
+ - /v2.0/reference/flux/functions/math/m_max/
menu:
v2_0_ref:
name: math.m_max
diff --git a/content/v2.0/reference/flux/functions/math/m_min.md b/content/v2.0/reference/flux/stdlib/math/m_min.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/m_min.md
rename to content/v2.0/reference/flux/stdlib/math/m_min.md
index 404982967..ef12e6cb1 100644
--- a/content/v2.0/reference/flux/functions/math/m_min.md
+++ b/content/v2.0/reference/flux/stdlib/math/m_min.md
@@ -1,6 +1,8 @@
---
title: math.m_min() function
description: The math.m_min() function returns the smaller of `x` or `y`.
+aliases:
+ - /v2.0/reference/flux/functions/math/m_min/
menu:
v2_0_ref:
name: math.m_min
diff --git a/content/v2.0/reference/flux/functions/math/mod.md b/content/v2.0/reference/flux/stdlib/math/mod.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/math/mod.md
rename to content/v2.0/reference/flux/stdlib/math/mod.md
index e23493865..afef0a1ba 100644
--- a/content/v2.0/reference/flux/functions/math/mod.md
+++ b/content/v2.0/reference/flux/stdlib/math/mod.md
@@ -3,6 +3,8 @@ title: math.mod() function
description: >
The math.mod() function returns the floating-point remainder of `x`/`y`.
The magnitude of the result is less than `y` and its sign agrees with that of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/mod/
menu:
v2_0_ref:
name: math.mod
diff --git a/content/v2.0/reference/flux/functions/math/modf.md b/content/v2.0/reference/flux/stdlib/math/modf.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/modf.md
rename to content/v2.0/reference/flux/stdlib/math/modf.md
index 78e4ef7fd..94cf32fe9 100644
--- a/content/v2.0/reference/flux/functions/math/modf.md
+++ b/content/v2.0/reference/flux/stdlib/math/modf.md
@@ -3,6 +3,8 @@ title: math.modf() function
description: >
The math.modf() function returns integer and fractional floating-point numbers that sum to `f`.
Both values have the same sign as `f`.
+aliases:
+ - /v2.0/reference/flux/functions/math/modf/
menu:
v2_0_ref:
name: math.modf
diff --git a/content/v2.0/reference/flux/functions/math/nan.md b/content/v2.0/reference/flux/stdlib/math/nan.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/math/nan.md
rename to content/v2.0/reference/flux/stdlib/math/nan.md
index ebb54f06b..714f3f676 100644
--- a/content/v2.0/reference/flux/functions/math/nan.md
+++ b/content/v2.0/reference/flux/stdlib/math/nan.md
@@ -1,6 +1,8 @@
---
title: math.NaN() function
description: The math.NaN() function returns an IEEE 754 “not-a-number” value.
+aliases:
+ - /v2.0/reference/flux/functions/math/nan/
menu:
v2_0_ref:
name: math.NaN
diff --git a/content/v2.0/reference/flux/functions/math/nextafter.md b/content/v2.0/reference/flux/stdlib/math/nextafter.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/nextafter.md
rename to content/v2.0/reference/flux/stdlib/math/nextafter.md
index bb6f0ae27..21810bda2 100644
--- a/content/v2.0/reference/flux/functions/math/nextafter.md
+++ b/content/v2.0/reference/flux/stdlib/math/nextafter.md
@@ -1,6 +1,8 @@
---
title: math.nextafter() function
description: The math.nextafter() function returns the next representable float value after `x` towards `y`.
+aliases:
+ - /v2.0/reference/flux/functions/math/nextafter/
menu:
v2_0_ref:
name: math.nextafter
diff --git a/content/v2.0/reference/flux/functions/math/pow.md b/content/v2.0/reference/flux/stdlib/math/pow.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/math/pow.md
rename to content/v2.0/reference/flux/stdlib/math/pow.md
index 3921a8fa1..af935c750 100644
--- a/content/v2.0/reference/flux/functions/math/pow.md
+++ b/content/v2.0/reference/flux/stdlib/math/pow.md
@@ -1,6 +1,8 @@
---
title: math.pow() function
description: The math.pow() function returns `x**y`, the base-x exponential of y.
+aliases:
+ - /v2.0/reference/flux/functions/math/pow/
menu:
v2_0_ref:
name: math.pow
diff --git a/content/v2.0/reference/flux/functions/math/pow10.md b/content/v2.0/reference/flux/stdlib/math/pow10.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/pow10.md
rename to content/v2.0/reference/flux/stdlib/math/pow10.md
index bfd8f1f63..234fb5e5b 100644
--- a/content/v2.0/reference/flux/functions/math/pow10.md
+++ b/content/v2.0/reference/flux/stdlib/math/pow10.md
@@ -1,6 +1,8 @@
---
title: math.pow10() function
description: The math.pow10() function returns `10**n`, the base-10 exponential of `n`.
+aliases:
+ - /v2.0/reference/flux/functions/math/pow10/
menu:
v2_0_ref:
name: math.pow10
diff --git a/content/v2.0/reference/flux/functions/math/remainder.md b/content/v2.0/reference/flux/stdlib/math/remainder.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/remainder.md
rename to content/v2.0/reference/flux/stdlib/math/remainder.md
index c7056aef3..84563bf28 100644
--- a/content/v2.0/reference/flux/functions/math/remainder.md
+++ b/content/v2.0/reference/flux/stdlib/math/remainder.md
@@ -1,6 +1,8 @@
---
title: math.remainder() function
description: The math.remainder() function returns the IEEE 754 floating-point remainder of `x / y`.
+aliases:
+ - /v2.0/reference/flux/functions/math/remainder/
menu:
v2_0_ref:
name: math.remainder
diff --git a/content/v2.0/reference/flux/functions/math/round.md b/content/v2.0/reference/flux/stdlib/math/round.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/round.md
rename to content/v2.0/reference/flux/stdlib/math/round.md
index 92e040360..c4c60d2ab 100644
--- a/content/v2.0/reference/flux/functions/math/round.md
+++ b/content/v2.0/reference/flux/stdlib/math/round.md
@@ -1,6 +1,8 @@
---
title: math.round() function
description: The math.round() function returns the nearest integer, rounding half away from zero.
+aliases:
+ - /v2.0/reference/flux/functions/math/round/
menu:
v2_0_ref:
name: math.round
diff --git a/content/v2.0/reference/flux/functions/math/roundtoeven.md b/content/v2.0/reference/flux/stdlib/math/roundtoeven.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/roundtoeven.md
rename to content/v2.0/reference/flux/stdlib/math/roundtoeven.md
index 5f78da74a..381470463 100644
--- a/content/v2.0/reference/flux/functions/math/roundtoeven.md
+++ b/content/v2.0/reference/flux/stdlib/math/roundtoeven.md
@@ -1,6 +1,8 @@
---
title: math.roundtoeven() function
description: The math.roundtoeven() function returns the nearest integer, rounding ties to even.
+aliases:
+ - /v2.0/reference/flux/functions/math/roundtoeven/
menu:
v2_0_ref:
name: math.roundtoeven
diff --git a/content/v2.0/reference/flux/functions/math/signbit.md b/content/v2.0/reference/flux/stdlib/math/signbit.md
similarity index 88%
rename from content/v2.0/reference/flux/functions/math/signbit.md
rename to content/v2.0/reference/flux/stdlib/math/signbit.md
index cefb73d90..9826c4e75 100644
--- a/content/v2.0/reference/flux/functions/math/signbit.md
+++ b/content/v2.0/reference/flux/stdlib/math/signbit.md
@@ -1,6 +1,8 @@
---
title: math.signbit() function
description: The math.signbit() function reports whether `x` is negative or negative zero.
+aliases:
+ - /v2.0/reference/flux/functions/math/signbit/
menu:
v2_0_ref:
name: math.signbit
diff --git a/content/v2.0/reference/flux/functions/math/sin.md b/content/v2.0/reference/flux/stdlib/math/sin.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/sin.md
rename to content/v2.0/reference/flux/stdlib/math/sin.md
index 033a005e8..e06aaec4c 100644
--- a/content/v2.0/reference/flux/functions/math/sin.md
+++ b/content/v2.0/reference/flux/stdlib/math/sin.md
@@ -1,6 +1,8 @@
---
title: math.sin() function
description: The math.sin() function returns the sine of the radian argument `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/sin/
menu:
v2_0_ref:
name: math.sin
diff --git a/content/v2.0/reference/flux/functions/math/sincos.md b/content/v2.0/reference/flux/stdlib/math/sincos.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/sincos.md
rename to content/v2.0/reference/flux/stdlib/math/sincos.md
index 7d1e25ff2..5536d6001 100644
--- a/content/v2.0/reference/flux/functions/math/sincos.md
+++ b/content/v2.0/reference/flux/stdlib/math/sincos.md
@@ -1,6 +1,8 @@
---
title: math.sincos() function
description: The math.sincos() function returns the values of `math.sin(x:x)` and `math.cos(x:x)`.
+aliases:
+ - /v2.0/reference/flux/functions/math/sincos/
menu:
v2_0_ref:
name: math.sincos
diff --git a/content/v2.0/reference/flux/functions/math/sinh.md b/content/v2.0/reference/flux/stdlib/math/sinh.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/sinh.md
rename to content/v2.0/reference/flux/stdlib/math/sinh.md
index 7dd4def04..800ae94a2 100644
--- a/content/v2.0/reference/flux/functions/math/sinh.md
+++ b/content/v2.0/reference/flux/stdlib/math/sinh.md
@@ -1,6 +1,8 @@
---
title: math.sinh() function
description: The math.sinh() function returns the hyperbolic sine of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/sinh/
menu:
v2_0_ref:
name: math.sinh
diff --git a/content/v2.0/reference/flux/functions/math/sqrt.md b/content/v2.0/reference/flux/stdlib/math/sqrt.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/sqrt.md
rename to content/v2.0/reference/flux/stdlib/math/sqrt.md
index f09e59fa2..88e650c06 100644
--- a/content/v2.0/reference/flux/functions/math/sqrt.md
+++ b/content/v2.0/reference/flux/stdlib/math/sqrt.md
@@ -1,6 +1,8 @@
---
title: math.sqrt() function
description: The math.sqrt() function returns the square root of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/sqrt/
menu:
v2_0_ref:
name: math.sqrt
diff --git a/content/v2.0/reference/flux/functions/math/tan.md b/content/v2.0/reference/flux/stdlib/math/tan.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/tan.md
rename to content/v2.0/reference/flux/stdlib/math/tan.md
index 3fbb9d970..f55bb765f 100644
--- a/content/v2.0/reference/flux/functions/math/tan.md
+++ b/content/v2.0/reference/flux/stdlib/math/tan.md
@@ -1,6 +1,8 @@
---
title: math.tan() function
description: The math.tan() function returns the tangent of the radian argument `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/tan/
menu:
v2_0_ref:
name: math.tan
diff --git a/content/v2.0/reference/flux/functions/math/tanh.md b/content/v2.0/reference/flux/stdlib/math/tanh.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/math/tanh.md
rename to content/v2.0/reference/flux/stdlib/math/tanh.md
index a468720b0..884972b1d 100644
--- a/content/v2.0/reference/flux/functions/math/tanh.md
+++ b/content/v2.0/reference/flux/stdlib/math/tanh.md
@@ -1,6 +1,8 @@
---
title: math.tanh() function
description: The math.tanh() function returns the hyperbolic tangent of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/tanh/
menu:
v2_0_ref:
name: math.tanh
diff --git a/content/v2.0/reference/flux/functions/math/trunc.md b/content/v2.0/reference/flux/stdlib/math/trunc.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/math/trunc.md
rename to content/v2.0/reference/flux/stdlib/math/trunc.md
index e787dbd80..a4c98d682 100644
--- a/content/v2.0/reference/flux/functions/math/trunc.md
+++ b/content/v2.0/reference/flux/stdlib/math/trunc.md
@@ -1,6 +1,8 @@
---
title: math.trunc() function
description: The math.trunc() function returns the integer value of `x`.
+aliases:
+ - /v2.0/reference/flux/functions/math/trunc/
menu:
v2_0_ref:
name: math.trunc
diff --git a/content/v2.0/reference/flux/functions/math/y0.md b/content/v2.0/reference/flux/stdlib/math/y0.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/y0.md
rename to content/v2.0/reference/flux/stdlib/math/y0.md
index 7dc7fab13..4dff9fdb7 100644
--- a/content/v2.0/reference/flux/functions/math/y0.md
+++ b/content/v2.0/reference/flux/stdlib/math/y0.md
@@ -1,6 +1,8 @@
---
title: math.y0() function
description: The math.y0() function returns the order-zero Bessel function of the second kind.
+aliases:
+ - /v2.0/reference/flux/functions/math/y0/
menu:
v2_0_ref:
name: math.y0
diff --git a/content/v2.0/reference/flux/functions/math/y1.md b/content/v2.0/reference/flux/stdlib/math/y1.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/math/y1.md
rename to content/v2.0/reference/flux/stdlib/math/y1.md
index b16a38c99..84b79ca1e 100644
--- a/content/v2.0/reference/flux/functions/math/y1.md
+++ b/content/v2.0/reference/flux/stdlib/math/y1.md
@@ -1,6 +1,8 @@
---
title: math.y1() function
description: The math.y1() function returns the order-one Bessel function of the second kind.
+aliases:
+ - /v2.0/reference/flux/functions/math/y1/
menu:
v2_0_ref:
name: math.y1
diff --git a/content/v2.0/reference/flux/functions/math/yn.md b/content/v2.0/reference/flux/stdlib/math/yn.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/math/yn.md
rename to content/v2.0/reference/flux/stdlib/math/yn.md
index 56b951ca5..63e9e14ce 100644
--- a/content/v2.0/reference/flux/functions/math/yn.md
+++ b/content/v2.0/reference/flux/stdlib/math/yn.md
@@ -1,6 +1,8 @@
---
title: math.yn() function
description: The math.yn() function returns the order-n Bessel function of the second kind.
+aliases:
+ - /v2.0/reference/flux/functions/math/yn/
menu:
v2_0_ref:
name: math.yn
diff --git a/content/v2.0/reference/flux/stdlib/monitor/_index.md b/content/v2.0/reference/flux/stdlib/monitor/_index.md
new file mode 100644
index 000000000..b5296bc87
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/monitor/_index.md
@@ -0,0 +1,24 @@
+---
+title: Flux InfluxDB Monitor package
+list_title: InfluxDB Monitor package
+description: >
+ The Flux Monitor package provides tools for monitoring and alerting with InfluxDB.
+ Import the `influxdata/influxdb/monitor` package.
+aliases:
+ - /v2.0/reference/flux/functions/monitor/
+menu:
+ v2_0_ref:
+ name: InfluxDB Monitor
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [functions, monitor, alerts, package]
+---
+
+The Flux monitor package provides tools for monitoring and alerting with InfluxDB.
+Import the `influxdata/influxdb/monitor` package:
+
+```js
+import "influxdata/influxdb/monitor"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/monitor/check.md b/content/v2.0/reference/flux/stdlib/monitor/check.md
new file mode 100644
index 000000000..5963d46f6
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/monitor/check.md
@@ -0,0 +1,97 @@
+---
+title: monitor.check() function
+description: >
+ The `monitor.check()` function function checks input data and assigns a level
+ (`ok`, `info`, `warn`, or `crit`) to each row based on predicate functions.
+aliases:
+ - /v2.0/reference/flux/functions/monitor/check/
+menu:
+ v2_0_ref:
+ name: monitor.check
+ parent: InfluxDB Monitor
+weight: 202
+---
+
+The `monitor.check()` function function checks input data and assigns a level
+(`ok`, `info`, `warn`, or `crit`) to each row based on predicate functions.
+
+_**Function type:** Transformation_
+
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.check(
+ crit: (r) => r._value > 90.0,
+ warn: (r) => r._value > 80.0,
+ info: (r) => r._value > 60.0,
+ ok: (r) => r._value <= 20.0,
+ messageFn: (r) => "The current level is ${r._level}",
+ data: {}
+)
+```
+
+`monitor.check()` stores statuses in the `_level` column and writes results
+to the `statuses` measurement in the `_monitoring` bucket.
+
+## Parameters
+
+### crit
+Predicate function that determines `crit` status.
+Default is `(r) => false`.
+
+_**Data type:** Function_
+
+### warn
+Predicate function that determines `warn` status.
+Default is `(r) => false`.
+
+_**Data type:** Function_
+
+### info
+Predicate function that determines `info` status.
+Default is `(r) => false`.
+
+_**Data type:** Function_
+
+### ok
+Predicate function that determines `ok` status.
+Default is `(r) => true`.
+
+_**Data type:** Function_
+
+### messageFn
+A function that constructs a message to append to each row.
+The message is stored in the `_message` column.
+
+_**Data type:** Function_
+
+### data
+Data to append to the output.
+**InfluxDB populates check data.**
+
+_**Data type:** Object_
+
+## Examples
+
+### Monitor disk usage
+```js
+import "influxdata/influxdb/monitor"
+
+from(bucket: "telegraf")
+ |> range(start: -1h)
+ |> filter(fn: (r) =>
+ r._measurement == "disk" and
+ r._field = "used_percent"
+ )
+ |> monitor.check(
+ crit: (r) => r._value > 90.0,
+ warn: (r) => r._value > 80.0,
+ info: (r) => r._value > 70.0,
+ ok: (r) => r._value <= 60.0,
+ messageFn: (r) =>
+ if r._level == "crit" then "Critical alert!! Disk usage is at ${r._value}%!"
+ else if r._level == "warn" then "Warning! Disk usage is at ${r._value}%."
+ else if r._level == "info" then "Disk usage is at ${r._value}%."
+ else "Things are looking good."
+ )
+```
diff --git a/content/v2.0/reference/flux/stdlib/monitor/deadman.md b/content/v2.0/reference/flux/stdlib/monitor/deadman.md
new file mode 100644
index 000000000..870c90ae7
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/monitor/deadman.md
@@ -0,0 +1,48 @@
+---
+title: monitor.deadman() function
+description: >
+ The `monitor.deadman()` function detects when a group stops reporting data.
+aliases:
+ - /v2.0/reference/flux/functions/monitor/deadman/
+menu:
+ v2_0_ref:
+ name: monitor.deadman
+ parent: InfluxDB Monitor
+weight: 202
+cloud_all: true
+---
+
+The `monitor.deadman()` function detects when a group stops reporting data.
+It takes a stream of tables and reports if groups have been observed since time `t`.
+
+_**Function type:** Transformation_
+
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.deadman(t: 2019-08-30T12:30:00Z)
+```
+
+`monitor.deadman()` retains the most recent row from each input table and adds a `dead` column.
+If a record appears **after** time `t`, `monitor.deadman()` sets `dead` to `false`.
+Otherwise, `dead` is set to `true`.
+
+## Parameters
+
+### t
+The time threshold for the deadman check.
+
+_**Data type:** Time_
+
+## Examples
+
+### Detect if a host hasn't reported in the last five minutes
+```js
+import "influxdata/influxdb/monitor"
+import "experimental"
+
+from(bucket: "example-bucket")
+ |> range(start: -10m)
+ |> group(columns: ["host"])
+ |> monitor.deadman(t: experimental.subDuration(d: 5m, from: now() ))
+```
diff --git a/content/v2.0/reference/flux/stdlib/monitor/from.md b/content/v2.0/reference/flux/stdlib/monitor/from.md
new file mode 100644
index 000000000..0dcf3c575
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/monitor/from.md
@@ -0,0 +1,71 @@
+---
+title: monitor.from() function
+description: >
+ The `monitor.from()` function retrieves check statuses stored in the `statuses`
+ measurement in the `_monitoring` bucket.
+aliases:
+ - /v2.0/reference/flux/functions/monitor/from/
+menu:
+ v2_0_ref:
+ name: monitor.from
+ parent: InfluxDB Monitor
+weight: 202
+---
+
+The `monitor.from()` function retrieves check statuses stored in the `statuses`
+measurement in the `_monitoring` bucket.
+
+_**Function type:** Input_
+
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.from(
+ start: -1h,
+ stop: now(),
+ fn: (r) => true
+)
+```
+
+
+## Parameters
+
+### start
+The earliest time to include in results.
+Use a relative duration or absolute time.
+For example, `-1h` or `2019-08-28T22:00:00Z`.
+Durations are relative to `now()`.
+
+_**Data type:** Duration | Time_
+
+### stop
+The latest time to include in results.
+Use a relative duration or absolute time.
+For example, `-1h` or `2019-08-28T22:00:00Z`.
+Durations are relative to `now()`.
+Defaults to `now()`.
+
+_**Data type:** Duration | Time_
+
+{{% note %}}
+Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
+{{% /note %}}
+
+### fn
+A single argument predicate function that evaluates `true` or `false`.
+Records or rows (`r`) that evaluate to `true` are included in output tables.
+Records that evaluate to _null_ or `false` are not included in output tables.
+
+_**Data type:** Function_
+
+## Examples
+
+### View critical check statuses from the last hour
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.from(
+ start: -1h,
+ fn: (r) => r._level == "crit"
+)
+```
diff --git a/content/v2.0/reference/flux/stdlib/monitor/logs.md b/content/v2.0/reference/flux/stdlib/monitor/logs.md
new file mode 100644
index 000000000..bcf6c4861
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/monitor/logs.md
@@ -0,0 +1,67 @@
+---
+title: monitor.logs() function
+description: >
+ The `monitor.logs()` function retrieves notification events stored in the `notifications`
+ measurement in the `_monitoring` bucket.
+aliases:
+ - /v2.0/reference/flux/functions/monitor/logs/
+menu:
+ v2_0_ref:
+ name: monitor.logs
+ parent: InfluxDB Monitor
+weight: 202
+---
+
+The `monitor.logs()` function retrieves notification events stored in the `notifications`
+measurement in the `_monitoring` bucket.
+
+_**Function type:** Input_
+
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.logs(
+ start: -1h,
+ stop: now(),
+ fn: (r) => true
+)
+```
+
+## Parameters
+
+### start
+The earliest time to include in results.
+Use a relative duration or absolute time.
+For example, `-1h` or `2019-08-28T22:00:00Z`.
+Durations are relative to `now()`.
+
+_**Data type:** Duration | Time_
+
+### stop
+The latest time to include in results.
+Use a relative duration or absolute time.
+For example, `-1h` or `2019-08-28T22:00:00Z`.
+Durations are relative to `now()`.
+Defaults to `now()`.
+
+_**Data type:** Duration | Time_
+
+{{% note %}}
+Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
+{{% /note %}}
+
+### fn
+A single argument predicate function that evaluates `true` or `false`.
+Records or rows (`r`) that evaluate to `true` are included in output tables.
+Records that evaluate to _null_ or `false` are not included in output tables.
+
+_**Data type:** Function_
+
+## Examples
+
+### Query notification events from the last hour
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.logs(start: -1h)
+```
diff --git a/content/v2.0/reference/flux/stdlib/monitor/notify.md b/content/v2.0/reference/flux/stdlib/monitor/notify.md
new file mode 100644
index 000000000..8d845a80c
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/monitor/notify.md
@@ -0,0 +1,54 @@
+---
+title: monitor.notify() function
+description: >
+ The `monitor.notify()` function sends a notification to an endpoint and logs it
+ in the `notifications` measurement in the `_monitoring` bucket.
+aliases:
+ - /v2.0/reference/flux/functions/monitor/notify/
+menu:
+ v2_0_ref:
+ name: monitor.notify
+ parent: InfluxDB Monitor
+weight: 202
+---
+
+The `monitor.notify()` function sends a notification to an endpoint and logs it
+in the `notifications` measurement in the `_monitoring` bucket.
+
+_**Function type:** Output_
+
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.notify(
+ endpoint: endpoint,
+ data: {}
+)
+```
+
+## Parameters
+
+### endpoint
+A function that constructs and sends the notification to an endpoint.
+
+_**Data type:** Function_
+
+### data
+Data to append to the output.
+**InfluxDB populates notification data.**
+
+_**Data type:** Object_
+
+## Examples
+
+### Send a notification to Slack
+```js
+import "influxdata/influxdb/monitor"
+import "slack"
+
+endpoint = slack.endpoint(name: "slack", channel: "#flux")
+
+from(bucket: "system")
+ |> range(start: -5m)
+ |> monitor.notify(endpoint: endpoint)
+```
diff --git a/content/v2.0/reference/flux/stdlib/monitor/statechanges.md b/content/v2.0/reference/flux/stdlib/monitor/statechanges.md
new file mode 100644
index 000000000..b2e4573a8
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/monitor/statechanges.md
@@ -0,0 +1,56 @@
+---
+title: monitor.stateChanges() function
+description: >
+ The `monitor.stateChanges()` function detects state changes in a stream of data and
+ outputs records that change from `fromLevel` to `toLevel`.
+aliases:
+ - /v2.0/reference/flux/functions/monitor/statechanges/
+menu:
+ v2_0_ref:
+ name: monitor.stateChanges
+ parent: InfluxDB Monitor
+weight: 202
+cloud_all: true
+---
+
+The `monitor.stateChanges()` function detects state changes in a stream of data and
+outputs records that change from `fromLevel` to `toLevel`.
+
+{{% note %}}
+`monitor.stateChanges` operates on data in the `statuses` measurement and requires a `_level` column .
+{{% /note %}}
+
+_**Function type:** Transformation_
+
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.stateChanges(
+ fromLevel: "any",
+ toLevel: "crit"
+)
+```
+
+## Parameters
+
+### fromLevel
+The level to detect a change from.
+Defaults to `"any"`.
+
+_**Data type:** String_
+
+### toLevel
+The level to detect a change to.
+The function output records that change to this level.
+
+_**Data type:** String_
+
+## Examples
+
+### Detect when the state changes to critical
+```js
+import "influxdata/influxdb/monitor"
+
+monitor.from(start: -1h)
+ |> monitor.stateChanges(toLevel: "crit")
+```
diff --git a/content/v2.0/reference/flux/stdlib/pagerduty/_index.md b/content/v2.0/reference/flux/stdlib/pagerduty/_index.md
new file mode 100644
index 000000000..a84ddf85d
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/pagerduty/_index.md
@@ -0,0 +1,24 @@
+---
+title: Flux PagerDuty package
+list_title: PagerDuty package
+description: >
+ The Flux PagerDuty package provides functions for sending data to PagerDuty.
+ Import the `pagerduty` package.
+aliases:
+ - /v2.0/reference/flux/functions/pagerduty/
+menu:
+ v2_0_ref:
+ name: PagerDuty
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [functions, pagerduty, package]
+---
+
+The Flux PagerDuty package provides functions for sending data to PagerDuty.
+Import the `pagerduty` package:
+
+```js
+import "pagerduty"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/pagerduty/actionfromseverity.md b/content/v2.0/reference/flux/stdlib/pagerduty/actionfromseverity.md
new file mode 100644
index 000000000..641083e8c
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/pagerduty/actionfromseverity.md
@@ -0,0 +1,44 @@
+---
+title: pagerduty.actionFromSeverity() function
+description: >
+ The `pagerduty.actionFromSeverity()` function converts a severity to a PagerDuty action.
+aliases:
+ - /v2.0/reference/flux/functions/pagerduty/actionfromseverity/
+menu:
+ v2_0_ref:
+ name: pagerduty.actionFromSeverity
+ parent: PagerDuty
+weight: 202
+---
+
+The `pagerduty.actionFromSeverity()` function converts a severity to a PagerDuty action.
+`ok` converts to `resolve`.
+All other severities convert to `trigger`.
+
+_**Function type:** Transformation_
+
+```js
+import "pagerduty"
+
+pagerduty.actionFromSeverity(
+ severity: "ok"
+)
+
+// Returns "resolve"
+```
+
+## Parameters
+
+### severity
+The severity to convert to a PagerDuty action.
+
+_**Data type:** String_
+
+## Function definition
+```js
+import "strings"
+
+actionFromSeverity = (severity) =>
+ if strings.toLower(v: severity) == "ok" then "resolve"
+ else "trigger"
+```
diff --git a/content/v2.0/reference/flux/stdlib/pagerduty/dedupkey.md b/content/v2.0/reference/flux/stdlib/pagerduty/dedupkey.md
new file mode 100644
index 000000000..f34873a08
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/pagerduty/dedupkey.md
@@ -0,0 +1,38 @@
+---
+title: pagerduty.dedupKey() function
+description: >
+ The `pagerduty.dedupKey()` function uses the group key of an input table to
+ generate and store a deduplication key in the `_pagerdutyDedupKey` column.
+aliases:
+ - /v2.0/reference/flux/functions/pagerduty/dedupkey/
+menu:
+ v2_0_ref:
+ name: pagerduty.dedupKey
+ parent: PagerDuty
+weight: 202
+---
+
+The `pagerduty.dedupKey()` function uses the group key of an input table to
+generate and store a deduplication key in the `_pagerdutyDedupKey` column.
+The function sorts, newline-concatenates, SHA256-hashes, and hex-encodes
+the group key to create a unique deduplication key for each input table.
+
+_**Function type:** Transformation_
+
+```js
+import "pagerduty"
+
+pagerduty.dedupKey()
+```
+
+## Examples
+
+##### Add a PagerDuty deduplication key to output data
+```js
+import "pagerduty"
+
+from(bucket: "default")
+ |> range(start: -5m)
+ |> filter(fn: (r) => r._measurement == "mem")
+ |> pagerduty.dedupKey()
+```
diff --git a/content/v2.0/reference/flux/stdlib/pagerduty/endpoint.md b/content/v2.0/reference/flux/stdlib/pagerduty/endpoint.md
new file mode 100644
index 000000000..e42bd1e7a
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/pagerduty/endpoint.md
@@ -0,0 +1,75 @@
+---
+title: pagerduty.endpoint() function
+description: >
+ The `pagerduty.endpoint()` function sends a message to PagerDuty that includes output data.
+aliases:
+ - /v2.0/reference/flux/functions/pagerduty/endpoint/
+menu:
+ v2_0_ref:
+ name: pagerduty.endpoint
+ parent: PagerDuty
+weight: 202
+v2.0/tags: [endpoints]
+---
+
+The `pagerduty.endpoint()` function sends a message to PagerDuty that includes output data.
+
+_**Function type:** Output_
+
+```js
+import "pagerduty"
+
+pagerduty.endpoint(
+ url: "https://events.pagerduty.com/v2/enqueue"
+)
+```
+
+## Parameters
+
+### pagerdutyURL
+The PagerDuty API URL.
+Defaults to `https://events.pagerduty.com/v2/enqueue`.
+
+_**Data type:** String_
+
+### mapFn
+A function that builds the object used to generate the POST request.
+
+{{% note %}}
+_You should rarely need to override the default `mapFn` parameter.
+To see the default `mapFn` value or for insight into possible overrides, view the
+[`pagerduty.endpoint()` source code](https://github.com/influxdata/flux/blob/master/stdlib/pagerduty/pagerduty.flux)._
+{{% /note %}}
+
+_**Data type:** Function_
+
+The returned object must include the following fields:
+
+- `routingKey`
+- `client`
+- `client_url`
+- `class`
+- `group`
+- `severity`
+- `component`
+- `source`
+- `summary`
+- `timestamp`
+
+_For more information, see [`pagerduty.sendEvent()`](/v2.0/reference/flux/stdlib/pagerduty/sendevent/)_
+
+## Examples
+
+##### Send critical statuses to a PagerDuty endpoint
+```js
+import "monitor"
+import "pagerduty"
+
+endpoint = pagerduty.endpoint(token: "mySuPerSecRetTokEn")
+
+from(bucket: "example-bucket")
+ |> range(start: -1m)
+ |> filter(fn: (r) => r._measurement == "statuses" and status == "crit")
+ |> map(fn: (r) => { return {r with status: r._status} })
+ |> monitor.notify(endpoint: endpoint)
+```
diff --git a/content/v2.0/reference/flux/stdlib/pagerduty/sendevent.md b/content/v2.0/reference/flux/stdlib/pagerduty/sendevent.md
new file mode 100644
index 000000000..51bf4abaf
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/pagerduty/sendevent.md
@@ -0,0 +1,131 @@
+---
+title: pagerduty.sendEvent() function
+description: >
+ The `pagerduty.sendEvent()` function sends an event to PagerDuty.
+aliases:
+ - /v2.0/reference/flux/functions/pagerduty/sendevent/
+menu:
+ v2_0_ref:
+ name: pagerduty.sendEvent
+ parent: PagerDuty
+weight: 202
+---
+
+The `pagerduty.sendEvent()` function sends an event to PagerDuty.
+
+_**Function type:** Output_
+
+```js
+import "pagerduty"
+
+pagerduty.sendEvent(
+ pagerdutyURL: "https://events.pagerduty.com/v2/enqueue",
+ routingKey: "ExampleRoutingKey",
+ client: "ExampleClient",
+ clientURL: "http://examplepagerdutyclient.com",
+ dedupkey: "ExampleDedupKey",
+ class: "cpu usage",
+ group: "app-stack",
+ severity: "ok",
+ component: "postgres",
+ source: "monitoringtool:vendor:region",
+ summary: "This is an example summary.",
+ timestamp: "2016-07-17T08:42:58.315+0000"
+)
+```
+
+## Parameters
+
+### pagerdutyURL
+The URL of the PagerDuty endpoint.
+Defaults to `https://events.pagerduty.com/v2/enqueue`.
+
+_**Data type:** String_
+
+### routingKey
+The routing key generated from your PagerDuty integration.
+
+_**Data type:** String_
+
+### client
+The name of the client sending the alert.
+
+_**Data type:** String_
+
+### clientURL
+The URL of the client sending the alert.
+
+_**Data type:** String_
+
+### dedupkey
+A per-alert ID that acts as deduplication key and allows you to acknowledge or
+change the severity of previous messages.
+Supports a maximum of 255 characters.
+
+{{% note %}}
+When using [`pagerduty.endpoint()`](/v2.0/reference/flux/stdlib/pagerduty/endpoint/)
+to send data to PagerDuty, the function uses the [`pagerduty.dedupKey()` function](/v2.0/reference/flux/stdlib/pagerduty/dedupkey/) to populate the `dedupkey` parameter.
+{{% /note %}}
+
+_**Data type:** String_
+
+### class
+The class or type of the event.
+Classes are user-defined.
+For example, `ping failure` or `cpu load`.
+
+_**Data type:** String_
+
+### group
+A logical grouping used by PagerDuty.
+Groups are user-defined.
+For example, `app-stack`.
+
+_**Data type:** String_
+
+### severity
+The severity of the event.
+
+**Valid values include:**
+
+- `critical`
+- `error`
+- `warning`
+- `info`
+
+_**Data type:** String_
+
+### eventAction
+The type of event to send to PagerDuty.
+
+**Valid values include:**
+
+- `trigger`
+- `resolve`
+- `acknowledge`
+
+_**Data type:** String_
+
+### component
+The component of the source machine responsible for the event.
+Components are user-defined.
+For example, `mysql` or `eth0`.
+
+_**Data type:** String_
+
+### source
+The unique location of the affected system.
+For example, the hostname or fully qualified domain name (FQDN).
+
+_**Data type:** String_
+
+### summary
+A brief text summary of the event used as the summaries or titles of associated alerts.
+The maximum permitted length is 1024 characters.
+
+_**Data type:** String_
+
+### timestamp
+The time the detected event occurred in [RFC3339nano format](https://golang.org/pkg/time/#RFC3339Nano).
+
+_**Data type:** String_
diff --git a/content/v2.0/reference/flux/stdlib/pagerduty/severityfromlevel.md b/content/v2.0/reference/flux/stdlib/pagerduty/severityfromlevel.md
new file mode 100644
index 000000000..7e1d829ad
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/pagerduty/severityfromlevel.md
@@ -0,0 +1,57 @@
+---
+title: pagerduty.severityFromLevel() function
+description: >
+ The `pagerduty.severityFromLevel()` function converts an InfluxDB status level to
+ a PagerDuty severity.
+aliases:
+ - /v2.0/reference/flux/functions/pagerduty/severityfromlevel/
+menu:
+ v2_0_ref:
+ name: pagerduty.severityFromLevel
+ parent: PagerDuty
+weight: 202
+---
+
+The `pagerduty.severityFromLevel()` function converts an InfluxDB status level to
+a PagerDuty severity.
+
+_**Function type:** Transformation_
+
+```js
+import "pagerduty"
+
+pagerduty.severityFromLevel(
+ level: "crit"
+)
+
+// Returns "critical"
+```
+
+| Status level | PagerDuty severity |
+|:------------:|:------------------:|
+| `crit` | `critical` |
+| `warn` | `warning` |
+| `info` | `info` |
+| `ok` | `info` |
+
+## Parameters
+
+### level
+The InfluxDB status level to convert to a PagerDuty severity.
+
+_**Data type:** String_
+
+## Function definition
+```js
+import "strings"
+
+severityFromLevel = (level) => {
+ lvl = strings.toLower(v:level)
+ sev = if lvl == "warn" then "warning"
+ else if lvl == "crit" then "critical"
+ else if lvl == "info" then "info"
+ else if lvl == "ok" then "info"
+ else "error"
+ return sev
+}
+```
diff --git a/content/v2.0/reference/flux/functions/regexp/_index.md b/content/v2.0/reference/flux/stdlib/regexp/_index.md
similarity index 86%
rename from content/v2.0/reference/flux/functions/regexp/_index.md
rename to content/v2.0/reference/flux/stdlib/regexp/_index.md
index c1107742a..079929ca2 100644
--- a/content/v2.0/reference/flux/functions/regexp/_index.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/_index.md
@@ -4,10 +4,12 @@ list_title: Regular expressions package
description: >
The Flux regular expressions package includes functions that provide enhanced
regular expression functionality. Import the `regexp` package.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/
menu:
v2_0_ref:
name: Regular expressions
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [regex, functions]
---
diff --git a/content/v2.0/reference/flux/functions/regexp/compile.md b/content/v2.0/reference/flux/stdlib/regexp/compile.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/regexp/compile.md
rename to content/v2.0/reference/flux/stdlib/regexp/compile.md
index 8a5f45cca..93dea117d 100644
--- a/content/v2.0/reference/flux/functions/regexp/compile.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/compile.md
@@ -3,6 +3,8 @@ title: regexp.compile() function
description: >
The `regexp.compile()` function parses a regular expression and, if successful,
returns a Regexp object that can be used to match against text.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/compile/
menu:
v2_0_ref:
name: regexp.compile
diff --git a/content/v2.0/reference/flux/functions/regexp/findstring.md b/content/v2.0/reference/flux/stdlib/regexp/findstring.md
similarity index 88%
rename from content/v2.0/reference/flux/functions/regexp/findstring.md
rename to content/v2.0/reference/flux/stdlib/regexp/findstring.md
index ac0f98e86..d26a1a688 100644
--- a/content/v2.0/reference/flux/functions/regexp/findstring.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/findstring.md
@@ -1,13 +1,15 @@
---
title: regexp.findString() function
description: The `regexp.findString()` function returns the left-most regular expression match in a string.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/findstring/
menu:
v2_0_ref:
name: regexp.findString
parent: Regular expressions
weight: 301
related:
- - /v2.0/reference/flux/functions/regexp/splitregexp
+ - /v2.0/reference/flux/stdlib/regexp/splitregexp
---
The `regexp.findString()` function returns the left-most regular expression match in a string.
diff --git a/content/v2.0/reference/flux/functions/regexp/findstringindex.md b/content/v2.0/reference/flux/stdlib/regexp/findstringindex.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/regexp/findstringindex.md
rename to content/v2.0/reference/flux/stdlib/regexp/findstringindex.md
index 49a1d7a47..80e4d4ff1 100644
--- a/content/v2.0/reference/flux/functions/regexp/findstringindex.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/findstringindex.md
@@ -3,13 +3,15 @@ title: regexp.findStringIndex() function
description: >
The `regexp.findStringIndex()` function returns a two-element array of integers defining
the beginning and ending indexes of the left-most regular expression match in a string.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/findstringindex/
menu:
v2_0_ref:
name: regexp.findStringIndex
parent: Regular expressions
weight: 301
related:
- - /v2.0/reference/flux/functions/regexp/compile
+ - /v2.0/reference/flux/stdlib/regexp/compile
---
The `regexp.findStringIndex()` function returns a two-element array of integers defining
diff --git a/content/v2.0/reference/flux/functions/regexp/getstring.md b/content/v2.0/reference/flux/stdlib/regexp/getstring.md
similarity index 87%
rename from content/v2.0/reference/flux/functions/regexp/getstring.md
rename to content/v2.0/reference/flux/stdlib/regexp/getstring.md
index f4528a091..7c3c39992 100644
--- a/content/v2.0/reference/flux/functions/regexp/getstring.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/getstring.md
@@ -1,13 +1,15 @@
---
title: regexp.getString() function
description: The `regexp.getString()` function returns the source string used to compile a regular expression.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/getstring/
menu:
v2_0_ref:
name: regexp.getString
parent: Regular expressions
weight: 301
related:
- - /v2.0/reference/flux/functions/regexp/compile
+ - /v2.0/reference/flux/stdlib/regexp/compile
---
The `regexp.getString()` function returns the source string used to compile a regular expression.
diff --git a/content/v2.0/reference/flux/functions/regexp/matchregexpstring.md b/content/v2.0/reference/flux/stdlib/regexp/matchregexpstring.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/regexp/matchregexpstring.md
rename to content/v2.0/reference/flux/stdlib/regexp/matchregexpstring.md
index 4a5c39cf7..ec8c6a113 100644
--- a/content/v2.0/reference/flux/functions/regexp/matchregexpstring.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/matchregexpstring.md
@@ -3,6 +3,8 @@ title: regexp.matchRegexpString() function
description: >
The `regexp.matchRegexpString()` function tests if a string contains any match
to a regular expression.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/matchregexpstring/
menu:
v2_0_ref:
name: regexp.matchRegexpString
diff --git a/content/v2.0/reference/flux/functions/regexp/quotemeta.md b/content/v2.0/reference/flux/stdlib/regexp/quotemeta.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/regexp/quotemeta.md
rename to content/v2.0/reference/flux/stdlib/regexp/quotemeta.md
index 7a02a2f3e..92916a540 100644
--- a/content/v2.0/reference/flux/functions/regexp/quotemeta.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/quotemeta.md
@@ -2,6 +2,8 @@
title: regexp.quoteMeta() function
description: >
The `regexp.quoteMeta()` function escapes all regular expression metacharacters inside of a string.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/quotemeta/
menu:
v2_0_ref:
name: regexp.quoteMeta
diff --git a/content/v2.0/reference/flux/functions/regexp/replaceallstring.md b/content/v2.0/reference/flux/stdlib/regexp/replaceallstring.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/regexp/replaceallstring.md
rename to content/v2.0/reference/flux/stdlib/regexp/replaceallstring.md
index 04c7383f7..7a84dd44c 100644
--- a/content/v2.0/reference/flux/functions/regexp/replaceallstring.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/replaceallstring.md
@@ -3,6 +3,8 @@ title: regexp.replaceAllString() function
description: >
The `regexp.replaceAllString()` function replaces all regular expression matches
in a string with a specified replacement.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/replaceallstring/
menu:
v2_0_ref:
name: regexp.replaceAllString
diff --git a/content/v2.0/reference/flux/functions/regexp/splitregexp.md b/content/v2.0/reference/flux/stdlib/regexp/splitregexp.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/regexp/splitregexp.md
rename to content/v2.0/reference/flux/stdlib/regexp/splitregexp.md
index 28d25fdad..eaddf0add 100644
--- a/content/v2.0/reference/flux/functions/regexp/splitregexp.md
+++ b/content/v2.0/reference/flux/stdlib/regexp/splitregexp.md
@@ -3,6 +3,8 @@ title: regexp.splitRegexp() function
description: >
The `regexp.splitRegexp()` function splits a string into substrings separated by
regular expression matches and returns an array of `i` substrings between matches.
+aliases:
+ - /v2.0/reference/flux/functions/regexp/splitregexp/
menu:
v2_0_ref:
name: regexp.splitRegexp
diff --git a/content/v2.0/reference/flux/stdlib/runtime/_index.md b/content/v2.0/reference/flux/stdlib/runtime/_index.md
new file mode 100644
index 000000000..690559ff1
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/runtime/_index.md
@@ -0,0 +1,24 @@
+---
+title: Flux runtime package
+list_title: Runtime package
+description: >
+ The Flux runtime package includes functions that provide information about the
+ current Flux runtime. Import the `runtime` package.
+aliases:
+ - /v2.0/reference/flux/functions/runtime/
+menu:
+ v2_0_ref:
+ name: Runtime
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [runtime, functions, package]
+---
+
+The Flux runtime package includes functions that provide information about the
+current Flux runtime. Import the `runtime` package:
+
+```js
+import "runtime"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/runtime/version.md b/content/v2.0/reference/flux/stdlib/runtime/version.md
new file mode 100644
index 000000000..f7aaddf27
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/runtime/version.md
@@ -0,0 +1,22 @@
+---
+title: runtime.version() function
+description: The `runtime.version()` function returns the current Flux version.
+aliases:
+ - /v2.0/reference/flux/functions/runtime/version/
+menu:
+ v2_0_ref:
+ name: runtime.version
+ parent: Runtime
+weight: 401
+---
+
+The `runtime.version()` function returns the current Flux version.
+
+_**Function type:** Miscellaneous_
+_**Output data type:** String_
+
+```js
+import "runtime"
+
+runtime.version()
+```
diff --git a/content/v2.0/reference/flux/stdlib/secrets/_index.md b/content/v2.0/reference/flux/stdlib/secrets/_index.md
new file mode 100644
index 000000000..fb9a57a5b
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/secrets/_index.md
@@ -0,0 +1,24 @@
+---
+title: Flux InfluxDB Secrets package
+list_title: InfluxDB Secrets package
+description: >
+ The Flux InfluxDB Secrets package provides functions for working with sensitive secrets managed by InfluxDB.
+ Import the `influxdata/influxdb/secrets` package.
+aliases:
+ - /v2.0/reference/flux/functions/secrets/
+menu:
+ v2_0_ref:
+ name: InfluxDB Secrets
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [functions, secrets, package]
+---
+
+InfluxDB Secrets Flux functions provide tools for working with sensitive secrets managed by InfluxDB.
+Import the `influxdata/influxdb/secrets` package:
+
+```js
+import "influxdata/influxdb/secrets"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/secrets/get.md b/content/v2.0/reference/flux/stdlib/secrets/get.md
new file mode 100644
index 000000000..1ce2fcb2b
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/secrets/get.md
@@ -0,0 +1,47 @@
+---
+title: secrets.get() function
+description: >
+ The `secrets.get()` function retrieves a secret from the InfluxDB secret store.
+aliases:
+ - /v2.0/reference/flux/functions/secrets/get/
+menu:
+ v2_0_ref:
+ name: secrets.get
+ parent: InfluxDB Secrets
+weight: 202
+---
+
+The `secrets.get()` function retrieves a secret from the
+[InfluxDB secret store](/v2.0/security/secrets/).
+
+_**Function type:** Miscellaneous_
+
+```js
+import "influxdata/influxdb/secrets"
+
+secrets.get(key: "KEY_NAME")
+```
+
+## Parameters
+
+### key
+The secret key to retrieve.
+
+_**Data type:** String_
+
+## Examples
+
+### Populate sensitive credentials with secrets
+```js
+import "sql"
+import "influxdata/influxdb/secrets"
+
+username = secrets.get(key: "POSTGRES_USERNAME")
+password = secrets.get(key: "POSTGRES_PASSWORD")
+
+sql.from(
+ driverName: "postgres",
+ dataSourceName: "postgresql://${username}:${password}@localhost",
+ query:"SELECT * FROM example-table"
+)
+```
diff --git a/content/v2.0/reference/flux/stdlib/slack/_index.md b/content/v2.0/reference/flux/stdlib/slack/_index.md
new file mode 100644
index 000000000..14c73c63b
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/slack/_index.md
@@ -0,0 +1,24 @@
+---
+title: Flux Slack package
+list_title: Slack package
+description: >
+ The Flux Slack package provides functions for sending data to Slack.
+ Import the `slack` package.
+aliases:
+ - /v2.0/reference/flux/functions/slack/
+menu:
+ v2_0_ref:
+ name: Slack
+ parent: Flux standard library
+weight: 202
+v2.0/tags: [functions, slack, package]
+---
+
+The Flux Slack package provides functions for sending data to Slack.
+Import the `slack` package:
+
+```js
+import "slack"
+```
+
+{{< children type="functions" show="pages" >}}
diff --git a/content/v2.0/reference/flux/stdlib/slack/endpoint.md b/content/v2.0/reference/flux/stdlib/slack/endpoint.md
new file mode 100644
index 000000000..22b99da8e
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/slack/endpoint.md
@@ -0,0 +1,88 @@
+---
+title: slack.endpoint() function
+description: >
+ The `slack.endpoint()` function sends a message to Slack that includes output data.
+aliases:
+ - /v2.0/reference/flux/functions/slack/endpoint/
+menu:
+ v2_0_ref:
+ name: slack.endpoint
+ parent: Slack
+weight: 202
+v2.0/tags: [endpoints]
+---
+
+The `slack.endpoint()` function sends a message to Slack that includes output data.
+
+_**Function type:** Output_
+
+```js
+import "slack"
+
+slack.endpoint(
+ url: "https://slack.com/api/chat.postMessage",
+ token: "mySuPerSecRetTokEn"
+)
+```
+
+## Parameters
+
+### url
+The Slack API URL.
+Defaults to `https://slack.com/api/chat.postMessage`.
+
+{{% note %}}
+If using a Slack webhook, you'll receive a Slack webhook URL when you
+[create an incoming webhook](https://api.slack.com/incoming-webhooks#create_a_webhook).
+{{% /note %}}
+
+_**Data type:** String_
+
+### token
+The [Slack API token](https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens)
+used to interact with Slack.
+Defaults to `""`.
+
+{{% note %}}
+A token is only required if using the Slack chat.postMessage API.
+{{% /note %}}
+
+_**Data type:** String_
+
+### mapFn
+A function that builds the object used to generate the POST request.
+
+{{% note %}}
+_You should rarely need to override the default `mapFn` parameter.
+To see the default `mapFn` value or for insight into possible overrides, view the
+[`slack.endpoint()` source code](https://github.com/influxdata/flux/blob/master/stdlib/slack/slack.flux)._
+{{% /note %}}
+
+_**Data type:** Function_
+
+The returned object must include the following fields:
+
+- `username`
+- `channel`
+- `workspace`
+- `text`
+- `iconEmoji`
+- `color`
+
+_For more information, see [`slack.message()`](/v2.0/reference/flux/stdlib/slack/message/)_
+
+## Examples
+
+##### Send critical statuses to a Slack endpoint
+```js
+import "monitor"
+import "slack"
+
+endpoint = slack.endpoint(token: "mySuPerSecRetTokEn")
+
+from(bucket: "example-bucket")
+ |> range(start: -1m)
+ |> filter(fn: (r) => r._measurement == "statuses" and status == "crit")
+ |> map(fn: (r) => { return {r with status: r._status} })
+ |> monitor.notify(endpoint: endpoint)
+```
diff --git a/content/v2.0/reference/flux/stdlib/slack/message.md b/content/v2.0/reference/flux/stdlib/slack/message.md
new file mode 100644
index 000000000..28b0ddcb8
--- /dev/null
+++ b/content/v2.0/reference/flux/stdlib/slack/message.md
@@ -0,0 +1,126 @@
+---
+title: slack.message() function
+description: >
+ The `slack.message()` function sends a single message to a Slack channel.
+ The function works with either with the chat.postMessage API or with a Slack webhook.
+aliases:
+ - /v2.0/reference/flux/functions/slack/message/
+menu:
+ v2_0_ref:
+ name: slack.message
+ parent: Slack
+weight: 202
+---
+
+The `slack.message()` function sends a single message to a Slack channel.
+The function works with either with the [chat.postMessage API](https://api.slack.com/methods/chat.postMessage)
+or with a [Slack webhook](https://api.slack.com/incoming-webhooks).
+
+_**Function type:** Output_
+
+```js
+import "slack"
+
+slack.message(
+ url: "https://slack.com/api/chat.postMessage",
+ token: "mySuPerSecRetTokEn",
+ username: "Fluxtastic",
+ channel: "#flux",
+ workspace: "",
+ text: "This is a message from the Flux slack.message() function.",
+ iconEmoji: "wave",
+ color: "good"
+)
+```
+
+## Parameters
+
+### url
+The Slack API URL.
+Defaults to `https://slack.com/api/chat.postMessage`.
+
+{{% note %}}
+If using a Slack webhook, you'll receive a Slack webhook URL when you
+[create an incoming webhook](https://api.slack.com/incoming-webhooks#create_a_webhook).
+{{% /note %}}
+
+_**Data type:** String_
+
+### token
+The [Slack API token](https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens)
+used to interact with Slack.
+Defaults to `""`.
+
+{{% note %}}
+A token is only required if using the Slack chat.postMessage API.
+{{% /note %}}
+
+_**Data type:** String_
+
+### username
+The username to use when posting the message to a Slack channel. Required
+
+_**Data type:** String_
+
+### channel
+The name of channel to post the message to. Required
+
+_**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. Required
+
+_**Data type:** String_
+
+### iconEmoji
+The name of emoji to use as the user avatar when posting the message to Slack.
+Required
+
+_**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.
+Required
+
+**Valid values include:**
+
+- `good`
+- `warning`
+- `danger`
+- Any valid RGB hex color code. For example, `#439FE0`.
+
+_**Data type:** String_
+
+## Examples
+
+##### Send the last reported status to Slack
+```js
+import "slack"
+
+lastReported =
+ from(bucket: "example-bucket")
+ |> range(start: -1m)
+ |> filter(fn: (r) => r._measurement == "statuses")
+ |> last()
+ |> map(fn: (r) => { return {status: r._status} })
+
+slack.message(
+ url: "https://slack.com/api/chat.postMessage",
+ token: "mySuPerSecRetTokEn",
+ username: "johndoe",
+ channel: "#system-status",
+ text: "The last reported status was \"${lastReported.status}\"."
+)
+```
diff --git a/content/v2.0/reference/flux/functions/sql/_index.md b/content/v2.0/reference/flux/stdlib/sql/_index.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/sql/_index.md
rename to content/v2.0/reference/flux/stdlib/sql/_index.md
index 77004614c..14574013c 100644
--- a/content/v2.0/reference/flux/functions/sql/_index.md
+++ b/content/v2.0/reference/flux/stdlib/sql/_index.md
@@ -4,10 +4,12 @@ list_title: SQL package
description: >
The Flux SQL package provides tools for working with data in SQL databases such as MySQL and PostgreSQL.
Import the `sql` package.
+aliases:
+ - /v2.0/reference/flux/functions/sql/
menu:
v2_0_ref:
name: SQL
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [functions, sql, package, mysql, postgres]
---
diff --git a/content/v2.0/reference/flux/functions/sql/from.md b/content/v2.0/reference/flux/stdlib/sql/from.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/sql/from.md
rename to content/v2.0/reference/flux/stdlib/sql/from.md
index fedbe981f..1931f2fc5 100644
--- a/content/v2.0/reference/flux/functions/sql/from.md
+++ b/content/v2.0/reference/flux/stdlib/sql/from.md
@@ -1,6 +1,8 @@
---
title: sql.from() function
description: The `sql.from()` function retrieves data from a SQL data source.
+aliases:
+ - /v2.0/reference/flux/functions/sql/from/
menu:
v2_0_ref:
name: sql.from
diff --git a/content/v2.0/reference/flux/functions/sql/to.md b/content/v2.0/reference/flux/stdlib/sql/to.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/sql/to.md
rename to content/v2.0/reference/flux/stdlib/sql/to.md
index f8aa134ba..6b9e7a0b4 100644
--- a/content/v2.0/reference/flux/functions/sql/to.md
+++ b/content/v2.0/reference/flux/stdlib/sql/to.md
@@ -1,6 +1,8 @@
---
title: sql.to() function
description: The `sql.to()` function writes data to a SQL database.
+aliases:
+ - /v2.0/reference/flux/functions/sql/to/
menu:
v2_0_ref:
name: sql.to
diff --git a/content/v2.0/reference/flux/functions/strings/_index.md b/content/v2.0/reference/flux/stdlib/strings/_index.md
similarity index 84%
rename from content/v2.0/reference/flux/functions/strings/_index.md
rename to content/v2.0/reference/flux/stdlib/strings/_index.md
index 0adee39c4..9cdc9225c 100644
--- a/content/v2.0/reference/flux/functions/strings/_index.md
+++ b/content/v2.0/reference/flux/stdlib/strings/_index.md
@@ -4,10 +4,12 @@ list_title: Strings package
description: >
The Flux strings package provides functions to manipulate UTF-8 encoded strings.
Import the `strings` package.
+aliases:
+ - /v2.0/reference/flux/functions/strings/
menu:
v2_0_ref:
name: Strings
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [strings, functions, package]
---
diff --git a/content/v2.0/reference/flux/functions/strings/compare.md b/content/v2.0/reference/flux/stdlib/strings/compare.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/strings/compare.md
rename to content/v2.0/reference/flux/stdlib/strings/compare.md
index c1496f2eb..2f265cf1d 100644
--- a/content/v2.0/reference/flux/functions/strings/compare.md
+++ b/content/v2.0/reference/flux/stdlib/strings/compare.md
@@ -1,6 +1,8 @@
---
title: strings.compare() function
description: The strings.compare() function compares the lexicographical order of two strings.
+aliases:
+ - /v2.0/reference/flux/functions/strings/compare/
menu:
v2_0_ref:
name: strings.compare
diff --git a/content/v2.0/reference/flux/functions/strings/containsany.md b/content/v2.0/reference/flux/stdlib/strings/containsany.md
similarity index 88%
rename from content/v2.0/reference/flux/functions/strings/containsany.md
rename to content/v2.0/reference/flux/stdlib/strings/containsany.md
index 43eade2ea..1398d51e0 100644
--- a/content/v2.0/reference/flux/functions/strings/containsany.md
+++ b/content/v2.0/reference/flux/stdlib/strings/containsany.md
@@ -3,13 +3,15 @@ title: strings.containsAny() function
description: >
The strings.containsAny() function reports whether a specified string contains
any characters from from another string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/containsany/
menu:
v2_0_ref:
name: strings.containsAny
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/containsstr
+ - /v2.0/reference/flux/stdlib/strings/containsstr
---
The `strings.containsAny()` function reports whether a specified string contains
diff --git a/content/v2.0/reference/flux/functions/strings/containsstr.md b/content/v2.0/reference/flux/stdlib/strings/containsstr.md
similarity index 87%
rename from content/v2.0/reference/flux/functions/strings/containsstr.md
rename to content/v2.0/reference/flux/stdlib/strings/containsstr.md
index fcb1edd75..fded2ed3a 100644
--- a/content/v2.0/reference/flux/functions/strings/containsstr.md
+++ b/content/v2.0/reference/flux/stdlib/strings/containsstr.md
@@ -1,13 +1,15 @@
---
title: strings.containsStr() function
description: The strings.containsStr() function reports whether a string contains a specified substring.
+aliases:
+ - /v2.0/reference/flux/functions/strings/containsstr/
menu:
v2_0_ref:
name: strings.containsStr
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/containsany
+ - /v2.0/reference/flux/stdlib/strings/containsany
---
The `strings.containsStr()` function reports whether a string contains a specified substring.
diff --git a/content/v2.0/reference/flux/functions/strings/countstr.md b/content/v2.0/reference/flux/stdlib/strings/countstr.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/strings/countstr.md
rename to content/v2.0/reference/flux/stdlib/strings/countstr.md
index 2639a9285..f7b71a4a0 100644
--- a/content/v2.0/reference/flux/functions/strings/countstr.md
+++ b/content/v2.0/reference/flux/stdlib/strings/countstr.md
@@ -3,6 +3,8 @@ title: strings.countStr() function
description: >
The strings.countStr() function counts the number of non-overlapping instances
of a substring appears in a string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/countstr/
menu:
v2_0_ref:
name: strings.countStr
diff --git a/content/v2.0/reference/flux/functions/strings/equalfold.md b/content/v2.0/reference/flux/stdlib/strings/equalfold.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/strings/equalfold.md
rename to content/v2.0/reference/flux/stdlib/strings/equalfold.md
index 4e42e30c9..d49d0c4cb 100644
--- a/content/v2.0/reference/flux/functions/strings/equalfold.md
+++ b/content/v2.0/reference/flux/stdlib/strings/equalfold.md
@@ -3,6 +3,8 @@ title: strings.equalFold() function
description: >
The strings.equalFold() function reports whether two UTF-8 strings are equal
under Unicode case-folding.
+aliases:
+ - /v2.0/reference/flux/functions/strings/equalfold/
menu:
v2_0_ref:
name: strings.equalFold
diff --git a/content/v2.0/reference/flux/functions/strings/hasprefix.md b/content/v2.0/reference/flux/stdlib/strings/hasprefix.md
similarity index 86%
rename from content/v2.0/reference/flux/functions/strings/hasprefix.md
rename to content/v2.0/reference/flux/stdlib/strings/hasprefix.md
index f76eea9f4..200aca3cf 100644
--- a/content/v2.0/reference/flux/functions/strings/hasprefix.md
+++ b/content/v2.0/reference/flux/stdlib/strings/hasprefix.md
@@ -1,13 +1,15 @@
---
title: strings.hasPrefix() function
description: The strings.hasPrefix() function indicates if a string begins with a specific prefix.
+aliases:
+ - /v2.0/reference/flux/functions/strings/hasprefix/
menu:
v2_0_ref:
name: strings.hasPrefix
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/hassuffix
+ - /v2.0/reference/flux/stdlib/strings/hassuffix
---
The `strings.hasPrefix()` function indicates if a string begins with a specified prefix.
diff --git a/content/v2.0/reference/flux/functions/strings/hassuffix.md b/content/v2.0/reference/flux/stdlib/strings/hassuffix.md
similarity index 86%
rename from content/v2.0/reference/flux/functions/strings/hassuffix.md
rename to content/v2.0/reference/flux/stdlib/strings/hassuffix.md
index 0647ad192..dfc66563a 100644
--- a/content/v2.0/reference/flux/functions/strings/hassuffix.md
+++ b/content/v2.0/reference/flux/stdlib/strings/hassuffix.md
@@ -1,13 +1,15 @@
---
title: strings.hasSuffix() function
description: The strings.hasSuffix() function indicates if a string ends with a specified suffix.
+aliases:
+ - /v2.0/reference/flux/functions/strings/hassuffix/
menu:
v2_0_ref:
name: strings.hasSuffix
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/hasprefix
+ - /v2.0/reference/flux/stdlib/strings/hasprefix
---
The `strings.hasSuffix()` function indicates if a string ends with a specified suffix.
diff --git a/content/v2.0/reference/flux/functions/strings/index-func.md b/content/v2.0/reference/flux/stdlib/strings/index-func.md
similarity index 79%
rename from content/v2.0/reference/flux/functions/strings/index-func.md
rename to content/v2.0/reference/flux/stdlib/strings/index-func.md
index c0d290cc3..7e7119871 100644
--- a/content/v2.0/reference/flux/functions/strings/index-func.md
+++ b/content/v2.0/reference/flux/stdlib/strings/index-func.md
@@ -3,15 +3,17 @@ title: strings.index() function
description: >
The strings.index() function returns the index of the first instance of a substring
in another string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/index-func/
menu:
v2_0_ref:
name: strings.index
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/indexany/
- - /v2.0/reference/flux/functions/strings/lastindex/
- - /v2.0/reference/flux/functions/strings/lastindexany/
+ - /v2.0/reference/flux/stdlib/strings/indexany/
+ - /v2.0/reference/flux/stdlib/strings/lastindex/
+ - /v2.0/reference/flux/stdlib/strings/lastindexany/
---
The `strings.index()` function returns the index of the first instance of a substring
diff --git a/content/v2.0/reference/flux/functions/strings/indexany.md b/content/v2.0/reference/flux/stdlib/strings/indexany.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/strings/indexany.md
rename to content/v2.0/reference/flux/stdlib/strings/indexany.md
index 6884dde4e..e72b922fa 100644
--- a/content/v2.0/reference/flux/functions/strings/indexany.md
+++ b/content/v2.0/reference/flux/stdlib/strings/indexany.md
@@ -2,15 +2,17 @@
title: strings.indexAny() function
description: >
The strings.indexAny() function returns the index of the first instance of specified characters in a string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/indexany/
menu:
v2_0_ref:
name: strings.indexAny
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/index-func/
- - /v2.0/reference/flux/functions/strings/lastindex/
- - /v2.0/reference/flux/functions/strings/lastindexany/
+ - /v2.0/reference/flux/stdlib/strings/index-func/
+ - /v2.0/reference/flux/stdlib/strings/lastindex/
+ - /v2.0/reference/flux/stdlib/strings/lastindexany/
---
The `strings.indexAny()` function returns the index of the first instance of specified characters in a string.
diff --git a/content/v2.0/reference/flux/functions/strings/isdigit.md b/content/v2.0/reference/flux/stdlib/strings/isdigit.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/strings/isdigit.md
rename to content/v2.0/reference/flux/stdlib/strings/isdigit.md
index 5cd7530bd..1fb0b4c63 100644
--- a/content/v2.0/reference/flux/functions/strings/isdigit.md
+++ b/content/v2.0/reference/flux/stdlib/strings/isdigit.md
@@ -1,13 +1,15 @@
---
title: strings.isDigit() function
description: The strings.isDigit() function tests if a single character string is a digit (0-9).
+aliases:
+ - /v2.0/reference/flux/functions/strings/isdigit/
menu:
v2_0_ref:
name: strings.isDigit
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/isletter/
+ - /v2.0/reference/flux/stdlib/strings/isletter/
---
The `strings.isDigit()` function tests if a single-character string is a digit (0-9).
diff --git a/content/v2.0/reference/flux/functions/strings/isletter.md b/content/v2.0/reference/flux/stdlib/strings/isletter.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/strings/isletter.md
rename to content/v2.0/reference/flux/stdlib/strings/isletter.md
index 3772a2ff6..1ba665e0c 100644
--- a/content/v2.0/reference/flux/functions/strings/isletter.md
+++ b/content/v2.0/reference/flux/stdlib/strings/isletter.md
@@ -1,13 +1,15 @@
---
title: strings.isLetter() function
description: The strings.isLetter() function tests if a single character string is a letter (a-z, A-Z).
+aliases:
+ - /v2.0/reference/flux/functions/strings/isletter/
menu:
v2_0_ref:
name: strings.isLetter
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/isdigit/
+ - /v2.0/reference/flux/stdlib/strings/isdigit/
---
The `strings.isLetter()` function tests if a single character string is a letter (a-z, A-Z).
diff --git a/content/v2.0/reference/flux/functions/strings/islower.md b/content/v2.0/reference/flux/stdlib/strings/islower.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/strings/islower.md
rename to content/v2.0/reference/flux/stdlib/strings/islower.md
index db87b0587..1f06c7ff8 100644
--- a/content/v2.0/reference/flux/functions/strings/islower.md
+++ b/content/v2.0/reference/flux/stdlib/strings/islower.md
@@ -1,13 +1,15 @@
---
title: strings.isLower() function
description: The strings.isLower() function tests if a single-character string is lowercase.
+aliases:
+ - /v2.0/reference/flux/functions/strings/islower/
menu:
v2_0_ref:
name: strings.isLower
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/isupper
+ - /v2.0/reference/flux/stdlib/strings/isupper
---
The `strings.isLower()` function tests if a single-character string is lowercase.
diff --git a/content/v2.0/reference/flux/functions/strings/isupper.md b/content/v2.0/reference/flux/stdlib/strings/isupper.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/strings/isupper.md
rename to content/v2.0/reference/flux/stdlib/strings/isupper.md
index c2dfcc30a..389faecf9 100644
--- a/content/v2.0/reference/flux/functions/strings/isupper.md
+++ b/content/v2.0/reference/flux/stdlib/strings/isupper.md
@@ -1,13 +1,15 @@
---
title: strings.isUpper() function
description: The strings.isUpper() function tests if a single character string is uppercase.
+aliases:
+ - /v2.0/reference/flux/functions/strings/isupper/
menu:
v2_0_ref:
name: strings.isUpper
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/islower
+ - /v2.0/reference/flux/stdlib/strings/islower
---
The `strings.isUpper()` function tests if a single character string is uppercase.
diff --git a/content/v2.0/reference/flux/functions/strings/joinstr.md b/content/v2.0/reference/flux/stdlib/strings/joinstr.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/strings/joinstr.md
rename to content/v2.0/reference/flux/stdlib/strings/joinstr.md
index 7aa2c7bdb..19708d29b 100644
--- a/content/v2.0/reference/flux/functions/strings/joinstr.md
+++ b/content/v2.0/reference/flux/stdlib/strings/joinstr.md
@@ -3,6 +3,8 @@ title: strings.joinStr() function
description: >
The strings.joinStr() function concatenates the elements of a string array into
a single string using a specified separator.
+aliases:
+ - /v2.0/reference/flux/functions/strings/joinstr/
menu:
v2_0_ref:
name: strings.joinStr
diff --git a/content/v2.0/reference/flux/functions/strings/lastindex.md b/content/v2.0/reference/flux/stdlib/strings/lastindex.md
similarity index 81%
rename from content/v2.0/reference/flux/functions/strings/lastindex.md
rename to content/v2.0/reference/flux/stdlib/strings/lastindex.md
index afe38b790..de47b378c 100644
--- a/content/v2.0/reference/flux/functions/strings/lastindex.md
+++ b/content/v2.0/reference/flux/stdlib/strings/lastindex.md
@@ -3,15 +3,17 @@ title: strings.lastIndex() function
description: >
The strings.lastIndex() function returns the index of the last instance of a substring
in a string or `-1` if substring is not present.
+aliases:
+ - /v2.0/reference/flux/functions/strings/lastindex/
menu:
v2_0_ref:
name: strings.lastIndex
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/index/
- - /v2.0/reference/flux/functions/strings/indexany/
- - /v2.0/reference/flux/functions/strings/lastindexany/
+ - /v2.0/reference/flux/stdlib/strings/index/
+ - /v2.0/reference/flux/stdlib/strings/indexany/
+ - /v2.0/reference/flux/stdlib/strings/lastindexany/
---
The `strings.lastIndex()` function returns the index of the last instance of a substring
diff --git a/content/v2.0/reference/flux/functions/strings/lastindexany.md b/content/v2.0/reference/flux/stdlib/strings/lastindexany.md
similarity index 81%
rename from content/v2.0/reference/flux/functions/strings/lastindexany.md
rename to content/v2.0/reference/flux/stdlib/strings/lastindexany.md
index 8fa0cdf75..3f93e97a6 100644
--- a/content/v2.0/reference/flux/functions/strings/lastindexany.md
+++ b/content/v2.0/reference/flux/stdlib/strings/lastindexany.md
@@ -1,15 +1,17 @@
---
title: strings.lastIndexAny() function
description: The `strings.lastIndexAny()` function returns the index of the last instance of any specified characters in a string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/lastindexany/
menu:
v2_0_ref:
name: strings.lastIndexAny
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/index/
- - /v2.0/reference/flux/functions/strings/indexany/
- - /v2.0/reference/flux/functions/strings/lastindex/
+ - /v2.0/reference/flux/stdlib/strings/index/
+ - /v2.0/reference/flux/stdlib/strings/indexany/
+ - /v2.0/reference/flux/stdlib/strings/lastindex/
---
The `strings.lastIndexAny()` function returns the index of the last instance of any specified characters in a string.
diff --git a/content/v2.0/reference/flux/functions/strings/repeat.md b/content/v2.0/reference/flux/stdlib/strings/repeat.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/strings/repeat.md
rename to content/v2.0/reference/flux/stdlib/strings/repeat.md
index a369afcec..07084055c 100644
--- a/content/v2.0/reference/flux/functions/strings/repeat.md
+++ b/content/v2.0/reference/flux/stdlib/strings/repeat.md
@@ -1,6 +1,8 @@
---
title: strings.repeat() function
description: The strings.repeat() function returns a string consisting of `i` copies of a specified string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/repeat/
menu:
v2_0_ref:
name: strings.repeat
diff --git a/content/v2.0/reference/flux/functions/strings/replace.md b/content/v2.0/reference/flux/stdlib/strings/replace.md
similarity index 90%
rename from content/v2.0/reference/flux/functions/strings/replace.md
rename to content/v2.0/reference/flux/stdlib/strings/replace.md
index 60aab2a20..caa1bcbd1 100644
--- a/content/v2.0/reference/flux/functions/strings/replace.md
+++ b/content/v2.0/reference/flux/stdlib/strings/replace.md
@@ -3,13 +3,15 @@ title: strings.replace() function
description: >
The strings.replace() function replaces the first `i` non-overlapping instances
of a substring with a specified replacement.
+aliases:
+ - /v2.0/reference/flux/functions/strings/replace/
menu:
v2_0_ref:
name: strings.replace
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/replaceall
+ - /v2.0/reference/flux/stdlib/strings/replaceall
---
The `strings.replace()` function replaces the first `i` non-overlapping instances
diff --git a/content/v2.0/reference/flux/functions/strings/replaceall.md b/content/v2.0/reference/flux/stdlib/strings/replaceall.md
similarity index 89%
rename from content/v2.0/reference/flux/functions/strings/replaceall.md
rename to content/v2.0/reference/flux/stdlib/strings/replaceall.md
index 0209850db..e129c6405 100644
--- a/content/v2.0/reference/flux/functions/strings/replaceall.md
+++ b/content/v2.0/reference/flux/stdlib/strings/replaceall.md
@@ -3,13 +3,15 @@ title: strings.replaceAll() function
description: >
The strings.replaceAll() function replaces all non-overlapping instances of a
substring with a specified replacement.
+aliases:
+ - /v2.0/reference/flux/functions/strings/replaceall/
menu:
v2_0_ref:
name: strings.replaceAll
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/replace
+ - /v2.0/reference/flux/stdlib/strings/replace
---
The `strings.replaceAll()` function replaces all non-overlapping instances of a
diff --git a/content/v2.0/reference/flux/functions/strings/split.md b/content/v2.0/reference/flux/stdlib/strings/split.md
similarity index 79%
rename from content/v2.0/reference/flux/functions/strings/split.md
rename to content/v2.0/reference/flux/stdlib/strings/split.md
index 705ebac48..aeea22df0 100644
--- a/content/v2.0/reference/flux/functions/strings/split.md
+++ b/content/v2.0/reference/flux/stdlib/strings/split.md
@@ -3,15 +3,17 @@ title: strings.split() function
description: >
The strings.split() function splits a string on a specified separator and returns
an array of substrings.
+aliases:
+ - /v2.0/reference/flux/functions/strings/split/
menu:
v2_0_ref:
name: strings.split
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/splitafter
- - /v2.0/reference/flux/functions/strings/splitaftern
- - /v2.0/reference/flux/functions/strings/splitn
+ - /v2.0/reference/flux/stdlib/strings/splitafter
+ - /v2.0/reference/flux/stdlib/strings/splitaftern
+ - /v2.0/reference/flux/stdlib/strings/splitn
---
The `strings.split()` function splits a string on a specified separator and returns
diff --git a/content/v2.0/reference/flux/functions/strings/splitafter.md b/content/v2.0/reference/flux/stdlib/strings/splitafter.md
similarity index 80%
rename from content/v2.0/reference/flux/functions/strings/splitafter.md
rename to content/v2.0/reference/flux/stdlib/strings/splitafter.md
index dd5e8e1c1..65e0542c7 100644
--- a/content/v2.0/reference/flux/functions/strings/splitafter.md
+++ b/content/v2.0/reference/flux/stdlib/strings/splitafter.md
@@ -3,15 +3,17 @@ title: strings.splitAfter() function
description: >
The strings.splitAfter() function splits a string after a specified separator and returns
an array of substrings.
+aliases:
+ - /v2.0/reference/flux/functions/strings/splitafter/
menu:
v2_0_ref:
name: strings.splitAfter
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/split
- - /v2.0/reference/flux/functions/strings/splitaftern
- - /v2.0/reference/flux/functions/strings/splitn
+ - /v2.0/reference/flux/stdlib/strings/split
+ - /v2.0/reference/flux/stdlib/strings/splitaftern
+ - /v2.0/reference/flux/stdlib/strings/splitn
---
The `strings.splitAfter()` function splits a string after a specified separator and returns
diff --git a/content/v2.0/reference/flux/functions/strings/splitaftern.md b/content/v2.0/reference/flux/stdlib/strings/splitaftern.md
similarity index 81%
rename from content/v2.0/reference/flux/functions/strings/splitaftern.md
rename to content/v2.0/reference/flux/stdlib/strings/splitaftern.md
index 213ee7814..f37feef5c 100644
--- a/content/v2.0/reference/flux/functions/strings/splitaftern.md
+++ b/content/v2.0/reference/flux/stdlib/strings/splitaftern.md
@@ -3,15 +3,17 @@ title: strings.splitAfterN() function
description: >
The strings.splitAfterN() function splits a string after a specified separator and returns
an array of `i` substrings.
+aliases:
+ - /v2.0/reference/flux/functions/strings/splitaftern/
menu:
v2_0_ref:
name: strings.splitAfterN
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/split
- - /v2.0/reference/flux/functions/strings/splitafter
- - /v2.0/reference/flux/functions/strings/splitn
+ - /v2.0/reference/flux/stdlib/strings/split
+ - /v2.0/reference/flux/stdlib/strings/splitafter
+ - /v2.0/reference/flux/stdlib/strings/splitn
---
The `strings.splitAfterN()` function splits a string after a specified separator and returns
diff --git a/content/v2.0/reference/flux/functions/strings/splitn.md b/content/v2.0/reference/flux/stdlib/strings/splitn.md
similarity index 81%
rename from content/v2.0/reference/flux/functions/strings/splitn.md
rename to content/v2.0/reference/flux/stdlib/strings/splitn.md
index 5575bb742..c3481beb6 100644
--- a/content/v2.0/reference/flux/functions/strings/splitn.md
+++ b/content/v2.0/reference/flux/stdlib/strings/splitn.md
@@ -3,15 +3,17 @@ title: strings.splitN() function
description: >
The strings.splitN() function splits a string on a specified separator and returns
an array of `i` substrings.
+aliases:
+ - /v2.0/reference/flux/functions/strings/splitn/
menu:
v2_0_ref:
name: strings.splitN
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/split
- - /v2.0/reference/flux/functions/strings/splitafter
- - /v2.0/reference/flux/functions/strings/splitaftern
+ - /v2.0/reference/flux/stdlib/strings/split
+ - /v2.0/reference/flux/stdlib/strings/splitafter
+ - /v2.0/reference/flux/stdlib/strings/splitaftern
---
The `strings.splitN()` function splits a string on a specified separator and returns
diff --git a/content/v2.0/reference/flux/functions/strings/strlen.md b/content/v2.0/reference/flux/stdlib/strings/strlen.md
similarity index 93%
rename from content/v2.0/reference/flux/functions/strings/strlen.md
rename to content/v2.0/reference/flux/stdlib/strings/strlen.md
index 7f07b6639..0e92561c9 100644
--- a/content/v2.0/reference/flux/functions/strings/strlen.md
+++ b/content/v2.0/reference/flux/stdlib/strings/strlen.md
@@ -3,6 +3,8 @@ title: strings.strlen() function
description: >
The strings.strlen() function returns the length of a string.
String length is determined by the number of UTF code points a string contains.
+aliases:
+ - /v2.0/reference/flux/functions/strings/strlen/
menu:
v2_0_ref:
name: strings.strlen
diff --git a/content/v2.0/reference/flux/functions/strings/substring.md b/content/v2.0/reference/flux/stdlib/strings/substring.md
similarity index 94%
rename from content/v2.0/reference/flux/functions/strings/substring.md
rename to content/v2.0/reference/flux/stdlib/strings/substring.md
index 78d3f9cf6..64cc621fd 100644
--- a/content/v2.0/reference/flux/functions/strings/substring.md
+++ b/content/v2.0/reference/flux/stdlib/strings/substring.md
@@ -3,6 +3,8 @@ title: strings.substring() function
description: >
The strings.substring() function returns a substring based on `start` and `end` parameters.
Indices are based on UTF code points.
+aliases:
+ - /v2.0/reference/flux/functions/strings/substring/
menu:
v2_0_ref:
name: strings.substring
diff --git a/content/v2.0/reference/flux/functions/strings/title.md b/content/v2.0/reference/flux/stdlib/strings/title.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/strings/title.md
rename to content/v2.0/reference/flux/stdlib/strings/title.md
index 5122fb7ea..53357507b 100644
--- a/content/v2.0/reference/flux/functions/strings/title.md
+++ b/content/v2.0/reference/flux/stdlib/strings/title.md
@@ -1,15 +1,17 @@
---
title: strings.title() function
description: The strings.title() function converts a string to title case.
+aliases:
+ - /v2.0/reference/flux/functions/strings/title/
menu:
v2_0_ref:
name: strings.title
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/tolower
- - /v2.0/reference/flux/functions/strings/totitle
- - /v2.0/reference/flux/functions/strings/toupper
+ - /v2.0/reference/flux/stdlib/strings/tolower
+ - /v2.0/reference/flux/stdlib/strings/totitle
+ - /v2.0/reference/flux/stdlib/strings/toupper
---
The `strings.title()` function converts a string to title case.
diff --git a/content/v2.0/reference/flux/functions/strings/tolower.md b/content/v2.0/reference/flux/stdlib/strings/tolower.md
similarity index 76%
rename from content/v2.0/reference/flux/functions/strings/tolower.md
rename to content/v2.0/reference/flux/stdlib/strings/tolower.md
index e64ef7ac3..1a58ccdc8 100644
--- a/content/v2.0/reference/flux/functions/strings/tolower.md
+++ b/content/v2.0/reference/flux/stdlib/strings/tolower.md
@@ -1,15 +1,17 @@
---
title: strings.toLower() function
description: The strings.toLower() function converts a string to lowercase.
+aliases:
+ - /v2.0/reference/flux/functions/strings/tolower/
menu:
v2_0_ref:
name: strings.toLower
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/totitle
- - /v2.0/reference/flux/functions/strings/toupper
- - /v2.0/reference/flux/functions/strings/title
+ - /v2.0/reference/flux/stdlib/strings/totitle
+ - /v2.0/reference/flux/stdlib/strings/toupper
+ - /v2.0/reference/flux/stdlib/strings/title
---
The `strings.toLower()` function converts a string to lowercase.
diff --git a/content/v2.0/reference/flux/functions/strings/totitle.md b/content/v2.0/reference/flux/stdlib/strings/totitle.md
similarity index 82%
rename from content/v2.0/reference/flux/functions/strings/totitle.md
rename to content/v2.0/reference/flux/stdlib/strings/totitle.md
index 197aa72ba..733219824 100644
--- a/content/v2.0/reference/flux/functions/strings/totitle.md
+++ b/content/v2.0/reference/flux/stdlib/strings/totitle.md
@@ -1,15 +1,17 @@
---
title: strings.toTitle() function
description: The strings.toTitle() function converts all characters in a string to title case.
+aliases:
+ - /v2.0/reference/flux/functions/strings/totitle/
menu:
v2_0_ref:
name: strings.toTitle
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/toupper
- - /v2.0/reference/flux/functions/strings/tolower
- - /v2.0/reference/flux/functions/strings/title
+ - /v2.0/reference/flux/stdlib/strings/toupper
+ - /v2.0/reference/flux/stdlib/strings/tolower
+ - /v2.0/reference/flux/stdlib/strings/title
---
The `strings.toTitle()` function converts all characters in a string to title case.
diff --git a/content/v2.0/reference/flux/functions/strings/toupper.md b/content/v2.0/reference/flux/stdlib/strings/toupper.md
similarity index 82%
rename from content/v2.0/reference/flux/functions/strings/toupper.md
rename to content/v2.0/reference/flux/stdlib/strings/toupper.md
index 620cc2d19..948f520a1 100644
--- a/content/v2.0/reference/flux/functions/strings/toupper.md
+++ b/content/v2.0/reference/flux/stdlib/strings/toupper.md
@@ -1,15 +1,17 @@
---
title: strings.toUpper() function
description: The strings.toUpper() function converts a string to uppercase.
+aliases:
+ - /v2.0/reference/flux/functions/strings/toupper/
menu:
v2_0_ref:
name: strings.toUpper
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/totitle
- - /v2.0/reference/flux/functions/strings/tolower
- - /v2.0/reference/flux/functions/strings/title
+ - /v2.0/reference/flux/stdlib/strings/totitle
+ - /v2.0/reference/flux/stdlib/strings/tolower
+ - /v2.0/reference/flux/stdlib/strings/title
---
The `strings.toUpper()` function converts a string to uppercase.
diff --git a/content/v2.0/reference/flux/functions/strings/trim.md b/content/v2.0/reference/flux/stdlib/strings/trim.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/strings/trim.md
rename to content/v2.0/reference/flux/stdlib/strings/trim.md
index 8c9a31ece..c9ba4fc0c 100644
--- a/content/v2.0/reference/flux/functions/strings/trim.md
+++ b/content/v2.0/reference/flux/stdlib/strings/trim.md
@@ -3,17 +3,19 @@ title: strings.trim() function
description: >
The strings.trim() function removes leading and trailing characters specified
in the cutset from a string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/trim/
menu:
v2_0_ref:
name: strings.trim
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/trimleft
- - /v2.0/reference/flux/functions/strings/trimright
- - /v2.0/reference/flux/functions/strings/trimprefix
- - /v2.0/reference/flux/functions/strings/trimsuffix
- - /v2.0/reference/flux/functions/strings/trimspace
+ - /v2.0/reference/flux/stdlib/strings/trimleft
+ - /v2.0/reference/flux/stdlib/strings/trimright
+ - /v2.0/reference/flux/stdlib/strings/trimprefix
+ - /v2.0/reference/flux/stdlib/strings/trimsuffix
+ - /v2.0/reference/flux/stdlib/strings/trimspace
---
The `strings.trim()` function removes leading and trailing characters specified
diff --git a/content/v2.0/reference/flux/functions/strings/trimleft.md b/content/v2.0/reference/flux/stdlib/strings/trimleft.md
similarity index 74%
rename from content/v2.0/reference/flux/functions/strings/trimleft.md
rename to content/v2.0/reference/flux/stdlib/strings/trimleft.md
index 5cae24ad7..f4cf088bc 100644
--- a/content/v2.0/reference/flux/functions/strings/trimleft.md
+++ b/content/v2.0/reference/flux/stdlib/strings/trimleft.md
@@ -2,17 +2,19 @@
title: strings.trimLeft() function
description: >
The strings.trimLeft() function removes specified leading characters from a string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/trimleft/
menu:
v2_0_ref:
name: strings.trimLeft
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/trim
- - /v2.0/reference/flux/functions/strings/trimright
- - /v2.0/reference/flux/functions/strings/trimprefix
- - /v2.0/reference/flux/functions/strings/trimsuffix
- - /v2.0/reference/flux/functions/strings/trimspace
+ - /v2.0/reference/flux/stdlib/strings/trim
+ - /v2.0/reference/flux/stdlib/strings/trimright
+ - /v2.0/reference/flux/stdlib/strings/trimprefix
+ - /v2.0/reference/flux/stdlib/strings/trimsuffix
+ - /v2.0/reference/flux/stdlib/strings/trimspace
---
The `strings.trimLeft()` function removes specified leading characters from a string.
diff --git a/content/v2.0/reference/flux/functions/strings/trimprefix.md b/content/v2.0/reference/flux/stdlib/strings/trimprefix.md
similarity index 74%
rename from content/v2.0/reference/flux/functions/strings/trimprefix.md
rename to content/v2.0/reference/flux/stdlib/strings/trimprefix.md
index 4c5ee718b..441b64823 100644
--- a/content/v2.0/reference/flux/functions/strings/trimprefix.md
+++ b/content/v2.0/reference/flux/stdlib/strings/trimprefix.md
@@ -3,17 +3,19 @@ title: strings.trimPrefix() function
description: >
The `strings.trimPrefix()` function removes a prefix from a string.
Strings that do not start with the prefix are returned unchanged.
+aliases:
+ - /v2.0/reference/flux/functions/strings/trimprefix/
menu:
v2_0_ref:
name: strings.trimPrefix
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/trim
- - /v2.0/reference/flux/functions/strings/trimleft
- - /v2.0/reference/flux/functions/strings/trimright
- - /v2.0/reference/flux/functions/strings/trimsuffix
- - /v2.0/reference/flux/functions/strings/trimspace
+ - /v2.0/reference/flux/stdlib/strings/trim
+ - /v2.0/reference/flux/stdlib/strings/trimleft
+ - /v2.0/reference/flux/stdlib/strings/trimright
+ - /v2.0/reference/flux/stdlib/strings/trimsuffix
+ - /v2.0/reference/flux/stdlib/strings/trimspace
---
The `strings.trimPrefix()` function removes a prefix from a string.
diff --git a/content/v2.0/reference/flux/functions/strings/trimright.md b/content/v2.0/reference/flux/stdlib/strings/trimright.md
similarity index 75%
rename from content/v2.0/reference/flux/functions/strings/trimright.md
rename to content/v2.0/reference/flux/stdlib/strings/trimright.md
index c48d02e8d..35419498d 100644
--- a/content/v2.0/reference/flux/functions/strings/trimright.md
+++ b/content/v2.0/reference/flux/stdlib/strings/trimright.md
@@ -2,17 +2,19 @@
title: strings.trimRight() function
description: >
The strings.trimRight() function removes trailing characters specified in the cutset from a string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/trimright/
menu:
v2_0_ref:
name: strings.trimRight
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/trim
- - /v2.0/reference/flux/functions/strings/trimleft
- - /v2.0/reference/flux/functions/strings/trimprefix
- - /v2.0/reference/flux/functions/strings/trimsuffix
- - /v2.0/reference/flux/functions/strings/trimspace
+ - /v2.0/reference/flux/stdlib/strings/trim
+ - /v2.0/reference/flux/stdlib/strings/trimleft
+ - /v2.0/reference/flux/stdlib/strings/trimprefix
+ - /v2.0/reference/flux/stdlib/strings/trimsuffix
+ - /v2.0/reference/flux/stdlib/strings/trimspace
---
The `strings.trimRight()` function removes trailing characters specified in the
diff --git a/content/v2.0/reference/flux/functions/strings/trimspace.md b/content/v2.0/reference/flux/stdlib/strings/trimspace.md
similarity index 69%
rename from content/v2.0/reference/flux/functions/strings/trimspace.md
rename to content/v2.0/reference/flux/stdlib/strings/trimspace.md
index 03b13c638..0645b8b71 100644
--- a/content/v2.0/reference/flux/functions/strings/trimspace.md
+++ b/content/v2.0/reference/flux/stdlib/strings/trimspace.md
@@ -1,17 +1,19 @@
---
title: strings.trimSpace() function
description: The strings.trimSpace() function removes leading and trailing spaces from a string.
+aliases:
+ - /v2.0/reference/flux/functions/strings/trimspace/
menu:
v2_0_ref:
name: strings.trimSpace
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/trim
- - /v2.0/reference/flux/functions/strings/trimleft
- - /v2.0/reference/flux/functions/strings/trimright
- - /v2.0/reference/flux/functions/strings/trimprefix
- - /v2.0/reference/flux/functions/strings/trimsuffix
+ - /v2.0/reference/flux/stdlib/strings/trim
+ - /v2.0/reference/flux/stdlib/strings/trimleft
+ - /v2.0/reference/flux/stdlib/strings/trimright
+ - /v2.0/reference/flux/stdlib/strings/trimprefix
+ - /v2.0/reference/flux/stdlib/strings/trimsuffix
---
The `strings.trimSpace()` function removes leading and trailing spaces from a string.
diff --git a/content/v2.0/reference/flux/functions/strings/trimsuffix.md b/content/v2.0/reference/flux/stdlib/strings/trimsuffix.md
similarity index 74%
rename from content/v2.0/reference/flux/functions/strings/trimsuffix.md
rename to content/v2.0/reference/flux/stdlib/strings/trimsuffix.md
index a486d50ba..7d6d12f79 100644
--- a/content/v2.0/reference/flux/functions/strings/trimsuffix.md
+++ b/content/v2.0/reference/flux/stdlib/strings/trimsuffix.md
@@ -3,17 +3,19 @@ title: strings.trimSuffix() function
description: >
The `strings.trimSuffix()` function removes a suffix from a string.
Strings that do not end with the suffix are returned unchanged.
+aliases:
+ - /v2.0/reference/flux/functions/strings/trimsuffix/
menu:
v2_0_ref:
name: strings.trimSuffix
parent: Strings
weight: 301
related:
- - /v2.0/reference/flux/functions/strings/trim
- - /v2.0/reference/flux/functions/strings/trimleft
- - /v2.0/reference/flux/functions/strings/trimright
- - /v2.0/reference/flux/functions/strings/trimprefix
- - /v2.0/reference/flux/functions/strings/trimspace
+ - /v2.0/reference/flux/stdlib/strings/trim
+ - /v2.0/reference/flux/stdlib/strings/trimleft
+ - /v2.0/reference/flux/stdlib/strings/trimright
+ - /v2.0/reference/flux/stdlib/strings/trimprefix
+ - /v2.0/reference/flux/stdlib/strings/trimspace
---
The `strings.trimSuffix()` function removes a suffix from a string.
diff --git a/content/v2.0/reference/flux/functions/system/_index.md b/content/v2.0/reference/flux/stdlib/system/_index.md
similarity index 84%
rename from content/v2.0/reference/flux/functions/system/_index.md
rename to content/v2.0/reference/flux/stdlib/system/_index.md
index 2fd7c4527..8bd1d6c9f 100644
--- a/content/v2.0/reference/flux/functions/system/_index.md
+++ b/content/v2.0/reference/flux/stdlib/system/_index.md
@@ -4,10 +4,12 @@ list_title: System package
description: >
The Flux system package provides functions for reading values from the system.
Import the `system` package.
+aliases:
+ - /v2.0/reference/flux/functions/system/
menu:
v2_0_ref:
name: System
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [system, functions, package]
---
diff --git a/content/v2.0/reference/flux/functions/system/time.md b/content/v2.0/reference/flux/stdlib/system/time.md
similarity index 92%
rename from content/v2.0/reference/flux/functions/system/time.md
rename to content/v2.0/reference/flux/stdlib/system/time.md
index 59a768a92..9d29a2ff9 100644
--- a/content/v2.0/reference/flux/functions/system/time.md
+++ b/content/v2.0/reference/flux/stdlib/system/time.md
@@ -4,6 +4,7 @@ description: The `system.time()` function returns the current system time.
aliases:
- /v2.0/reference/flux/functions/misc/systemtime
- /v2.0/reference/flux/functions/built-in/misc/systemtime
+ - /v2.0/reference/flux/functions/system/time/
menu:
v2_0_ref:
name: system.time
diff --git a/content/v2.0/reference/flux/functions/testing/_index.md b/content/v2.0/reference/flux/stdlib/testing/_index.md
similarity index 85%
rename from content/v2.0/reference/flux/functions/testing/_index.md
rename to content/v2.0/reference/flux/stdlib/testing/_index.md
index 284c9b070..e74845d88 100644
--- a/content/v2.0/reference/flux/functions/testing/_index.md
+++ b/content/v2.0/reference/flux/stdlib/testing/_index.md
@@ -4,10 +4,12 @@ list_title: Testing package
description: >
The Flux testing package provides functions that test piped-forward data in specific ways.
Import the `testing` package.
+aliases:
+ - /v2.0/reference/flux/functions/testing/
menu:
v2_0_ref:
name: Testing
- parent: Flux packages and functions
+ parent: Flux standard library
weight: 202
v2.0/tags: [testing, functions, package]
---
diff --git a/content/v2.0/reference/flux/functions/testing/assertempty.md b/content/v2.0/reference/flux/stdlib/testing/assertempty.md
similarity index 91%
rename from content/v2.0/reference/flux/functions/testing/assertempty.md
rename to content/v2.0/reference/flux/stdlib/testing/assertempty.md
index 33b7a30b1..f5d56d680 100644
--- a/content/v2.0/reference/flux/functions/testing/assertempty.md
+++ b/content/v2.0/reference/flux/stdlib/testing/assertempty.md
@@ -1,6 +1,8 @@
---
title: testing.assertEmpty() function
description: The testing.assertEmpty() function tests if an input stream is empty.
+aliases:
+ - /v2.0/reference/flux/functions/testing/assertempty/
menu:
v2_0_ref:
name: testing.assertEmpty
@@ -24,7 +26,7 @@ _The `testing.assertEmpty()` function can be used to perform in-line tests in a
## Examples
#### Check if there is a difference between streams
-This example uses the [`testing.diff()` function](/v2.0/reference/flux/functions/testing/diff)
+This example uses the [`testing.diff()` function](/v2.0/reference/flux/stdlib/testing/diff)
which outputs the diff for the two streams.
The `.testing.assertEmpty()` function checks to see if the diff is empty.
diff --git a/content/v2.0/reference/flux/functions/testing/assertequals.md b/content/v2.0/reference/flux/stdlib/testing/assertequals.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/testing/assertequals.md
rename to content/v2.0/reference/flux/stdlib/testing/assertequals.md
index 0c6fb733e..8fdee95ee 100644
--- a/content/v2.0/reference/flux/functions/testing/assertequals.md
+++ b/content/v2.0/reference/flux/stdlib/testing/assertequals.md
@@ -3,6 +3,7 @@ title: testing.assertEquals() function
description: The testing.assertEquals() function tests whether two streams have identical data.
aliases:
- /v2.0/reference/flux/functions/tests/assertequals
+ - /v2.0/reference/flux/functions/testing/assertequals/
menu:
v2_0_ref:
name: testing.assertEquals
diff --git a/content/v2.0/reference/flux/functions/testing/diff.md b/content/v2.0/reference/flux/stdlib/testing/diff.md
similarity index 96%
rename from content/v2.0/reference/flux/functions/testing/diff.md
rename to content/v2.0/reference/flux/stdlib/testing/diff.md
index db2e0af5f..8e3dd1e37 100644
--- a/content/v2.0/reference/flux/functions/testing/diff.md
+++ b/content/v2.0/reference/flux/stdlib/testing/diff.md
@@ -1,6 +1,8 @@
---
title: testing.diff() function
description: The testing.diff() function produces a diff between two streams.
+aliases:
+ - /v2.0/reference/flux/functions/testing/diff/
menu:
v2_0_ref:
name: testing.diff
diff --git a/content/v2.0/reference/glossary.md b/content/v2.0/reference/glossary.md
index b9be8986e..54b9ac46a 100644
--- a/content/v2.0/reference/glossary.md
+++ b/content/v2.0/reference/glossary.md
@@ -30,7 +30,7 @@ Related entries: [input plugin](#input-plugin), [output plugin](#output-plugin),
### aggregate
A function that returns an aggregated value across a set of points.
-For a list of available aggregation functions, see [Flux built-in aggregate functions](/v2.0/reference/flux/functions/built-in/transformations/aggregates/).
+For a list of available aggregation functions, see [Flux built-in aggregate functions](/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/).
Related entries: [function](#function), [selector](#selector), [transformation](#transformation)
@@ -92,16 +92,43 @@ A bucket is a named location where time series data is stored. All buckets have
## C
+### check
+
+Checks are part of queries used in monitoring to read input data and assign a [status](#check-status) (`_level`) based on specified conditions. For example:
+
+```
+monitor.check(
+ crit: (r) => r._value > 90.0,
+ warn: (r) => r._value > 80.0,
+ info: (r) => r._value > 60.0,
+ ok: (r) => r._value <= 20.0,
+ messageFn: (r) => "The current level is ${r._level}",
+)
+```
+
+This check gives rows with a `_value` greater than 90.0 a crit `_level`; rows greater than 80.0 get a warn `_level`, and so on.
+
+Learn how to [create a check](/v2.0/monitor-alert/checks/create/).
+
+Related entries: [check status](#check-status), [notification rule](#notification-rule), [notification endpoint](#notification-endpoint)
+
+### check status
+
+A [check](#check) gets one of the following statuses (`_level`): `crit`, `info`, `warn`, or `ok`.
+Check statuses are written to a status measurement in the `_monitoring` bucket.
+
+Related entries: [check](#check), [notification rule](#notification-rule), [notification endpoint](#notification-endpoint)
+
### CSV
Comma-separated values (CSV) delimits text between commas to separate values. A CSV file stores tabular data (numbers and text) in plain text. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. CSV file format is not fully standardized.
InfluxData uses annotated CSV (comma-separated values) format to encode HTTP responses and results returned to the Flux csv.from() function. For more detail, see [Annotated CSV](/v2.0/reference/annotated-csv/).
- [user](#user)
### date-time
@@ -220,7 +245,7 @@ Aggregating high resolution data into lower resolution data to preserve disk spa
A data type that represents a duration of time (1s, 1m, 1h, 1d). Retention policies are set using durations. Data older than the duration is automatically dropped from the database.
-Related entries: [retention policy](#retention-policy-rp)
+
## E
@@ -233,8 +258,8 @@ Metrics gathered at irregular time intervals.
In Flux, a an explicit block is a possibly empty sequence of statements within matching braces (`{ }`) that is defined in the source code, for example:
```
-Block = "{" StatementList "}
-StatementList = { Statement }
+Block = "{" StatementList "}
+StatementList = { Statement }
```
Related entries: [implicit block](#implicit-block), [block](#block)
@@ -310,9 +335,9 @@ A lightweight scripting language for querying databases (like InfluxDB) and work
### function
-Flux functions aggregate, select, and transform time series data. For a complete list of Flux functions, see [Flux functions](/v2.0/reference/flux/functions/all-functions/).
+Flux functions aggregate, select, and transform time series data. For a complete list of Flux functions, see [Flux functions](/v2.0/reference/flux/stdlib/all-functions/).
-Related entries: [aggregation](#aggregation), [selector](#selector), [transformation](#transformation)
+Related entries: [aggregate](#aggregate), [selector](#selector), [transformation](#transformation)
### function block
@@ -358,7 +383,7 @@ Related entries:
[bucket](#bucket)
[field key](#field-key),
[measurement](#measurement),
-[retention policy](#retention-policy-rp),
+
[tag key](#tag-key),
[user](#user)
@@ -398,7 +423,7 @@ The SQL-like query language used to query data in InfluxDB 1.x.
Telegraf input plugins actively gather metrics and deliver them to the core agent, where aggregator, processor, and output plugins can operate on the metrics.
In order to activate an input plugin, it needs to be enabled and configured in Telegraf's configuration file.
-Related entries: [aggregator plugin](/telegraf/v1.10/concepts/glossary/#aggregator-plugin), [collection interval](/telegraf/v1.10/concepts/glossary/#collection-interval), [output plugin](/telegraf/v1.10/concepts/glossary/#output-plugin), [processor plugin](/telegraf/v1.10/concepts/glossary/#processor-plugin)
+Related entries: [aggregator plugin](#aggregator-plugin), [collection interval](#collection-interval), [output plugin](#output-plugin), [processor plugin](#processor-plugin)
### instance
@@ -440,7 +465,7 @@ A literal is value in an expression, a number, character, string, function, obje
See examples of [Flux literals](/v2.0/reference/flux/language/expressions/#examples-of-function-literals).
-
+
Related entries: [field key](#field-key),[measurement](#measurement), [tag key](#tag-key), [tag set](#tag-set)
@@ -746,7 +785,7 @@ Related entries: [series](#series), [shard duration](#shard-duration), [shard gr
The shard duration determines how much time each shard group spans.
The specific interval is determined by the `SHARD DURATION` of the retention policy.
-