|
@ -3,6 +3,7 @@
|
||||||
.inline {
|
.inline {
|
||||||
margin: 0 .15rem;
|
margin: 0 .15rem;
|
||||||
&.middle:before { vertical-align: middle; }
|
&.middle:before { vertical-align: middle; }
|
||||||
|
&.top:before { vertical-align: text-top; }
|
||||||
&.xsmall:before { font-size: .8rem; }
|
&.xsmall:before { font-size: .8rem; }
|
||||||
&.small:before { font-size: .9rem; }
|
&.small:before { font-size: .9rem; }
|
||||||
&.large:before { font-size: 1.1rem; }
|
&.large:before { font-size: 1.1rem; }
|
||||||
|
@ -21,6 +22,28 @@
|
||||||
padding-left: .28rem;
|
padding-left: .28rem;
|
||||||
line-height: 1.25rem;
|
line-height: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.ui-toggle {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 34px;
|
||||||
|
height: 22px;
|
||||||
|
background: #1C1C21;
|
||||||
|
border: 2px solid #383846;
|
||||||
|
border-radius: .7rem;
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
|
||||||
|
.circle {
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 50%;
|
||||||
|
height: 12px;
|
||||||
|
width: 12px;
|
||||||
|
background: #22ADF6;
|
||||||
|
top: 3px;
|
||||||
|
right: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-icon {
|
.nav-icon {
|
||||||
|
|
|
@ -135,6 +135,7 @@
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
> p:only-child{ margin-bottom: 0; }
|
> p:only-child{ margin-bottom: 0; }
|
||||||
}
|
}
|
||||||
|
ul,ol { margin: -.5rem 0 1rem;}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////// Code ////////////////////////////////////
|
//////////////////////////////////// Code ////////////////////////////////////
|
||||||
|
@ -703,6 +704,14 @@
|
||||||
font-size: .8rem;
|
font-size: .8rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////// Miscellaneous ///////////////////////////////
|
||||||
|
|
||||||
|
.required {
|
||||||
|
color:#FF8564;
|
||||||
|
font-weight:700;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ To delete a Telegraf configuration:
|
||||||
{{< nav-icon "settings" >}}
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
2. Click the **Telegraf** tab.
|
2. Click the **Telegraf** tab.
|
||||||
3. Hover over the configuration you want to delete and click **Delete** on the far right.
|
3. Hover over the configuration you want to delete, click the **{{< icon "trash" >}}**
|
||||||
4. Click **Confirm**.
|
icon, and **Delete**.
|
||||||
|
|
||||||
{{< img-hd src="/img/2-0-telegraf-config-delete.png" />}}
|
{{< img-hd src="/img/2-0-telegraf-config-delete.png" />}}
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,6 @@ View Telegraf configuration information in the InfluxDB user interface (UI):
|
||||||
{{< nav-icon "settings" >}}
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
2. Click the **Telegraf** tab.
|
2. Click the **Telegraf** tab.
|
||||||
3. Hover over a configuration to view options.
|
|
||||||
|
|
||||||
{{< img-hd src="/img/2-0-telegraf-config-view.png" />}}
|
|
||||||
|
|
||||||
|
|
||||||
### View and download the telegraf.conf
|
### View and download the telegraf.conf
|
||||||
To view the actual `telegraf.conf` associated with the configuration,
|
To view the actual `telegraf.conf` associated with the configuration,
|
||||||
|
|
|
@ -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 and install InfluxDB v2.0 alpha
|
||||||
Download InfluxDB v2.0 alpha for macOS.
|
Download InfluxDB v2.0 alpha for macOS.
|
||||||
|
|
||||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.8_darwin_amd64.tar.gz" download>InfluxDB v2.0 alpha (macOS)</a>
|
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.9_darwin_amd64.tar.gz" download>InfluxDB v2.0 alpha (macOS)</a>
|
||||||
|
|
||||||
### Unpackage the InfluxDB binaries
|
### Unpackage the InfluxDB binaries
|
||||||
Unpackage the downloaded archive.
|
Unpackage the downloaded archive.
|
||||||
|
@ -90,8 +90,8 @@ influxd --reporting-disabled
|
||||||
### Download and install InfluxDB v2.0 alpha
|
### Download and install InfluxDB v2.0 alpha
|
||||||
Download the InfluxDB v2.0 alpha package appropriate for your chipset.
|
Download the InfluxDB v2.0 alpha package appropriate for your chipset.
|
||||||
|
|
||||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.8_linux_amd64.tar.gz" download >InfluxDB v2.0 alpha (amd64)</a>
|
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.9_linux_amd64.tar.gz" download >InfluxDB v2.0 alpha (amd64)</a>
|
||||||
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.8_linux_arm64.tar.gz" download >InfluxDB v2.0 alpha (arm)</a>
|
<a class="btn download" href="https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-alpha.9_linux_arm64.tar.gz" download >InfluxDB v2.0 alpha (arm)</a>
|
||||||
|
|
||||||
### Place the executables in your $PATH
|
### Place the executables in your $PATH
|
||||||
Unpackage the downloaded archive and place the `influx` and `influxd` executables in your system `$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
|
```sh
|
||||||
# Unpackage contents to the current working directory
|
# Unpackage contents to the current working directory
|
||||||
tar xvzf path/to/influxdb_2.0.0-alpha.8_linux_amd64.tar.gz
|
tar xvzf path/to/influxdb_2.0.0-alpha.9_linux_amd64.tar.gz
|
||||||
|
|
||||||
# Copy the influx and influxd binary to your $PATH
|
# Copy the influx and influxd binary to your $PATH
|
||||||
sudo cp influxdb_2.0.0-alpha.8_linux_amd64/{influx,influxd} /usr/local/bin/
|
sudo cp influxdb_2.0.0-alpha.9_linux_amd64/{influx,influxd} /usr/local/bin/
|
||||||
```
|
```
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
|
|
|
@ -8,19 +8,41 @@ menu:
|
||||||
parent: Manage buckets
|
parent: Manage buckets
|
||||||
weight: 202
|
weight: 202
|
||||||
---
|
---
|
||||||
|
Use the `influx` command line interface (CLI) or the InfluxDB user interface (UI) to update a bucket.
|
||||||
|
|
||||||
Use the InfluxDB user interface (UI) or the `influx` command line interface (CLI)
|
Note that updating an bucket's name will affect any assets that reference the bucket by name, including the following:
|
||||||
to update a bucket.
|
|
||||||
|
|
||||||
## Update a bucket in the InfluxDB UI
|
- Queries
|
||||||
|
- Dashboards
|
||||||
|
- Tasks
|
||||||
|
- Telegraf configurations
|
||||||
|
- Templates
|
||||||
|
|
||||||
|
If you change a bucket name, be sure to update the bucket in the above places as well.
|
||||||
|
|
||||||
|
|
||||||
|
## Update a bucket's name in the InfluxDB UI
|
||||||
|
|
||||||
1. Click the **Settings** tab in the navigation bar.
|
1. Click the **Settings** tab in the navigation bar.
|
||||||
|
|
||||||
{{< nav-icon "settings" >}}
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
2. Select the **Buckets** tab.
|
2. Select the **Buckets** tab.
|
||||||
3. To update a bucket's name or retention policy, click the name of the bucket from the list.
|
3. Hover over the name of the bucket you want to rename in the list.
|
||||||
4. Click **Update** to save.
|
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**.
|
||||||
|
|
||||||
|
## Update a bucket's retention policy in the InfluxDB UI
|
||||||
|
|
||||||
|
1. Click the **Settings** tab in the navigation bar.
|
||||||
|
|
||||||
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
|
2. Select the **Buckets** tab.
|
||||||
|
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**.
|
||||||
|
|
||||||
## Update a bucket using the influx CLI
|
## Update a bucket using the influx CLI
|
||||||
|
|
||||||
|
|
|
@ -9,19 +9,30 @@ menu:
|
||||||
weight: 103
|
weight: 103
|
||||||
---
|
---
|
||||||
|
|
||||||
Use the `influx` command line interface (CLI) to update an organization.
|
Use the `influx` command line interface (CLI) or the InfluxDB user interface (UI) to update an organization.
|
||||||
|
|
||||||
|
Note that updating an organization's name will affect any assets that reference the organization by name, including the following:
|
||||||
|
|
||||||
|
- Queries
|
||||||
|
- Dashboards
|
||||||
|
- Tasks
|
||||||
|
- Telegraf configurations
|
||||||
|
- Templates
|
||||||
|
|
||||||
|
If you change an organization name, be sure to update the organization in the above places as well.
|
||||||
|
|
||||||
<!---
|
|
||||||
## Update an organization in the InfluxDB UI
|
## Update an organization in the InfluxDB UI
|
||||||
|
|
||||||
1. Click the **Influx** icon in the navigation bar.
|
1. Click the **Settings** icon in the navigation bar.
|
||||||
|
|
||||||
{{< nav-icon "admin" >}}
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
|
2. Click the **Org Profile** tab.
|
||||||
|
3. Click **Rename**.
|
||||||
|
4. In the window that appears, review the information and click **I understand, let's rename my organization**.
|
||||||
|
5. Enter a new name for your organization.
|
||||||
|
6. Click **Change organization name**.
|
||||||
|
|
||||||
2. Click on the organization you want to update in the list.
|
|
||||||
3. To update the organization's name, select the **Options** tab.
|
|
||||||
4. To manage the organization's members, buckets, dashboards, and tasks, click on the corresponding tabs.
|
|
||||||
-->
|
|
||||||
## Update an organization using the influx CLI
|
## Update an organization using the influx CLI
|
||||||
|
|
||||||
Use the [`influx org update` command](/v2.0/reference/cli/influx/org/update)
|
Use the [`influx org update` command](/v2.0/reference/cli/influx/org/update)
|
||||||
|
|
|
@ -11,14 +11,16 @@ weight: 5
|
||||||
v2.0/tags: [tasks]
|
v2.0/tags: [tasks]
|
||||||
---
|
---
|
||||||
|
|
||||||
Process and analyze your data with tasks in the InfluxDB _**task engine**. Use tasks (scheduled Flux queries)
|
Process and analyze your data with tasks in the InfluxDB **task engine**. Use tasks (scheduled Flux queries)
|
||||||
to input a data stream and then analyze, modify, and act on the data accordingly.
|
to input a data stream and then analyze, modify, and act on the data accordingly.
|
||||||
|
|
||||||
Discover how to configure and build tasks using the InfluxDB user interface (UI) and the `influx` command line interface (CLI).
|
Discover how to create and manage tasks using the InfluxDB user interface (UI)
|
||||||
Find examples of data downsampling, anomaly detection_(Coming)_, alerting _(Coming)_, and other common tasks.
|
and the `influx` command line interface (CLI).
|
||||||
|
Find examples of data downsampling, anomaly detection _(Coming)_, alerting
|
||||||
|
_(Coming)_, and other common tasks.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
Tasks replace InfluxDB v1.x's continuous queries.
|
Tasks replace InfluxDB v1.x continuous queries.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
{{< children >}}
|
{{< children >}}
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
---
|
---
|
||||||
title: Write an InfluxDB task
|
title: Get started with InfluxDB tasks
|
||||||
seotitle: Write an InfluxDB task that processes data
|
list_title: Get started with tasks
|
||||||
description: >
|
description: >
|
||||||
How to write an InfluxDB task that processes data in some way, then performs an action
|
Learn the basics of writing an InfluxDB task that processes data, and then performs an action,
|
||||||
such as storing the modified data in a new bucket or sending an alert.
|
such as storing the modified data in a new bucket or sending an alert.
|
||||||
|
aliases:
|
||||||
|
- /v2.0/process-data/write-a-task/
|
||||||
v2.0/tags: [tasks]
|
v2.0/tags: [tasks]
|
||||||
menu:
|
menu:
|
||||||
v2_0:
|
v2_0:
|
||||||
name: Write a task
|
name: Get started with tasks
|
||||||
parent: Process data
|
parent: Process data
|
||||||
weight: 101
|
weight: 101
|
||||||
---
|
---
|
|
@ -1,9 +1,10 @@
|
||||||
---
|
---
|
||||||
title: Manage tasks in InfluxDB
|
title: Manage tasks in InfluxDB
|
||||||
seotitle: Manage data processing tasks in InfluxDB
|
seotitle: Manage data processing tasks in InfluxDB
|
||||||
|
list_title: Manage tasks
|
||||||
description: >
|
description: >
|
||||||
InfluxDB provides options for managing the creation, reading, updating, and deletion
|
InfluxDB provides options for creating, reading, updating, and deleting tasks
|
||||||
of tasks using both the 'influx' CLI and the InfluxDB UI.
|
using both the `influx` CLI and the InfluxDB UI.
|
||||||
v2.0/tags: [tasks]
|
v2.0/tags: [tasks]
|
||||||
menu:
|
menu:
|
||||||
v2_0:
|
v2_0:
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: Create a task
|
||||||
seotitle: Create a task for processing data in InfluxDB
|
seotitle: Create a task for processing data in InfluxDB
|
||||||
description: >
|
description: >
|
||||||
How to create a task that processes data in InfluxDB using the InfluxDB user
|
How to create a task that processes data in InfluxDB using the InfluxDB user
|
||||||
interface or the 'influx' command line interface.
|
interface or the `influx` command line interface.
|
||||||
menu:
|
menu:
|
||||||
v2_0:
|
v2_0:
|
||||||
name: Create a task
|
name: Create a task
|
||||||
|
@ -14,7 +14,10 @@ weight: 201
|
||||||
InfluxDB provides multiple ways to create tasks both in the InfluxDB user interface (UI)
|
InfluxDB provides multiple ways to create tasks both in the InfluxDB user interface (UI)
|
||||||
and the `influx` command line interface (CLI).
|
and the `influx` command line interface (CLI).
|
||||||
|
|
||||||
_This article assumes you have already [written a task](/v2.0/process-data/write-a-task)._
|
_Before creating a task, review the [basics criteria for writing a task](/v2.0/process-data/get-started)._
|
||||||
|
|
||||||
|
- [InfluxDB UI](#create-a-task-in-the-influxdb-ui)
|
||||||
|
- [`influx` CLI](#create-a-task-using-the-influx-cli)
|
||||||
|
|
||||||
## Create a task in the InfluxDB UI
|
## Create a task in the InfluxDB UI
|
||||||
The InfluxDB UI provides multiple ways to create a task:
|
The InfluxDB UI provides multiple ways to create a task:
|
||||||
|
@ -22,6 +25,8 @@ The InfluxDB UI provides multiple ways to create a task:
|
||||||
- [Create a task from the Data Explorer](#create-a-task-from-the-data-explorer)
|
- [Create a task from the Data Explorer](#create-a-task-from-the-data-explorer)
|
||||||
- [Create a task in the Task UI](#create-a-task-in-the-task-ui)
|
- [Create a task in the Task UI](#create-a-task-in-the-task-ui)
|
||||||
- [Import a task](#import-a-task)
|
- [Import a task](#import-a-task)
|
||||||
|
- [Create a task from a template](#create-a-task-from-a-template)
|
||||||
|
- [Clone a task](#clone-a-task)
|
||||||
|
|
||||||
### Create a task from the Data Explorer
|
### Create a task from the Data Explorer
|
||||||
1. Click on the **Data Explorer** icon in the left navigation menu.
|
1. Click on the **Data Explorer** icon in the left navigation menu.
|
||||||
|
@ -41,11 +46,12 @@ The InfluxDB UI provides multiple ways to create a task:
|
||||||
|
|
||||||
{{< nav-icon "tasks" >}}
|
{{< nav-icon "tasks" >}}
|
||||||
|
|
||||||
2. Click **+ Create Task** in the upper right.
|
2. Click **{{< icon "plus" >}} Create Task** in the upper right.
|
||||||
3. In the left panel, specify the task options.
|
3. Select **New Task**.
|
||||||
See [Task options](/v2.0/process-data/task-options)for detailed information about each option.
|
4. In the left panel, specify the task options.
|
||||||
4. In the right panel, enter your task script.
|
See [Task options](/v2.0/process-data/task-options) for detailed information about each option.
|
||||||
5. Click **Save** in the upper right.
|
5. In the right panel, enter your task script.
|
||||||
|
6. Click **Save** in the upper right.
|
||||||
|
|
||||||
{{< img-hd src="/img/2-0-tasks-create-edit.png" title="Create a task" />}}
|
{{< img-hd src="/img/2-0-tasks-create-edit.png" title="Create a task" />}}
|
||||||
|
|
||||||
|
@ -56,15 +62,27 @@ The InfluxDB UI provides multiple ways to create a task:
|
||||||
|
|
||||||
2. Click **+ Create Task** in the upper right.
|
2. Click **+ Create Task** in the upper right.
|
||||||
3. Select **Import Task**.
|
3. Select **Import Task**.
|
||||||
3. Drag and drop or select a file to upload.
|
4. Upload a JSON task file using one of the following options:
|
||||||
4. Click **Import JSON as Task**.
|
- Drag and drop a JSON task file in the specified area.
|
||||||
|
- Click to upload and the area to select the JSON task from from your file manager.
|
||||||
|
- Select the **JSON** option and paste in raw task JSON.
|
||||||
|
5. Click **Import JSON as Task**.
|
||||||
|
|
||||||
|
### Create a task from a template
|
||||||
|
1. Click on the **Settings** icon in the left navigation menu.
|
||||||
|
|
||||||
|
{{< nav-icon "Settings" >}}
|
||||||
|
|
||||||
|
2. Select **Templates**.
|
||||||
|
3. Hover over the template to use to create the task and click **Create**.
|
||||||
|
|
||||||
|
|
||||||
### Clone a task
|
### Clone a task
|
||||||
1. Click on the **Tasks** icon in the left navigation menu.
|
1. Click on the **Tasks** icon in the left navigation menu.
|
||||||
|
|
||||||
{{< nav-icon "tasks" >}}
|
{{< nav-icon "tasks" >}}
|
||||||
|
|
||||||
2. Hover over the task you would like to clone and click the **{{< icon "duplicate" >}}** that appears.
|
2. Hover over the task you would like to clone and click the **{{< icon "duplicate" >}}** icon that appears.
|
||||||
4. Click **Clone**.
|
4. Click **Clone**.
|
||||||
|
|
||||||
## Create a task using the influx CLI
|
## Create a task using the influx CLI
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: Delete a task
|
||||||
seotitle: Delete a task for processing data in InfluxDB
|
seotitle: Delete a task for processing data in InfluxDB
|
||||||
description: >
|
description: >
|
||||||
How to delete a task in InfluxDB using the InfluxDB user interface or using
|
How to delete a task in InfluxDB using the InfluxDB user interface or using
|
||||||
the 'influx' command line interface.
|
the `influx` command line interface.
|
||||||
menu:
|
menu:
|
||||||
v2_0:
|
v2_0:
|
||||||
name: Delete a task
|
name: Delete a task
|
||||||
|
|
|
@ -18,9 +18,9 @@ Tasks are exported as downloadable JSON files.
|
||||||
{{< nav-icon "tasks" >}}
|
{{< nav-icon "tasks" >}}
|
||||||
|
|
||||||
2. In the list of tasks, hover over the task you would like to export and click
|
2. In the list of tasks, hover over the task you would like to export and click
|
||||||
the **{{< icon "gear" >}}** that appears.
|
the **{{< icon "gear" >}}** icon that appears.
|
||||||
3. Select **Export**.
|
3. Select **Export**.
|
||||||
4. There are multiple options for downloading or saving the task export file:
|
4. Downloading or save the task export file using one of the following options:
|
||||||
- Click **Download JSON** to download the exported JSON file.
|
- Click **Download JSON** to download the exported JSON file.
|
||||||
- Click **Save as template** to save the export file as a task template.
|
- Click **Save as template** to save the export file as a task template.
|
||||||
- Click **Copy to Clipboard** to copy the raw JSON content to your machine's clipboard.
|
- Click **Copy to Clipboard** to copy the raw JSON content to your machine's clipboard.
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: Update a task
|
||||||
seotitle: Update a task for processing data in InfluxDB
|
seotitle: Update a task for processing data in InfluxDB
|
||||||
description: >
|
description: >
|
||||||
How to update a task that processes data in InfluxDB using the InfluxDB user
|
How to update a task that processes data in InfluxDB using the InfluxDB user
|
||||||
interface or the 'influx' command line interface.
|
interface or the `influx` command line interface.
|
||||||
menu:
|
menu:
|
||||||
v2_0:
|
v2_0:
|
||||||
name: Update a task
|
name: Update a task
|
||||||
|
@ -17,7 +17,7 @@ To view your tasks, click the **Tasks** icon in the left navigation menu.
|
||||||
{{< nav-icon "tasks" >}}
|
{{< nav-icon "tasks" >}}
|
||||||
|
|
||||||
#### Update a task's Flux script
|
#### Update a task's Flux script
|
||||||
1. In the list of tasks, click the **Name** of the task you would like to update.
|
1. In the list of tasks, click the **Name** of the task you want to update.
|
||||||
2. In the left panel, modify the task options.
|
2. In the left panel, modify the task options.
|
||||||
3. In the right panel, modify the task script.
|
3. In the right panel, modify the task script.
|
||||||
4. Click **Save** in the upper right.
|
4. Click **Save** in the upper right.
|
||||||
|
@ -25,9 +25,8 @@ To view your tasks, click the **Tasks** icon in the left navigation menu.
|
||||||
{{< img-hd src="/img/2-0-tasks-create-edit.png" alt="Update a task" />}}
|
{{< img-hd src="/img/2-0-tasks-create-edit.png" alt="Update a task" />}}
|
||||||
|
|
||||||
#### Update the status of a task
|
#### Update the status of a task
|
||||||
In the list of tasks, click the toggle in the **Active** column of the task you
|
In the list of tasks, click the {{< icon "toggle" >}} toggle to the left of the
|
||||||
would like to activate or inactivate.
|
task you want to activate or inactivate.
|
||||||
|
|
||||||
|
|
||||||
## Update a task with the influx CLI
|
## Update a task with the influx CLI
|
||||||
Use the `influx task update` command to update or change the status of an existing task.
|
Use the `influx task update` command to update or change the status of an existing task.
|
||||||
|
@ -36,7 +35,7 @@ _This command requires a task ID, which is available in the output of `influx ta
|
||||||
|
|
||||||
#### Update a task's Flux script
|
#### Update a task's Flux script
|
||||||
Pass the file path of your updated Flux script to the `influx task update` command
|
Pass the file path of your updated Flux script to the `influx task update` command
|
||||||
with the ID of the task you would like to update.
|
with the ID of the task you want to update.
|
||||||
Modified [task options](/v2.0/process-data/task-options) defined in the Flux
|
Modified [task options](/v2.0/process-data/task-options) defined in the Flux
|
||||||
script are also updated.
|
script are also updated.
|
||||||
|
|
||||||
|
@ -49,7 +48,7 @@ influx task update -i 0343698431c35000 @/tasks/cq-mean-1h.flux
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Update the status of a task
|
#### Update the status of a task
|
||||||
Pass the ID of the task you would like to update to the `influx task update`
|
Pass the ID of the task you want to update to the `influx task update`
|
||||||
command with the `--status` flag.
|
command with the `--status` flag.
|
||||||
|
|
||||||
_Possible arguments of the `--status` flag are `active` or `inactive`._
|
_Possible arguments of the `--status` flag are `active` or `inactive`._
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: View tasks
|
||||||
seotitle: View created tasks that process data in InfluxDB
|
seotitle: View created tasks that process data in InfluxDB
|
||||||
description: >
|
description: >
|
||||||
How to view all created data processing tasks using the InfluxDB user interface
|
How to view all created data processing tasks using the InfluxDB user interface
|
||||||
or the 'influx' command line interface.
|
or the `influx` command line interface.
|
||||||
menu:
|
menu:
|
||||||
v2_0:
|
v2_0:
|
||||||
name: View tasks
|
name: View tasks
|
||||||
|
@ -18,10 +18,10 @@ Click the **Tasks** icon in the left navigation to view the lists of tasks.
|
||||||
|
|
||||||
### Filter the list of tasks
|
### Filter the list of tasks
|
||||||
|
|
||||||
1. Enable the **Show Inactive** option to include inactive tasks in the list.
|
1. Click the **Show Inactive** {{< icon "toggle" >}} toggle to include or exclude
|
||||||
2. Enter text in the **Filter tasks by name** field to search for tasks by name.
|
inactive tasks in the list.
|
||||||
3. Select an organization from the **All Organizations** dropdown to filter the list by organization.
|
2. Enter text in the **Filter tasks** field to search for tasks by name or label.
|
||||||
4. Click on the heading of any column to sort by that field.
|
3. Click on the heading of any column to sort by that field.
|
||||||
|
|
||||||
## View tasks with the influx CLI
|
## View tasks with the influx CLI
|
||||||
Use the `influx task find` command to return a list of created tasks.
|
Use the `influx task find` command to return a list of created tasks.
|
||||||
|
|
|
@ -62,7 +62,14 @@ shaping your data for the desired output.
|
||||||
|
|
||||||
###### Example group key
|
###### Example group key
|
||||||
```js
|
```js
|
||||||
[_start, _stop, _field, _measurement, host]
|
Group key: [_start, _stop, _field]
|
||||||
|
_start:time _stop:time _field:string _time:time _value:float
|
||||||
|
------------------------------ ------------------------------ ---------------------- ------------------------------ ----------------------------
|
||||||
|
2019-04-25T17:33:55.196959000Z 2019-04-25T17:34:55.196959000Z used_percent 2019-04-25T17:33:56.000000000Z 65.55318832397461
|
||||||
|
2019-04-25T17:33:55.196959000Z 2019-04-25T17:34:55.196959000Z used_percent 2019-04-25T17:34:06.000000000Z 65.52391052246094
|
||||||
|
2019-04-25T17:33:55.196959000Z 2019-04-25T17:34:55.196959000Z used_percent 2019-04-25T17:34:16.000000000Z 65.49603939056396
|
||||||
|
2019-04-25T17:33:55.196959000Z 2019-04-25T17:34:55.196959000Z used_percent 2019-04-25T17:34:26.000000000Z 65.51754474639893
|
||||||
|
2019-04-25T17:33:55.196959000Z 2019-04-25T17:34:55.196959000Z used_percent 2019-04-25T17:34:36.000000000Z 65.536737442016
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that `_time` and `_value` are excluded from the example group key because they
|
Note that `_time` and `_value` are excluded from the example group key because they
|
||||||
|
|
|
@ -0,0 +1,179 @@
|
||||||
|
---
|
||||||
|
title: Query using conditional logic
|
||||||
|
seotitle: Query using conditional logic in Flux
|
||||||
|
description: >
|
||||||
|
This guide describes how to use Flux conditional expressions, such as `if`,
|
||||||
|
`else`, and `then`, to query and transform data.
|
||||||
|
v2.0/tags: [conditionals, flux]
|
||||||
|
menu:
|
||||||
|
v2_0:
|
||||||
|
name: Query using conditionals
|
||||||
|
parent: How-to guides
|
||||||
|
weight: 209
|
||||||
|
---
|
||||||
|
|
||||||
|
Flux provides `if`, `then`, and `else` conditional expressions that allow for powerful and flexible Flux queries.
|
||||||
|
|
||||||
|
##### Conditional expression syntax
|
||||||
|
```js
|
||||||
|
// Pattern
|
||||||
|
if <condition> then <action> else <alternative-action>
|
||||||
|
|
||||||
|
// Example
|
||||||
|
if color == "green" then "008000" else "ffffff"
|
||||||
|
```
|
||||||
|
|
||||||
|
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/aggregations/reduce) ).
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
- [Conditionally set the value of a variable](#conditionally-set-the-value-of-a-variable)
|
||||||
|
- [Create conditional filters](#create-conditional-filters)
|
||||||
|
- [Conditionally transform column values with map()](#conditionally-transform-column-values-with-map)
|
||||||
|
- [Conditionally increment a count with reduce()](#conditionally-increment-a-count-with-reduce)
|
||||||
|
|
||||||
|
### Conditionally set the value of a variable
|
||||||
|
The following example sets the `overdue` variable based on the
|
||||||
|
`dueDate` variable's relation to `now()`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
dueDate = 2019-05-01
|
||||||
|
overdue = if dueDate < now() then true else false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Create conditional filters
|
||||||
|
The following example uses an example `metric` [dashboard variable](/v2.0/visualize-data/variables/)
|
||||||
|
to change how the query filters data.
|
||||||
|
`metric` has three possible values:
|
||||||
|
|
||||||
|
- Memory
|
||||||
|
- CPU
|
||||||
|
- Disk
|
||||||
|
|
||||||
|
```js
|
||||||
|
from(bucket: "example-bucket")
|
||||||
|
|> range(start: -1h)
|
||||||
|
|> filter(fn: (r) =>
|
||||||
|
if v.metric == "Memory"
|
||||||
|
then r._measurement == "mem" and r._field == "used_percent"
|
||||||
|
else if v.metric == "CPU"
|
||||||
|
then r._measurement == "cpu" and r._field == "usage_user"
|
||||||
|
else if v.metric == "Disk"
|
||||||
|
then r._measurement == "disk" and r._field == "used_percent"
|
||||||
|
else r._measurement != ""
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Conditionally transform column values with map()
|
||||||
|
The following example uses the [`map()` function](/v2.0/reference/flux/functions/built-in/transformations/map/)
|
||||||
|
to conditionally transform column values.
|
||||||
|
It sets the `level` column to a specific string based on `_value` column.
|
||||||
|
|
||||||
|
{{< code-tabs-wrapper >}}
|
||||||
|
{{% code-tabs %}}
|
||||||
|
[No Comments](#)
|
||||||
|
[Comments](#)
|
||||||
|
{{% /code-tabs %}}
|
||||||
|
{{% code-tab-content %}}
|
||||||
|
```js
|
||||||
|
from(bucket: "example-bucket")
|
||||||
|
|> range(start: -5m)
|
||||||
|
|> filter(fn: (r) => r._measurement == "mem" and r._field == "used_percent" )
|
||||||
|
|> map(fn: (r) => ({
|
||||||
|
_time: r._time,
|
||||||
|
_value: r._value,
|
||||||
|
level:
|
||||||
|
if r._value >= 95.0000001 and r._value <= 100.0 then "critical"
|
||||||
|
else if r._value >= 85.0000001 and r._value <= 95.0 then "warning"
|
||||||
|
else if r._value >= 70.0000001 and r._value <= 85.0 then "high"
|
||||||
|
else "normal"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
{{% /code-tab-content %}}
|
||||||
|
{{% code-tab-content %}}
|
||||||
|
```js
|
||||||
|
from(bucket: "example-bucket")
|
||||||
|
|> range(start: -5m)
|
||||||
|
|> filter(fn: (r) => r._measurement == "mem" and r._field == "used_percent" )
|
||||||
|
|> map(fn: (r) => ({
|
||||||
|
// Retain the _time column in the mapped row
|
||||||
|
_time: r._time,
|
||||||
|
// Retain the _value column in the mapped row
|
||||||
|
_value: r._value,
|
||||||
|
// Set the level column value based on the _value column
|
||||||
|
level:
|
||||||
|
if r._value >= 95.0000001 and r._value <= 100.0 then "critical"
|
||||||
|
else if r._value >= 85.0000001 and r._value <= 95.0 then "warning"
|
||||||
|
else if r._value >= 70.0000001 and r._value <= 85.0 then "high"
|
||||||
|
else "normal"
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
{{% /code-tab-content %}}
|
||||||
|
{{< /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/)
|
||||||
|
functions to count the number of records in every five minute window that exceed a defined threshold.
|
||||||
|
|
||||||
|
{{< code-tabs-wrapper >}}
|
||||||
|
{{% code-tabs %}}
|
||||||
|
[No Comments](#)
|
||||||
|
[Comments](#)
|
||||||
|
{{% /code-tabs %}}
|
||||||
|
{{% code-tab-content %}}
|
||||||
|
```js
|
||||||
|
threshold = 65.0
|
||||||
|
|
||||||
|
data = from(bucket: "example-bucket")
|
||||||
|
|> range(start: -1h)
|
||||||
|
|> filter(fn: (r) => r._measurement == "mem" and r._field == "used_percent" )
|
||||||
|
|> aggregateWindow(
|
||||||
|
every: 5m,
|
||||||
|
fn: (column, tables=<-) => tables |> reduce(
|
||||||
|
identity: {above_threshold_count: 0.0},
|
||||||
|
fn: (r, accumulator) => ({
|
||||||
|
above_threshold_count:
|
||||||
|
if r._value >= threshold then accumulator.above_threshold_count + 1.0
|
||||||
|
else accumulator.above_threshold_count + 0.0
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
{{% /code-tab-content %}}
|
||||||
|
{{% code-tab-content %}}
|
||||||
|
```js
|
||||||
|
threshold = 65.0
|
||||||
|
|
||||||
|
data = from(bucket: "example-bucket")
|
||||||
|
|> range(start: -1h)
|
||||||
|
|> filter(fn: (r) => r._measurement == "mem" and r._field == "used_percent" )
|
||||||
|
// Aggregate data into 5 minute windows using a custom reduce() function
|
||||||
|
|> aggregateWindow(
|
||||||
|
every: 5m,
|
||||||
|
// Use a custom function in the fn parameter.
|
||||||
|
// The aggregateWindow fn parameter requires 'column' and 'tables' parameters.
|
||||||
|
fn: (column, tables=<-) => tables |> reduce(
|
||||||
|
identity: {above_threshold_count: 0.0},
|
||||||
|
fn: (r, accumulator) => ({
|
||||||
|
// Conditionally increment above_threshold_count if
|
||||||
|
// r.value exceeds the threshold
|
||||||
|
above_threshold_count:
|
||||||
|
if r._value >= threshold then accumulator.above_threshold_count + 1.0
|
||||||
|
else accumulator.above_threshold_count + 0.0
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
{{% /code-tab-content %}}
|
||||||
|
{{< /code-tabs-wrapper >}}
|
|
@ -49,6 +49,7 @@ retrieving authentication tokens._
|
||||||
| [bucket](/v2.0/reference/cli/influx/bucket) | Bucket management commands |
|
| [bucket](/v2.0/reference/cli/influx/bucket) | Bucket management commands |
|
||||||
| [help](/v2.0/reference/cli/influx/help) | Help about any command |
|
| [help](/v2.0/reference/cli/influx/help) | Help about any command |
|
||||||
| [org](/v2.0/reference/cli/influx/org) | Organization management commands |
|
| [org](/v2.0/reference/cli/influx/org) | Organization management commands |
|
||||||
|
| [ping](/v2.0/reference/cli/influx/ping) | Check the InfluxDB `/health` endpoint |
|
||||||
| [query](/v2.0/reference/cli/influx/query) | Execute a Flux query |
|
| [query](/v2.0/reference/cli/influx/query) | Execute a Flux query |
|
||||||
| [repl](/v2.0/reference/cli/influx/repl) | Interactive REPL (read-eval-print-loop) |
|
| [repl](/v2.0/reference/cli/influx/repl) | Interactive REPL (read-eval-print-loop) |
|
||||||
| [setup](/v2.0/reference/cli/influx/setup) | Create default username, password, org, bucket, etc. |
|
| [setup](/v2.0/reference/cli/influx/setup) | Create default username, password, org, bucket, etc. |
|
||||||
|
|
|
@ -21,13 +21,13 @@ influx auth [command]
|
||||||
`auth`, `authorization`
|
`auth`, `authorization`
|
||||||
|
|
||||||
## Subcommands
|
## Subcommands
|
||||||
| Subcommand | Description |
|
| Subcommand | Description |
|
||||||
|:---------- |:----------- |
|
|:---------- |:----------- |
|
||||||
| [active](/v2.0/reference/cli/influx/auth/active) | Active authorization |
|
| [active](/v2.0/reference/cli/influx/auth/active) | Activate authorization |
|
||||||
| [create](/v2.0/reference/cli/influx/auth/create) | Create authorization |
|
| [create](/v2.0/reference/cli/influx/auth/create) | Create authorization |
|
||||||
| [delete](/v2.0/reference/cli/influx/auth/delete) | Delete authorization |
|
| [delete](/v2.0/reference/cli/influx/auth/delete) | Delete authorization |
|
||||||
| [find](/v2.0/reference/cli/influx/auth/find) | Find authorization |
|
| [find](/v2.0/reference/cli/influx/auth/find) | Find authorization |
|
||||||
| [inactive](/v2.0/reference/cli/influx/auth/inactive) | Inactive authorization |
|
| [inactive](/v2.0/reference/cli/influx/auth/inactive) | Inactivate authorization |
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
|
|
|
@ -20,6 +20,8 @@ influx auth find [flags]
|
||||||
|:---- |:----------- |:----------: |
|
|:---- |:----------- |:----------: |
|
||||||
| `-h`, `--help` | Help for the `find` command | |
|
| `-h`, `--help` | Help for the `find` command | |
|
||||||
| `-i`, `--id` | The authorization ID | string |
|
| `-i`, `--id` | The authorization ID | string |
|
||||||
|
| `-o`, `--org` | The organization | string |
|
||||||
|
| `--org-id` | The organization ID | string |
|
||||||
| `-u`, `--user` | The user | string |
|
| `-u`, `--user` | The user | string |
|
||||||
| `--user-id` | The user ID | string |
|
| `--user-id` | The user ID | string |
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ influx bucket create [flags]
|
||||||
|:---- |:----------- |:----------: |
|
|:---- |:----------- |:----------: |
|
||||||
| `-h`, `--help` | Help for the `create` command | |
|
| `-h`, `--help` | Help for the `create` command | |
|
||||||
| `-n`, `--name` | Name of bucket that will be created | string |
|
| `-n`, `--name` | Name of bucket that will be created | string |
|
||||||
| `-o`, `--org` | Name of the organization that owns the bucket | string |
|
|
||||||
| `--org-id` | The ID of the organization that owns the bucket | string |
|
| `--org-id` | The ID of the organization that owns the bucket | string |
|
||||||
| `-r`, `--retention` | Duration in nanoseconds data will live in bucket | duration |
|
| `-r`, `--retention` | Duration in nanoseconds data will live in bucket | duration |
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
---
|
||||||
|
title: influx ping – Check the health of InfluxDB
|
||||||
|
description: >
|
||||||
|
The `influx ping` command checks the health of a running InfluxDB instance by
|
||||||
|
querying the `/health` endpoint.
|
||||||
|
menu:
|
||||||
|
v2_0_ref:
|
||||||
|
name: influx ping
|
||||||
|
parent: influx
|
||||||
|
weight: 101
|
||||||
|
v2.0/tags: [ping, health]
|
||||||
|
---
|
||||||
|
|
||||||
|
The `influx ping` command checks the health of a running InfluxDB instance by
|
||||||
|
querying the `/health` endpoint.
|
||||||
|
It does not require an authorization token.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```
|
||||||
|
influx ping [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Flags
|
||||||
|
| Flag | Description |
|
||||||
|
|:---- |:----------- |
|
||||||
|
| `-h`, `--help` | Help for the `ping` command |
|
||||||
|
|
||||||
|
## Global Flags
|
||||||
|
| Global flag | Description | Input type |
|
||||||
|
|:----------- |:----------- |:----------:|
|
||||||
|
| `--host` | HTTP address of InfluxDB (default `http://localhost:9999`) | string |
|
||||||
|
| `--local` | Run commands locally against the filesystem | |
|
||||||
|
| `-t`, `--token` | API token to be used throughout client calls | string |
|
|
@ -21,6 +21,7 @@ influx task find [flags]
|
||||||
| `-h`, `--help` | Help for `find` | |
|
| `-h`, `--help` | Help for `find` | |
|
||||||
| `-i`, `--id` | Task ID | string |
|
| `-i`, `--id` | Task ID | string |
|
||||||
| `--limit` | The number of tasks to find (default `100`) | integer |
|
| `--limit` | The number of tasks to find (default `100`) | integer |
|
||||||
|
| `--org` | Task organization name | string |
|
||||||
| `--org-id` | Task organization ID | string |
|
| `--org-id` | Task organization ID | string |
|
||||||
| `-n`, `--user-id` | Task owner ID | string |
|
| `-n`, `--user-id` | Task owner ID | string |
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
title: now() function
|
||||||
|
description: The `now()` function returns the current time (GMT).
|
||||||
|
menu:
|
||||||
|
v2_0_ref:
|
||||||
|
name: now
|
||||||
|
parent: built-in-misc
|
||||||
|
weight: 401
|
||||||
|
---
|
||||||
|
|
||||||
|
The `now()` function returns the current time (GMT).
|
||||||
|
|
||||||
|
_**Function type:** Date/Time_
|
||||||
|
_**Output data type:** Time_
|
||||||
|
|
||||||
|
```js
|
||||||
|
now()
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
```js
|
||||||
|
data
|
||||||
|
|> range(start: -10h, stop: now())
|
||||||
|
```
|
|
@ -1,25 +0,0 @@
|
||||||
---
|
|
||||||
title: systemTime() function
|
|
||||||
description: The `systemTime()` function returns the current system time.
|
|
||||||
aliases:
|
|
||||||
- /v2.0/reference/flux/functions/misc/systemtime
|
|
||||||
menu:
|
|
||||||
v2_0_ref:
|
|
||||||
name: systemTime
|
|
||||||
parent: built-in-misc
|
|
||||||
weight: 401
|
|
||||||
---
|
|
||||||
|
|
||||||
The `systemTime()` function returns the current system time.
|
|
||||||
|
|
||||||
_**Function type:** Date/Time_
|
|
||||||
_**Output data type:** Timestamp_
|
|
||||||
|
|
||||||
```js
|
|
||||||
systemTime()
|
|
||||||
```
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
```js
|
|
||||||
offsetTime = (offset) => systemTime() |> shift(shift: offset)
|
|
||||||
```
|
|
|
@ -14,16 +14,15 @@ v2.0/tags: [aggregates, built-in, functions]
|
||||||
---
|
---
|
||||||
|
|
||||||
Flux's built-in aggregate functions take values from an input table and aggregate them in some way.
|
Flux's built-in aggregate functions take values from an input table and aggregate them in some way.
|
||||||
The output table contains is a single row with the aggregated value.
|
The output table contains a single row with the aggregated value.
|
||||||
|
|
||||||
Aggregate operations output a table for every input table they receive.
|
Aggregate operations output a table for every input table they receive.
|
||||||
A list of columns to aggregate must be provided to the operation.
|
You must provide a column to aggregate.
|
||||||
The aggregate function is applied to each column in isolation.
|
|
||||||
Any output table will have the following properties:
|
Any output table will have the following properties:
|
||||||
|
|
||||||
- It always contains a single record.
|
- It always contains a single record.
|
||||||
- It will have the same group key as the input table.
|
- It will have the same group key as the input table.
|
||||||
- It will contain a column for each provided aggregate column.
|
- It will contain a column for the provided aggregate column.
|
||||||
The column label will be the same as the input table.
|
The column label will be the same as the input table.
|
||||||
The type of the column depends on the specific aggregate operation.
|
The type of the column depends on the specific aggregate operation.
|
||||||
The value of the column will be `null` if the input table is empty or the input column has only `null` values.
|
The value of the column will be `null` if the input table is empty or the input column has only `null` values.
|
||||||
|
|
|
@ -18,15 +18,15 @@ _**Function type:** Aggregate_
|
||||||
aggregateWindow(
|
aggregateWindow(
|
||||||
every: 1m,
|
every: 1m,
|
||||||
fn: mean,
|
fn: mean,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
timeColumn: "_stop",
|
timeSrc: "_stop",
|
||||||
timeDst: "_time",
|
timeDst: "_time",
|
||||||
createEmpty: true
|
createEmpty: true
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
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 aggregated, the `_time` column is dropped from each group key.
|
||||||
This helper copies the timestamp from a remaining column into the `_time` column.
|
This function copies the timestamp from a remaining column into the `_time` column.
|
||||||
View the [function definition](#function-definition).
|
View the [function definition](#function-definition).
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
@ -37,17 +37,21 @@ The duration of windows.
|
||||||
_**Data type:** Duration_
|
_**Data type:** Duration_
|
||||||
|
|
||||||
### fn
|
### fn
|
||||||
The aggregate function used in the operation.
|
The [aggregate function](/v2.0/reference/flux/functions/built-in/transformations/aggregates) used in the operation.
|
||||||
|
|
||||||
_**Data type:** Function_
|
_**Data type:** Function_
|
||||||
|
|
||||||
### columns
|
{{% note %}}
|
||||||
List of columns on which to operate.
|
Only aggregate functions with a `column` parameter (singular) work with `aggregateWindow()`.
|
||||||
Defaults to `["_value"]`.
|
{{% /note %}}
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
### column
|
||||||
|
The column on which to operate.
|
||||||
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
### timeColumn
|
_**Data type:** String_
|
||||||
|
|
||||||
|
### timeSrc
|
||||||
The time column from which time is copied for the aggregate record.
|
The time column from which time is copied for the aggregate record.
|
||||||
Defaults to `"_stop"`.
|
Defaults to `"_stop"`.
|
||||||
|
|
||||||
|
@ -92,18 +96,19 @@ from(bucket: "telegraf/autogen")
|
||||||
r._measurement == "mem" and
|
r._measurement == "mem" and
|
||||||
r._field == "used_percent")
|
r._field == "used_percent")
|
||||||
|> aggregateWindow(
|
|> aggregateWindow(
|
||||||
|
column: "_value",
|
||||||
every: 5m,
|
every: 5m,
|
||||||
fn: (columns, tables=<-) => tables |> quantile(q: 0.99, columns:columns)
|
fn: (column, tables=<-) => tables |> quantile(q: 0.99, column:column)
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Function definition
|
## Function definition
|
||||||
```js
|
```js
|
||||||
aggregateWindow = (every, fn, columns=["_value"], timeColumn="_stop", timeDst="_time", tables=<-) =>
|
aggregateWindow = (every, fn, column="_value", timeSrc="_stop", timeDst="_time", tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> window(every:every)
|
|> window(every:every)
|
||||||
|> fn(columns:columns)
|
|> fn(column:column)
|
||||||
|> duplicate(column:timeColumn, as:timeDst)
|
|> duplicate(column:timeSrc, as:timeDst)
|
||||||
|> window(every:inf, timeColumn:timeDst)
|
|> window(every:inf, timeColumn:timeDst)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: count() function
|
title: count() function
|
||||||
description: The `count()` function outputs the number of non-null records in each aggregated column.
|
description: The `count()` function outputs the number of non-null records in a column.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/aggregates/count
|
- /v2.0/reference/flux/functions/transformations/aggregates/count
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,23 +10,23 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `count()` function outputs the number of records in each aggregated column.
|
The `count()` function outputs the number of records in a column.
|
||||||
It counts both null and non-null records.
|
It counts both null and non-null records.
|
||||||
|
|
||||||
_**Function type:** Aggregate_
|
_**Function type:** Aggregate_
|
||||||
_**Output data type:** Integer_
|
_**Output data type:** Integer_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
count(columns: ["_value"])
|
count(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
A list of columns on which to operate
|
The column on which to operate.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type: Array of strings**_
|
_**Data type: String**_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
@ -38,7 +38,7 @@ from(bucket: "telegraf/autogen")
|
||||||
```js
|
```js
|
||||||
from(bucket: "telegraf/autogen")
|
from(bucket: "telegraf/autogen")
|
||||||
|> range(start: -5m)
|
|> range(start: -5m)
|
||||||
|> count(columns: ["_value"])
|
|> count(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
<hr style="margin-top:4rem"/>
|
<hr style="margin-top:4rem"/>
|
||||||
|
|
|
@ -22,14 +22,10 @@ covariance(columns: ["column_x", "column_y"], pearsonr: false, valueDst: "_value
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### columns
|
||||||
A list of columns on which to operate.
|
A list of **two columns** on which to operate. <span class="required">Required</span>
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** Array of strings_
|
||||||
|
|
||||||
{{% note %}}
|
|
||||||
Exactly two columns must be provided to the `columns` property.
|
|
||||||
{{% /note %}}
|
|
||||||
|
|
||||||
### pearsonr
|
### pearsonr
|
||||||
Indicates whether the result should be normalized to be the Pearson R coefficient.
|
Indicates whether the result should be normalized to be the Pearson R coefficient.
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ weight: 501
|
||||||
|
|
||||||
The `derivative()` function computes the rate of change per [`unit`](#unit) of time between subsequent non-null records.
|
The `derivative()` function computes the rate of change per [`unit`](#unit) of time between subsequent non-null records.
|
||||||
It assumes rows are ordered by the `_time` column.
|
It assumes rows are ordered by the `_time` column.
|
||||||
The output table schema will be the same as the input table.
|
The output table schema is the same as the input table.
|
||||||
|
|
||||||
_**Function type:** Aggregate_
|
_**Function type:** Aggregate_
|
||||||
_**Output data type:** Float_
|
_**Output data type:** Float_
|
||||||
|
@ -21,7 +21,7 @@ _**Output data type:** Float_
|
||||||
derivative(
|
derivative(
|
||||||
unit: 1s,
|
unit: 1s,
|
||||||
nonNegative: false,
|
nonNegative: false,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
timeSrc: "_time"
|
timeSrc: "_time"
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
@ -40,11 +40,11 @@ When set to `true`, if a value is less than the previous value, it is assumed th
|
||||||
|
|
||||||
_**Data type:** Boolean_
|
_**Data type:** Boolean_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
A list of columns on which to compute the derivative.
|
The column to use to compute the derivative.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### timeSrc
|
### timeSrc
|
||||||
The column containing time values.
|
The column containing time values.
|
||||||
|
|
|
@ -11,13 +11,13 @@ weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `difference()` function computes the difference between subsequent records.
|
The `difference()` function computes the difference between subsequent records.
|
||||||
Every user-specified column of numeric type is subtracted while others are kept intact.
|
The user-specified column of numeric type is subtracted while others are kept intact.
|
||||||
|
|
||||||
_**Function type:** Aggregate_
|
_**Function type:** Aggregate_
|
||||||
_**Output data type:** Float_
|
_**Output data type:** Float_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
difference(nonNegative: false, columns: ["_value"])
|
difference(nonNegative: false, column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
@ -28,11 +28,11 @@ When set to `true`, if a value is less than the previous value, it is assumed th
|
||||||
|
|
||||||
_**Data type:** Boolean_
|
_**Data type:** Boolean_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
A list of columns on which to compute the difference.
|
The column to use to compute the difference.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
## Subtraction rules for numeric types
|
## Subtraction rules for numeric types
|
||||||
- The difference between two non-null values is their algebraic difference;
|
- The difference between two non-null values is their algebraic difference;
|
||||||
|
@ -58,37 +58,37 @@ from(bucket: "telegraf/autogen")
|
||||||
### Example data transformation
|
### Example data transformation
|
||||||
|
|
||||||
###### Input table
|
###### Input table
|
||||||
| _time | A | B | C | tag |
|
| _time | _value | tag |
|
||||||
|:-----:|:----:|:----:|:----:|:---:|
|
|:-----:|:------:|:---:|
|
||||||
| 0001 | null | 1 | 2 | tv |
|
| 0001 | null | tv |
|
||||||
| 0002 | 6 | 2 | null | tv |
|
| 0002 | 6 | tv |
|
||||||
| 0003 | 4 | 2 | 4 | tv |
|
| 0003 | 4 | tv |
|
||||||
| 0004 | 10 | 10 | 2 | tv |
|
| 0004 | 10 | tv |
|
||||||
| 0005 | null | null | 1 | tv |
|
| 0005 | null | tv |
|
||||||
|
|
||||||
#### With nonNegative set to false
|
#### With nonNegative set to false
|
||||||
```js
|
```js
|
||||||
|> difference(nonNegative: false)
|
|> difference(nonNegative: false)
|
||||||
```
|
```
|
||||||
###### Output table
|
###### Output table
|
||||||
| _time | A | B | C | tag |
|
| _time | _value | tag |
|
||||||
|:-----:|:----:|:----:|:----:|:---:|
|
|:-----:|:------:|:---:|
|
||||||
| 0002 | null | 1 | null | tv |
|
| 0002 | null | tv |
|
||||||
| 0003 | -2 | 0 | 2 | tv |
|
| 0003 | -2 | tv |
|
||||||
| 0004 | 6 | 8 | -2 | tv |
|
| 0004 | 6 | tv |
|
||||||
| 0005 | null | null | -1 | tv |
|
| 0005 | null | tv |
|
||||||
|
|
||||||
#### With nonNegative set to true
|
#### With nonNegative set to true
|
||||||
```js
|
```js
|
||||||
|> difference(nonNegative: true):
|
|> difference(nonNegative: true):
|
||||||
```
|
```
|
||||||
###### Output table
|
###### Output table
|
||||||
| _time | A | B | C | tag |
|
| _time | _value | tag |
|
||||||
|:-----:|:----:|:----:|:----:|:---:|
|
|:-----:|:------:|:---:|
|
||||||
| 0002 | null | 1 | null | tv |
|
| 0002 | null | tv |
|
||||||
| 0003 | null | 0 | 2 | tv |
|
| 0003 | null | tv |
|
||||||
| 0004 | 6 | 8 | null | tv |
|
| 0004 | 6 | tv |
|
||||||
| 0005 | null | null | null | tv |
|
| 0005 | null | tv |
|
||||||
|
|
||||||
<hr style="margin-top:4rem"/>
|
<hr style="margin-top:4rem"/>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
---
|
---
|
||||||
title: histogramQuantile() function
|
title: histogramQuantile() function
|
||||||
description: The `histogramQuantile()` function approximates a quantile given a histogram that approximates the cumulative distribution of the dataset.
|
description: >
|
||||||
|
The `histogramQuantile()` function approximates a quantile given a histogram
|
||||||
|
that approximates the cumulative distribution of the dataset.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/aggregates/histogramquantile
|
- /v2.0/reference/flux/functions/transformations/aggregates/histogramquantile
|
||||||
menu:
|
menu:
|
||||||
|
|
|
@ -20,16 +20,16 @@ _**Function type:** Aggregate_
|
||||||
_**Output data type:** Float_
|
_**Output data type:** Float_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
increase(columns: ["_values"])
|
increase(column: "_values")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
The list of columns for which the increase is calculated.
|
The column for which the increase is calculated.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** Strings_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
@ -61,8 +61,8 @@ Given the following input table:
|
||||||
|
|
||||||
## Function definition
|
## Function definition
|
||||||
```js
|
```js
|
||||||
increase = (tables=<-, columns=["_value"]) =>
|
increase = (tables=<-, column="_value") =>
|
||||||
tables
|
tables
|
||||||
|> difference(nonNegative: true, columns:columns)
|
|> difference(nonNegative: true, column:column)
|
||||||
|> cumulativeSum()
|
|> cumulativeSum()
|
||||||
```
|
```
|
||||||
|
|
|
@ -17,7 +17,7 @@ _**Function type:** Aggregate_
|
||||||
_**Output data type:** Float_
|
_**Output data type:** Float_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
integral(unit: 10s, columns: ["_value"])
|
integral(unit: 10s, column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
@ -27,11 +27,11 @@ The time duration used when computing the integral.
|
||||||
|
|
||||||
_**Data type:** Duration_
|
_**Data type:** Duration_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
A list of columns on which to operate.
|
The column on which to operate.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
|
|
@ -16,16 +16,16 @@ _**Function type:** Aggregate_
|
||||||
_**Output data type:** Float_
|
_**Output data type:** Float_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
mean(columns: ["_value"])
|
mean(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
A list of columns on which to compute the mean.
|
The column to use to compute the mean.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
|
|
@ -20,7 +20,7 @@ _**Output data type:** Float or Object_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
quantile(
|
quantile(
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
q: 0.99,
|
q: 0.99,
|
||||||
method: "estimate_tdigest",
|
method: "estimate_tdigest",
|
||||||
compression: 1000.0
|
compression: 1000.0
|
||||||
|
@ -35,11 +35,11 @@ value that represents the specified quantile.
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
A list of columns on which to compute the quantile.
|
The column to use to compute the quantile.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### q
|
### q
|
||||||
A value between 0 and 1 indicating the desired quantile.
|
A value between 0 and 1 indicating the desired quantile.
|
||||||
|
@ -72,7 +72,7 @@ _**Data type:** Float_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
###### Percentile as an aggregate
|
###### Quantile as an aggregate
|
||||||
```js
|
```js
|
||||||
from(bucket: "telegraf/autogen")
|
from(bucket: "telegraf/autogen")
|
||||||
|> range(start: -5m)
|
|> range(start: -5m)
|
||||||
|
@ -86,7 +86,7 @@ from(bucket: "telegraf/autogen")
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Percentile as a selector
|
###### Quantile as a selector
|
||||||
```js
|
```js
|
||||||
from(bucket: "telegraf/autogen")
|
from(bucket: "telegraf/autogen")
|
||||||
|> range(start: -5m)
|
|> range(start: -5m)
|
||||||
|
|
|
@ -25,8 +25,8 @@ reduce(
|
||||||
```
|
```
|
||||||
|
|
||||||
If the reducer record contains a column with the same name as a group key column,
|
If the reducer record contains a column with the same name as a group key column,
|
||||||
the group key column's value is overwritten and the resulting record is regrouped
|
the group key column's value is overwritten, and the outgoing group key is changed.
|
||||||
into the appropriate table.
|
However, if two reduced tables write to the same destination group key, the function will error.
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
|
|
|
@ -16,15 +16,16 @@ _**Function type:** Aggregate_
|
||||||
_**Output data type:** Float_
|
_**Output data type:** Float_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
skew(columns: ["_value"])
|
skew(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
Specifies a list of columns on which to operate. Defaults to `["_value"]`.
|
The column on which to operate.
|
||||||
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: spread() function
|
title: spread() function
|
||||||
description: The `spread()` function outputs the difference between the minimum and maximum values in each specified column.
|
description: The `spread()` function outputs the difference between the minimum and maximum values in a specified column.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/aggregates/spread
|
- /v2.0/reference/flux/functions/transformations/aggregates/spread
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,26 +10,26 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `spread()` function outputs the difference between the minimum and maximum values in each specified column.
|
The `spread()` function outputs the difference between the minimum and maximum values in a specified column.
|
||||||
Only `uint`, `int`, and `float` column types can be used.
|
Only `uint`, `int`, and `float` column types can be used.
|
||||||
The type of the output column depends on the type of input column:
|
The type of the output column depends on the type of input column:
|
||||||
|
|
||||||
- For input columns with type `uint` or `int`, the output is an `int`
|
- For columns with type `uint` or `int`, the output is an `int`
|
||||||
- For input columns with type `float` the output is a float.
|
- For columns with type `float`, the output is a float.
|
||||||
|
|
||||||
_**Function type:** Aggregate_
|
_**Function type:** Aggregate_
|
||||||
_**Output data type:** Integer or Float (inherited from input column type)_
|
_**Output data type:** Integer or Float (inherited from input column type)_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
spread(columns: ["_value"])
|
spread(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
Specifies a list of columns on which to operate. Defaults to `["_value"]`.
|
The column on which to operate. Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: stddev() function
|
title: stddev() function
|
||||||
description: The `stddev()` function computes the standard deviation of non-null records in specified columns.
|
description: The `stddev()` function computes the standard deviation of non-null records in a specified column.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/aggregates/stddev
|
- /v2.0/reference/flux/functions/transformations/aggregates/stddev
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,22 +10,39 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `stddev()` function computes the standard deviation of non-null records in specified columns.
|
The `stddev()` function computes the standard deviation of non-null records in a specified column.
|
||||||
|
|
||||||
_**Function type:** Aggregate_
|
_**Function type:** Aggregate_
|
||||||
_**Output data type:** Float_
|
_**Output data type:** Float_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
stddev(columns: ["_value"])
|
stddev(
|
||||||
|
column: "_value",
|
||||||
|
mode: "sample"
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
Specifies a list of columns on which to operate.
|
The column on which to operate.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
|
### mode
|
||||||
|
The standard deviation mode or type of standard deviation to calculate.
|
||||||
|
Defaults to `"sample"`.
|
||||||
|
|
||||||
|
_**Data type:** String_
|
||||||
|
|
||||||
|
The available options are:
|
||||||
|
|
||||||
|
##### sample
|
||||||
|
Calculates the sample standard deviation where the data is considered to be part of a larger population.
|
||||||
|
|
||||||
|
##### population
|
||||||
|
Calculates the population standard deviation where the data is considered a population of its own.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: sum() function
|
title: sum() function
|
||||||
description: The `sum()` function computes the sum of non-null records in specified columns.
|
description: The `sum()` function computes the sum of non-null records in a specified column.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/aggregates/sum
|
- /v2.0/reference/flux/functions/transformations/aggregates/sum
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,22 +10,22 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `sum()` function computes the sum of non-null records in specified columns.
|
The `sum()` function computes the sum of non-null records in a specified column.
|
||||||
|
|
||||||
_**Function type:** Aggregate_
|
_**Function type:** Aggregate_
|
||||||
_**Output data type:** Integer, UInteger, or Float (inherited from column type)_
|
_**Output data type:** Integer, UInteger, or Float (inherited from column type)_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
sum(columns: ["_value"])
|
sum(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
Specifies a list of columns on which to operate.
|
The column on which to operate.
|
||||||
Defaults to `["_value"]`.
|
Defaults to `"_value"`.
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
|
|
|
@ -33,6 +33,10 @@ The name assigned to the duplicate column.
|
||||||
|
|
||||||
_**Data type:** String_
|
_**Data type:** String_
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
|
If the `as` column already exists, this function will overwrite the existing values.
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
from(bucket: "telegraf/autogen")
|
from(bucket: "telegraf/autogen")
|
||||||
|
|
|
@ -12,6 +12,7 @@ weight: 401
|
||||||
|
|
||||||
The `group()` function groups records based on their values for specific columns.
|
The `group()` function groups records based on their values for specific columns.
|
||||||
It produces tables with new group keys based on provided properties.
|
It produces tables with new group keys based on provided properties.
|
||||||
|
Specify an empty array of columns to ungroup data or merge all input tables into a single output table.
|
||||||
|
|
||||||
_**Function type:** Transformation_
|
_**Function type:** Transformation_
|
||||||
|
|
||||||
|
@ -69,8 +70,9 @@ from(bucket: "telegraf/autogen")
|
||||||
|> group(columns: ["_time"], mode: "except")
|
|> group(columns: ["_time"], mode: "except")
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Remove all grouping
|
###### Ungroup data
|
||||||
```js
|
```js
|
||||||
|
// Merge all tables into a single table
|
||||||
from(bucket: "telegraf/autogen")
|
from(bucket: "telegraf/autogen")
|
||||||
|> range(start: -30m)
|
|> range(start: -30m)
|
||||||
|> group()
|
|> group()
|
||||||
|
|
|
@ -46,7 +46,7 @@ The resulting group keys for all tables will be: `[_time, _field_d1, _field_d2]`
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### tables
|
### tables
|
||||||
The map of streams to be joined. <span style="color:#FF8564; font-weight:700;">Required</span>.
|
The map of streams to be joined. <span class="required">Required</span>
|
||||||
|
|
||||||
_**Data type:** Object_
|
_**Data type:** Object_
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ _**Data type:** Object_
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### on
|
### on
|
||||||
The list of columns on which to join. <span style="color:#FF8564; font-weight:700;">Required</span>.
|
The list of columns on which to join. <span class="required">Required</span>
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** Array of strings_
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ _**Function type:** Transformation_
|
||||||
_**Output data type:* Object_
|
_**Output data type:* Object_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
range(start: -15m, stop: now)
|
range(start: -15m, stop: now())
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
@ -45,7 +45,7 @@ _**Data type:** Duration or Timestamp_
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format)
|
Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format)
|
||||||
and ignores dates and times provided in other formats.
|
and ignores dates and times provided in other formats.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: highestAverage() function
|
title: highestAverage() function
|
||||||
description: The `highestAverage()` function returns the top `n` records from all groups using the average of each group.
|
description: The `highestAverage()` function calculates the average of each table in the input stream returns the top `n` records.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/selectors/highestaverage
|
- /v2.0/reference/flux/functions/transformations/selectors/highestaverage
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,14 +10,15 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `highestAverage()` function returns the top `n` records from all groups using the average of each group.
|
The `highestAverage()` function calculates the average of each table in the input stream returns the top `n` records.
|
||||||
|
It outputs a single aggregated table containing `n` records.
|
||||||
|
|
||||||
_**Function type:** Selector, Aggregate_
|
_**Function type:** Selector, Aggregate_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
highestAverage(
|
highestAverage(
|
||||||
n:10,
|
n:10,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
groupColumns: []
|
groupColumns: []
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
@ -29,12 +30,11 @@ Number of records to return.
|
||||||
|
|
||||||
_**Data type:** Integer_
|
_**Data type:** Integer_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
List of columns by which to sort.
|
Column by which to sort.
|
||||||
Sort precedence is determined by list order (left to right).
|
Default is `"_value"`.
|
||||||
Default is `["_value"]`.
|
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### groupColumns
|
### groupColumns
|
||||||
The columns on which to group before performing the aggregation.
|
The columns on which to group before performing the aggregation.
|
||||||
|
@ -63,22 +63,22 @@ _sortLimit = (n, desc, columns=["_value"], tables=<-) =>
|
||||||
|
|
||||||
// _highestOrLowest is a helper function which reduces all groups into a single
|
// _highestOrLowest is a helper function which reduces all groups into a single
|
||||||
// group by specific tags and a reducer function. It then selects the highest or
|
// group by specific tags and a reducer function. It then selects the highest or
|
||||||
// lowest records based on the columns and the _sortLimit function.
|
// lowest records based on the column and the _sortLimit function.
|
||||||
// The default reducer assumes no reducing needs to be performed.
|
// The default reducer assumes no reducing needs to be performed.
|
||||||
_highestOrLowest = (n, _sortLimit, reducer, columns=["_value"], groupColumns=[], tables=<-) =>
|
_highestOrLowest = (n, _sortLimit, reducer, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> group(columns:groupColumns)
|
|> group(columns:groupColumns)
|
||||||
|> reducer()
|
|> reducer()
|
||||||
|> group(columns:[])
|
|> group(columns:[])
|
||||||
|> _sortLimit(n:n, columns:columns)
|
|> _sortLimit(n:n, columns:[column])
|
||||||
|
|
||||||
highestAverage = (n, columns=["_value"], groupColumns=[], tables=<-) =>
|
highestAverage = (n, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> _highestOrLowest(
|
|> _highestOrLowest(
|
||||||
n:n,
|
n:n,
|
||||||
columns:columns,
|
columns:columns,
|
||||||
groupColumns:groupColumns,
|
groupColumns:groupColumns,
|
||||||
reducer: (tables=<-) => tables |> mean(columns:[columns[0]]),
|
reducer: (tables=<-) => tables |> mean(column:column),
|
||||||
_sortLimit: top,
|
_sortLimit: top,
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: highestCurrent() function
|
title: highestCurrent() function
|
||||||
description: The `highestCurrent()` function returns the top `n` records from all groups using the last value of each group.
|
description: The `highestCurrent()` function selects the last record of each table in the input stream and returns the top `n` records.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/selectors/highestcurrent
|
- /v2.0/reference/flux/functions/transformations/selectors/highestcurrent
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,14 +10,15 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `highestCurrent()` function returns the top `n` records from all groups using the last value of each group.
|
The `highestCurrent()` function selects the last record of each table in the input stream and returns the top `n` records.
|
||||||
|
It outputs a single aggregated table containing `n` records.
|
||||||
|
|
||||||
_**Function type:** Selector, Aggregate_
|
_**Function type:** Selector, Aggregate_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
highestCurrent(
|
highestCurrent(
|
||||||
n:10,
|
n:10,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
groupColumns: []
|
groupColumns: []
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
@ -29,12 +30,11 @@ Number of records to return.
|
||||||
|
|
||||||
_**Data type:** Integer_
|
_**Data type:** Integer_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
List of columns by which to sort.
|
Column by which to sort.
|
||||||
Sort precedence is determined by list order (left to right).
|
Default is `"_value"`.
|
||||||
Default is `["_value"]`.
|
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### groupColumns
|
### groupColumns
|
||||||
The columns on which to group before performing the aggregation.
|
The columns on which to group before performing the aggregation.
|
||||||
|
@ -63,22 +63,22 @@ _sortLimit = (n, desc, columns=["_value"], tables=<-) =>
|
||||||
|
|
||||||
// _highestOrLowest is a helper function which reduces all groups into a single
|
// _highestOrLowest is a helper function which reduces all groups into a single
|
||||||
// group by specific tags and a reducer function. It then selects the highest or
|
// group by specific tags and a reducer function. It then selects the highest or
|
||||||
// lowest records based on the columns and the _sortLimit function.
|
// lowest records based on the column and the _sortLimit function.
|
||||||
// The default reducer assumes no reducing needs to be performed.
|
// The default reducer assumes no reducing needs to be performed.
|
||||||
_highestOrLowest = (n, _sortLimit, reducer, columns=["_value"], groupColumns=[], tables=<-) =>
|
_highestOrLowest = (n, _sortLimit, reducer, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> group(columns:groupColumns)
|
|> group(columns:groupColumns)
|
||||||
|> reducer()
|
|> reducer()
|
||||||
|> group(columns:[])
|
|> group(columns:[])
|
||||||
|> _sortLimit(n:n, columns:columns)
|
|> _sortLimit(n:n, columns:[column])
|
||||||
|
|
||||||
highestCurrent = (n, columns=["_value"], groupColumns=[], tables=<-) =>
|
highestCurrent = (n, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> _highestOrLowest(
|
|> _highestOrLowest(
|
||||||
n:n,
|
n:n,
|
||||||
columns:columns,
|
column:column,
|
||||||
groupColumns:groupColumns,
|
groupColumns:groupColumns,
|
||||||
reducer: (tables=<-) => tables |> last(column:columns[0]),
|
reducer: (tables=<-) => tables |> last(column:column),
|
||||||
_sortLimit: top,
|
_sortLimit: top,
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: highestMax() function
|
title: highestMax() function
|
||||||
description: The `highestMax()` function returns the top `n` records from all groups using the maximum of each group.
|
description: The `highestMax()` function selects the maximum record from each table in the input stream and returns the top `n` records.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/selectors/highestmax
|
- /v2.0/reference/flux/functions/transformations/selectors/highestmax
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,14 +10,15 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `highestMax()` function returns the top `n` records from all groups using the maximum of each group.
|
The `highestMax()` function selects the maximum record from each table in the input stream and returns the top `n` records.
|
||||||
|
It outputs a single aggregated table containing `n` records.
|
||||||
|
|
||||||
_**Function type:** Selector, Aggregate_
|
_**Function type:** Selector, Aggregate_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
highestMax(
|
highestMax(
|
||||||
n:10,
|
n:10,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
groupColumns: []
|
groupColumns: []
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
@ -29,12 +30,11 @@ Number of records to return.
|
||||||
|
|
||||||
_**Data type:** Integer_
|
_**Data type:** Integer_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
List of columns by which to sort.
|
Column by which to sort.
|
||||||
Sort precedence is determined by list order (left to right).
|
Default is `"_value"`.
|
||||||
Default is `["_value"]`.
|
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### groupColumns
|
### groupColumns
|
||||||
The columns on which to group before performing the aggregation.
|
The columns on which to group before performing the aggregation.
|
||||||
|
@ -63,22 +63,22 @@ _sortLimit = (n, desc, columns=["_value"], tables=<-) =>
|
||||||
|
|
||||||
// _highestOrLowest is a helper function which reduces all groups into a single
|
// _highestOrLowest is a helper function which reduces all groups into a single
|
||||||
// group by specific tags and a reducer function. It then selects the highest or
|
// group by specific tags and a reducer function. It then selects the highest or
|
||||||
// lowest records based on the columns and the _sortLimit function.
|
// lowest records based on the column and the _sortLimit function.
|
||||||
// The default reducer assumes no reducing needs to be performed.
|
// The default reducer assumes no reducing needs to be performed.
|
||||||
_highestOrLowest = (n, _sortLimit, reducer, columns=["_value"], groupColumns=[], tables=<-) =>
|
_highestOrLowest = (n, _sortLimit, reducer, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> group(columns:groupColumns)
|
|> group(columns:groupColumns)
|
||||||
|> reducer()
|
|> reducer()
|
||||||
|> group(columns:[])
|
|> group(columns:[])
|
||||||
|> _sortLimit(n:n, columns:columns)
|
|> _sortLimit(n:n, columns:[column])
|
||||||
|
|
||||||
highestMax = (n, columns=["_value"], groupColumns=[], tables=<-) =>
|
highestMax = (n, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> _highestOrLowest(
|
|> _highestOrLowest(
|
||||||
n:n,
|
n:n,
|
||||||
columns:columns,
|
column:column,
|
||||||
groupColumns:groupColumns,
|
groupColumns:groupColumns,
|
||||||
reducer: (tables=<-) => tables |> max(column:columns[0]),
|
reducer: (tables=<-) => tables |> max(column:column),
|
||||||
_sortLimit: top
|
_sortLimit: top
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: lowestAverage() function
|
title: lowestAverage() function
|
||||||
description: The `lowestAverage()` function returns the bottom `n` records from all groups using the average of each group.
|
description: The `lowestAverage()` function calculates the average of each table in the input stream returns the lowest `n` records.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/selectors/lowestaverage
|
- /v2.0/reference/flux/functions/transformations/selectors/lowestaverage
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,14 +10,15 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `lowestAverage()` function returns the bottom `n` records from all groups using the average of each group.
|
The `lowestAverage()` function calculates the average of each table in the input stream returns the lowest `n` records.
|
||||||
|
It outputs a single aggregated table containing `n` records.
|
||||||
|
|
||||||
_**Function type:** Selector, Aggregate_
|
_**Function type:** Selector, Aggregate_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
lowestAverage(
|
lowestAverage(
|
||||||
n:10,
|
n:10,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
groupColumns: []
|
groupColumns: []
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
@ -29,12 +30,11 @@ Number of records to return.
|
||||||
|
|
||||||
_**Data type:** Integer_
|
_**Data type:** Integer_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
List of columns by which to sort.
|
Column by which to sort.
|
||||||
Sort precedence is determined by list order (left to right).
|
Default is `"_value"`.
|
||||||
Default is `["_value"]`.
|
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### groupColumns
|
### groupColumns
|
||||||
The columns on which to group before performing the aggregation.
|
The columns on which to group before performing the aggregation.
|
||||||
|
@ -63,22 +63,22 @@ _sortLimit = (n, desc, columns=["_value"], tables=<-) =>
|
||||||
|
|
||||||
// _highestOrLowest is a helper function which reduces all groups into a single
|
// _highestOrLowest is a helper function which reduces all groups into a single
|
||||||
// group by specific tags and a reducer function. It then selects the highest or
|
// group by specific tags and a reducer function. It then selects the highest or
|
||||||
// lowest records based on the columns and the _sortLimit function.
|
// lowest records based on the column and the _sortLimit function.
|
||||||
// The default reducer assumes no reducing needs to be performed.
|
// The default reducer assumes no reducing needs to be performed.
|
||||||
_highestOrLowest = (n, _sortLimit, reducer, columns=["_value"], groupColumns=[], tables=<-) =>
|
_highestOrLowest = (n, _sortLimit, reducer, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> group(columns:groupColumns)
|
|> group(columns:groupColumns)
|
||||||
|> reducer()
|
|> reducer()
|
||||||
|> group(columns:[])
|
|> group(columns:[])
|
||||||
|> _sortLimit(n:n, columns:columns)
|
|> _sortLimit(n:n, columns:[column])
|
||||||
|
|
||||||
lowestAverage = (n, columns=["_value"], groupColumns=[], tables=<-) =>
|
lowestAverage = (n, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> _highestOrLowest(
|
|> _highestOrLowest(
|
||||||
n:n,
|
n:n,
|
||||||
columns:columns,
|
column:column,
|
||||||
groupColumns:groupColumns,
|
groupColumns:groupColumns,
|
||||||
reducer: (tables=<-) => tables |> mean(columns:[columns[0]]),
|
reducer: (tables=<-) => tables |> mean(column:column]),
|
||||||
_sortLimit: bottom,
|
_sortLimit: bottom,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: lowestCurrent() function
|
title: lowestCurrent() function
|
||||||
description: The `lowestCurrent()` function returns the bottom `n` records from all groups using the last value of each group.
|
description: The `lowestCurrent()` function selects the last record of each table in the input stream and returns the lowest `n` records.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/selectors/lowestcurrent
|
- /v2.0/reference/flux/functions/transformations/selectors/lowestcurrent
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,14 +10,15 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `lowestCurrent()` function returns the bottom `n` records from all groups using the last value of each group.
|
The `lowestCurrent()` function selects the last record of each table in the input stream and returns the lowest `n` records.
|
||||||
|
It outputs a single aggregated table containing `n` records.
|
||||||
|
|
||||||
_**Function type:** Selector, Aggregate_
|
_**Function type:** Selector, Aggregate_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
lowestCurrent(
|
lowestCurrent(
|
||||||
n:10,
|
n:10,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
groupColumns: []
|
groupColumns: []
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
@ -29,12 +30,11 @@ Number of records to return.
|
||||||
|
|
||||||
_**Data type:** Integer_
|
_**Data type:** Integer_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
List of columns by which to sort.
|
Column by which to sort.
|
||||||
Sort precedence is determined by list order (left to right).
|
Default is `"_value"`.
|
||||||
Default is `["_value"]`.
|
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### groupColumns
|
### groupColumns
|
||||||
The columns on which to group before performing the aggregation.
|
The columns on which to group before performing the aggregation.
|
||||||
|
@ -63,22 +63,22 @@ _sortLimit = (n, desc, columns=["_value"], tables=<-) =>
|
||||||
|
|
||||||
// _highestOrLowest is a helper function which reduces all groups into a single
|
// _highestOrLowest is a helper function which reduces all groups into a single
|
||||||
// group by specific tags and a reducer function. It then selects the highest or
|
// group by specific tags and a reducer function. It then selects the highest or
|
||||||
// lowest records based on the columns and the _sortLimit function.
|
// lowest records based on the column and the _sortLimit function.
|
||||||
// The default reducer assumes no reducing needs to be performed.
|
// The default reducer assumes no reducing needs to be performed.
|
||||||
_highestOrLowest = (n, _sortLimit, reducer, columns=["_value"], groupColumns=[], tables=<-) =>
|
_highestOrLowest = (n, _sortLimit, reducer, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> group(columns:groupColumns)
|
|> group(columns:groupColumns)
|
||||||
|> reducer()
|
|> reducer()
|
||||||
|> group(columns:[])
|
|> group(columns:[])
|
||||||
|> _sortLimit(n:n, columns:columns)
|
|> _sortLimit(n:n, columns:[column])
|
||||||
|
|
||||||
lowestCurrent = (n, columns=["_value"], groupColumns=[], tables=<-) =>
|
lowestCurrent = (n, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> _highestOrLowest(
|
|> _highestOrLowest(
|
||||||
n:n,
|
n:n,
|
||||||
columns:columns,
|
column:column,
|
||||||
groupColumns:groupColumns,
|
groupColumns:groupColumns,
|
||||||
reducer: (tables=<-) => tables |> last(column:columns[0]),
|
reducer: (tables=<-) => tables |> last(column:column),
|
||||||
_sortLimit: bottom,
|
_sortLimit: bottom,
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: lowestMin() function
|
title: lowestMin() function
|
||||||
description: The `lowestMin()` function returns the bottom `n` records from all groups using the minimum of each group.
|
description: The `lowestMin()` function selects the minimum record from each table in the input stream and returns the lowest `n` records.
|
||||||
aliases:
|
aliases:
|
||||||
- /v2.0/reference/flux/functions/transformations/selectors/lowestmin
|
- /v2.0/reference/flux/functions/transformations/selectors/lowestmin
|
||||||
menu:
|
menu:
|
||||||
|
@ -10,14 +10,15 @@ menu:
|
||||||
weight: 501
|
weight: 501
|
||||||
---
|
---
|
||||||
|
|
||||||
The `lowestMin()` function returns the bottom `n` records from all groups using the minimum of each group.
|
The `lowestMin()` function selects the minimum record from each table in the input stream and returns the lowest `n` records.
|
||||||
|
It outputs a single aggregated table containing `n` records.
|
||||||
|
|
||||||
_**Function type:** Selector, Aggregate_
|
_**Function type:** Selector, Aggregate_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
lowestMin(
|
lowestMin(
|
||||||
n:10,
|
n:10,
|
||||||
columns: ["_value"],
|
column: "_value",
|
||||||
groupColumns: []
|
groupColumns: []
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
@ -29,12 +30,11 @@ Number of records to return.
|
||||||
|
|
||||||
_**Data type:** Integer_
|
_**Data type:** Integer_
|
||||||
|
|
||||||
### columns
|
### column
|
||||||
List of columns by which to sort.
|
Column by which to sort.
|
||||||
Sort precedence is determined by list order (left to right).
|
Default is `"_value"`.
|
||||||
Default is `["_value"]`.
|
|
||||||
|
|
||||||
_**Data type:** Array of strings_
|
_**Data type:** String_
|
||||||
|
|
||||||
### groupColumns
|
### groupColumns
|
||||||
The columns on which to group before performing the aggregation.
|
The columns on which to group before performing the aggregation.
|
||||||
|
@ -63,23 +63,22 @@ _sortLimit = (n, desc, columns=["_value"], tables=<-) =>
|
||||||
|
|
||||||
// _highestOrLowest is a helper function which reduces all groups into a single
|
// _highestOrLowest is a helper function which reduces all groups into a single
|
||||||
// group by specific tags and a reducer function. It then selects the highest or
|
// group by specific tags and a reducer function. It then selects the highest or
|
||||||
// lowest records based on the columns and the _sortLimit function.
|
// lowest records based on the column and the _sortLimit function.
|
||||||
// The default reducer assumes no reducing needs to be performed.
|
// The default reducer assumes no reducing needs to be performed.
|
||||||
_highestOrLowest = (n, _sortLimit, reducer, columns=["_value"], groupColumns=[], tables=<-) =>
|
_highestOrLowest = (n, _sortLimit, reducer, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> group(columns:groupColumns)
|
|> group(columns:groupColumns)
|
||||||
|> reducer()
|
|> reducer()
|
||||||
|> group(columns:[])
|
|> group(columns:[])
|
||||||
|> _sortLimit(n:n, columns:columns)
|
|> _sortLimit(n:n, columns:[column])
|
||||||
|
|
||||||
lowestMin = (n, columns=["_value"], groupColumns=[], tables=<-) =>
|
lowestMin = (n, column="_value", groupColumns=[], tables=<-) =>
|
||||||
tables
|
tables
|
||||||
|> _highestOrLowest(
|
|> _highestOrLowest(
|
||||||
n:n,
|
n:n,
|
||||||
columns:columns,
|
column:column,
|
||||||
groupColumns:groupColumns,
|
groupColumns:groupColumns,
|
||||||
// TODO(nathanielc): Once max/min support selecting based on multiple columns change this to pass all columns.
|
reducer: (tables=<-) => tables |> min(column:column),
|
||||||
reducer: (tables=<-) => tables |> min(column:columns[0]),
|
|
||||||
_sortLimit: bottom,
|
_sortLimit: bottom,
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
|
@ -16,9 +16,17 @@ _**Function type:** Selector_
|
||||||
_**Output data type:** Object_
|
_**Output data type:** Object_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
max()
|
max(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
### column
|
||||||
|
The column to use to calculate the maximum value.
|
||||||
|
Default is `"_value"`.
|
||||||
|
|
||||||
|
_**Data type:** String_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
from(bucket:"telegraf/autogen")
|
from(bucket:"telegraf/autogen")
|
||||||
|
|
|
@ -16,9 +16,17 @@ _**Function type:** Selector_
|
||||||
_**Output data type:** Object_
|
_**Output data type:** Object_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
min()
|
min(column: "_value")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
### column
|
||||||
|
The column to use to calculate the minimum value.
|
||||||
|
Default is `"_value"`.
|
||||||
|
|
||||||
|
_**Data type:** String_
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
```js
|
```js
|
||||||
from(bucket:"telegraf/autogen")
|
from(bucket:"telegraf/autogen")
|
||||||
|
|
|
@ -61,6 +61,7 @@ tagKeys = (bucket, predicate=(r) => true, start=-30d) =>
|
||||||
|> filter(fn: predicate)
|
|> filter(fn: predicate)
|
||||||
|> keys()
|
|> keys()
|
||||||
|> keep(columns: ["_value"])
|
|> keep(columns: ["_value"])
|
||||||
|
|> distinct()
|
||||||
```
|
```
|
||||||
|
|
||||||
_**Used functions:**
|
_**Used functions:**
|
||||||
|
@ -68,4 +69,5 @@ _**Used functions:**
|
||||||
[range](/v2.0/reference/flux/functions/built-in/transformations/range/),
|
[range](/v2.0/reference/flux/functions/built-in/transformations/range/),
|
||||||
[filter](/v2.0/reference/flux/functions/built-in/transformations/filter/),
|
[filter](/v2.0/reference/flux/functions/built-in/transformations/filter/),
|
||||||
[keys](/v2.0/reference/flux/functions/built-in/transformations/keys/),
|
[keys](/v2.0/reference/flux/functions/built-in/transformations/keys/),
|
||||||
[keep](/v2.0/reference/flux/functions/built-in/transformations/keep/)_
|
[keep](/v2.0/reference/flux/functions/built-in/transformations/keep/),
|
||||||
|
[distinct](/v2.0/reference/flux/functions/built-in/transformations/selectors/distinct/)_
|
||||||
|
|
|
@ -18,20 +18,20 @@ _**Output data format:** Object_
|
||||||
```js
|
```js
|
||||||
import "math"
|
import "math"
|
||||||
|
|
||||||
math.modf(x: 3.14)
|
math.modf(f: 3.14)
|
||||||
|
|
||||||
// Returns {int: 3, frac: 0.14000000000000012}
|
// Returns {int: 3, frac: 0.14000000000000012}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### x
|
### f
|
||||||
The value used in the operation.
|
The value used in the operation.
|
||||||
|
|
||||||
_**Data type:** Float_
|
_**Data type:** Float_
|
||||||
|
|
||||||
## Special cases
|
## Special cases
|
||||||
```js
|
```js
|
||||||
math.modf(x: ±Inf) // Returns {int: ±Inf, frac: NaN}
|
math.modf(f: ±Inf) // Returns {int: ±Inf, frac: NaN}
|
||||||
math.modf(x: NaN) // Returns {int: NaN, frac: NaN}
|
math.modf(f: NaN) // Returns {int: NaN, frac: NaN}
|
||||||
```
|
```
|
||||||
|
|
|
@ -27,7 +27,7 @@ The numerator used in the operation.
|
||||||
|
|
||||||
_**Data type:** Float_
|
_**Data type:** Float_
|
||||||
|
|
||||||
### x
|
### y
|
||||||
The denominator used in the operation.
|
The denominator used in the operation.
|
||||||
|
|
||||||
_**Data type:** Float_
|
_**Data type:** Float_
|
||||||
|
|
|
@ -23,6 +23,6 @@ math.signbit(x: -1.2)
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
### x
|
### x
|
||||||
The value used in the operation.
|
The value used in the evaluation.
|
||||||
|
|
||||||
_**Data type:** Float_
|
_**Data type:** Float_
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
---
|
||||||
|
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.
|
||||||
|
menu:
|
||||||
|
v2_0_ref:
|
||||||
|
name: strings.trimPrefix
|
||||||
|
parent: Strings
|
||||||
|
weight: 301
|
||||||
|
---
|
||||||
|
|
||||||
|
The `strings.trimPrefix()` function removes a prefix from a string.
|
||||||
|
Strings that do not start with the prefix are returned unchanged.
|
||||||
|
|
||||||
|
_**Output data type:** String_
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
strings.trimPrefix(v: "123_abc", prefix: "123")
|
||||||
|
|
||||||
|
// returns "_abc"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Paramters
|
||||||
|
|
||||||
|
### v
|
||||||
|
The string value to trim.
|
||||||
|
|
||||||
|
_**Data type:** String_
|
||||||
|
|
||||||
|
### prefix
|
||||||
|
The prefix to remove.
|
||||||
|
|
||||||
|
_**Data type:** String_
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
###### Remove a prefix from all values in a column
|
||||||
|
```js
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
data
|
||||||
|
|> map(fn:(r) => strings.trimPrefix(v: r.sensorId, prefix: "s12_"))
|
||||||
|
```
|
|
@ -0,0 +1,46 @@
|
||||||
|
---
|
||||||
|
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.
|
||||||
|
menu:
|
||||||
|
v2_0_ref:
|
||||||
|
name: strings.trimSuffix
|
||||||
|
parent: Strings
|
||||||
|
weight: 301
|
||||||
|
---
|
||||||
|
|
||||||
|
The `strings.trimSuffix()` function removes a suffix from a string.
|
||||||
|
Strings that do not end with the suffix are returned unchanged.
|
||||||
|
|
||||||
|
_**Output data type:** String_
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
strings.trimSuffix(v: "123_abc", suffix: "abc")
|
||||||
|
|
||||||
|
// returns "123_"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Paramters
|
||||||
|
|
||||||
|
### v
|
||||||
|
The string value to trim.
|
||||||
|
|
||||||
|
_**Data type:** String_
|
||||||
|
|
||||||
|
### suffix
|
||||||
|
The suffix to remove.
|
||||||
|
|
||||||
|
_**Data type:** String_
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
###### Remove a suffix from all values in a column
|
||||||
|
```js
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
data
|
||||||
|
|> map(fn:(r) => strings.trimSuffix(v: r.sensorId, suffix: "_s12"))
|
||||||
|
```
|
|
@ -0,0 +1,22 @@
|
||||||
|
---
|
||||||
|
title: Flux system package
|
||||||
|
list_title: System package
|
||||||
|
description: >
|
||||||
|
The Flux system package provides functions for reading values from the system.
|
||||||
|
Import the `system` package.
|
||||||
|
menu:
|
||||||
|
v2_0_ref:
|
||||||
|
name: System
|
||||||
|
parent: Flux packages and functions
|
||||||
|
weight: 204
|
||||||
|
v2.0/tags: [system, functions, package]
|
||||||
|
---
|
||||||
|
|
||||||
|
The Flux system package provides functions for reading values from the system.
|
||||||
|
Import the `system` package:
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "system"
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,31 @@
|
||||||
|
---
|
||||||
|
title: system.time() function
|
||||||
|
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
|
||||||
|
menu:
|
||||||
|
v2_0_ref:
|
||||||
|
name: system.time
|
||||||
|
parent: System
|
||||||
|
weight: 401
|
||||||
|
---
|
||||||
|
|
||||||
|
The `system.time()` function returns the current system time.
|
||||||
|
|
||||||
|
_**Function type:** Date/Time_
|
||||||
|
_**Output data type:** Timestamp_
|
||||||
|
|
||||||
|
```js
|
||||||
|
import "system"
|
||||||
|
|
||||||
|
system.time()
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
```js
|
||||||
|
import "system"
|
||||||
|
|
||||||
|
data
|
||||||
|
|> set(key: "processed_at", value: string(v: system.time() ))
|
||||||
|
```
|
|
@ -152,30 +152,48 @@ DotExpression = "." identifer
|
||||||
MemberBracketExpression = "[" string_lit "]" .
|
MemberBracketExpression = "[" string_lit "]" .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Operators
|
## Conditional expressions
|
||||||
|
Conditional expressions evaluate a boolean-valued condition.
|
||||||
|
If the result is _true_, the expression that follows the `then` keyword is evaluated and returned.
|
||||||
|
If the result is _false_, the expression that follows the `else` keyword is evaluated and returned.
|
||||||
|
In either case, only the branch taken is evaluated and only side effects associated this branch will occur.
|
||||||
|
|
||||||
|
```js
|
||||||
|
ConditionalExpression = "if" Expression "then" Expression "else" Expression .
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Conditional expression example
|
||||||
|
```js
|
||||||
|
color = if code == 0 then "green" else if code == 1 then "yellow" else "red"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Operators
|
||||||
Operators combine operands into expressions.
|
Operators combine operands into expressions.
|
||||||
The precedence of the operators is given in the table below.
|
The precedence of the operators is given in the table below.
|
||||||
Operators with a lower number have higher precedence.
|
Operators with a lower number have higher precedence.
|
||||||
|
|
||||||
|Precedence| Operator | Description |
|
| Precedence | Operator | Description |
|
||||||
|----------|----------|---------------------------|
|
|:----------:|:--------: |:--------------------------|
|
||||||
| 1 | `a()` | Function call |
|
| 1 | `a()` | Function call |
|
||||||
| | `a[]` | Member or index access |
|
| | `a[]` | Member or index access |
|
||||||
| | `.` | Member access |
|
| | `.` | Member access |
|
||||||
| 2 | `*` `/` |Multiplication and division|
|
| 2 | `*` `/` |Multiplication and division|
|
||||||
| 3 | `+` `-` | Addition and subtraction |
|
| 3 | `+` `-` | Addition and subtraction |
|
||||||
| 4 |`==` `!=` | Comparison operators |
|
| 4 |`==` `!=` | Comparison operators |
|
||||||
| | `<` `<=` | |
|
| | `<` `<=` | |
|
||||||
| | `>` `>=` | |
|
| | `>` `>=` | |
|
||||||
| |`=~` `!~` | |
|
| |`=~` `!~` | |
|
||||||
| 5 | `not` | Unary logical expression |
|
| 5 | `not` | Unary logical expression |
|
||||||
| 6 | `and` | Logical AND |
|
| 6 | `and` | Logical AND |
|
||||||
| 7 | `or` | Logical OR |
|
| 7 | `or` | Logical OR |
|
||||||
|
| 8 | `if` `then` `else` | Conditional |
|
||||||
|
|
||||||
The operator precedence is encoded directly into the grammar as the following.
|
The operator precedence is encoded directly into the grammar as the following.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
Expression = LogicalExpression .
|
Expression = ConditionalExpression .
|
||||||
|
ConditionalExpression = LogicalExpression
|
||||||
|
| "if" Expression "then" Expression "else" Expression .
|
||||||
LogicalExpression = UnaryLogicalExpression
|
LogicalExpression = UnaryLogicalExpression
|
||||||
| LogicalExpression LogicalOperator UnaryLogicalExpression .
|
| LogicalExpression LogicalOperator UnaryLogicalExpression .
|
||||||
LogicalOperator = "and" | "or" .
|
LogicalOperator = "and" | "or" .
|
||||||
|
|
|
@ -9,11 +9,88 @@ menu:
|
||||||
---
|
---
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.25.0**.
|
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.28.3**.
|
||||||
Though newer versions of Flux may be available, they will not be included with
|
Though newer versions of Flux may be available, they will not be included with
|
||||||
InfluxDB until the next InfluxDB v2.0 release._
|
InfluxDB until the next InfluxDB v2.0 release._
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
## v0.28.3 [2019-05-01]
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- Fix request results labels to count runtime errors.
|
||||||
|
- An error when joining could result in two calls to finish.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## v0.28.2 [2019-04-26]
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
- Preallocate data when constructing a new string array.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## v0.28.1 [2019-04-25]
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
- Make executor respect memory limit from caller.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## v0.28.0 [2019-04-24]
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- Allow choosing sample/population mode in `stddev()`.
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
- Fix `reduce()` so it resets the reduce value to the neutral element value for each new group key
|
||||||
|
and reports an error when two reducers write to the same destination group key.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## v0.27.0 [2019-04-22]
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- Add `trimSuffix` and `trimPrefix` functions to the strings package.
|
||||||
|
- Add support for conditional expressions to compiler.
|
||||||
|
- Add conditional expression handling to interpreter.
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
- Enforce memory and concurrency limits in controller.
|
||||||
|
- Format conditional expression.
|
||||||
|
- `tagKeys` should include a call to `distinct`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## v0.26.0 [2019-04-18]
|
||||||
|
|
||||||
|
### Breaking changes
|
||||||
|
- Aggregates now accept only a `column` parameter. `columns` not used.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- Add handling for conditional expressions to type inference.
|
||||||
|
- Add `if`/`then`/`else` syntax to Flux parser.
|
||||||
|
- Added a WalkIR function that external programs can use to traverse an opSpec structure.
|
||||||
|
- Add planner options to compile options.
|
||||||
|
- Add example on how to use Flux as a library.
|
||||||
|
- `duplicate()` will now overwrite a column if the as label already exists.
|
||||||
|
|
||||||
|
#### Bug fixes
|
||||||
|
- Format right child with good parentheses.
|
||||||
|
- Make staticcheck pass.
|
||||||
|
- Rename `json` tag so go vet passes.
|
||||||
|
- The controller pump could reference a nil pointer.
|
||||||
|
- Create a DependenciesAwareProgram so controller can assign dependencies.
|
||||||
|
- Make `Program.Start` start execution synchronously.
|
||||||
|
- Read the metadata channel in a separate goroutine.
|
||||||
|
- Remove dead code in controller so `staticcheck` passes.
|
||||||
|
- Allow Flux unit tests to pass.
|
||||||
|
- Require a Github token to perform a release.
|
||||||
|
- Change example name to make go vet pass.
|
||||||
|
- Make `csv.from` return decode error.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## v0.25.0 [2019-04-08]
|
## v0.25.0 [2019-04-08]
|
||||||
|
|
||||||
## Breaking changes
|
## Breaking changes
|
||||||
|
|
|
@ -7,6 +7,41 @@ menu:
|
||||||
weight: 1
|
weight: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## v2.0.0-alpha.9 [2019-05-01]
|
||||||
|
|
||||||
|
|
||||||
|
{{% warn %}}
|
||||||
|
**This will remove all tasks from your InfluxDB v2.0 instance.**
|
||||||
|
|
||||||
|
Before upgrading, [export all existing tasks](/v2.0/process-data/manage-tasks/export-task/). After upgrading, [reimport your exported tasks](/v2.0/process-data/manage-tasks/create-task/#import-a-task).
|
||||||
|
{{% /warn %}}
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- Set autorefresh of dashboard to pause if absolute time range is selected.
|
||||||
|
- Switch task back end to a more modular and flexible system.
|
||||||
|
- Add org profile tab with ability to edit organization name.
|
||||||
|
- Add org name to dashboard page title.
|
||||||
|
- Add cautioning to bucket renaming.
|
||||||
|
- Add option to generate all access token in tokens tab.
|
||||||
|
- Add option to generate read/write token in tokens tab.
|
||||||
|
- Add new Local Metrics Dashboard template that is created during Quick Start.
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
- Fixed scroll clipping found in label editing flow.
|
||||||
|
- Prevent overlapping text and dot in time range dropdown.
|
||||||
|
- Updated link in notes cell to a more useful site.
|
||||||
|
- Show error message when adding line protocol.
|
||||||
|
- Update UI Flux function documentation.
|
||||||
|
- Update System template to support math with floats.
|
||||||
|
- Fix the `window` function documentation.
|
||||||
|
- Fix typo in the `range` Flux function example.
|
||||||
|
- Update the `systemTime` function to use `system.time`.
|
||||||
|
|
||||||
|
### UI Improvements
|
||||||
|
- Add general polish and empty states to Create Dashboard from Template overlay.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## v2.0.0-alpha.8 [2019-04-12]
|
## v2.0.0-alpha.8 [2019-04-12]
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
|
@ -9,7 +9,6 @@ menu:
|
||||||
name: Create a token
|
name: Create a token
|
||||||
parent: Manage tokens
|
parent: Manage tokens
|
||||||
weight: 201
|
weight: 201
|
||||||
draft: true
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Create authentication tokens using the InfluxDB user interface (UI) or the `influx`
|
Create authentication tokens using the InfluxDB user interface (UI) or the `influx`
|
||||||
|
@ -22,7 +21,12 @@ command line interface (CLI).
|
||||||
{{< nav-icon "settings" >}}
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
2. Click **Tokens**.
|
2. Click **Tokens**.
|
||||||
3. _Full instructions coming soon._
|
3. Click the **+ Generate** dropdown in the upper right and select a token type (**Read/Write Token** or **All Access Token**).
|
||||||
|
4. In the window that appears, enter a description for your token in the **Description** field.
|
||||||
|
5. If you're generating a read/write token:
|
||||||
|
- Search for and select buckets to read from in the **Read** pane.
|
||||||
|
- Search for and select buckets to write to in the **Write** pane.
|
||||||
|
5. Click **Save**.
|
||||||
|
|
||||||
## Create a token using the influx CLI
|
## Create a token using the influx CLI
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,17 @@ weight: 201
|
||||||
---
|
---
|
||||||
|
|
||||||
Create dashboard variables in the Data Explorer, from the Organization page, or import a variable.
|
Create dashboard variables in the Data Explorer, from the Organization page, or import a variable.
|
||||||
|
**Variable names must be unique.**
|
||||||
|
|
||||||
_For information about variable types, see [Variable types](/v2.0/visualize-data/variables/variable-types/)._
|
_For information about variable types, see [Variable types](/v2.0/visualize-data/variables/variable-types/)._
|
||||||
|
|
||||||
### Create a variable in the Data Explorer
|
### Create a variable in the Data Explorer
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
|
Only [Query variables](/v2.0/visualize-data/variables/variable-types/#query)
|
||||||
|
can be created from the Data Explorer.
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
1. Click the **Data Explorer** icon in the sidebar.
|
1. Click the **Data Explorer** icon in the sidebar.
|
||||||
|
|
||||||
{{< nav-icon "data-explorer" >}}
|
{{< nav-icon "data-explorer" >}}
|
||||||
|
@ -35,8 +41,9 @@ _For information about variable types, see [Variable types](/v2.0/visualize-data
|
||||||
2. Select the **Variables** tab.
|
2. Select the **Variables** tab.
|
||||||
3. Click **+Create Variable**.
|
3. Click **+Create Variable**.
|
||||||
4. Enter a name for your variable.
|
4. Enter a name for your variable.
|
||||||
5. Enter your variable.
|
5. Select your [variable type](/v2.0/visualize-data/variables/variable-types/).
|
||||||
6. Click **Create**.
|
6. Enter the appropriate variable information.
|
||||||
|
7. Click **Create**.
|
||||||
|
|
||||||
## Import a variable
|
## Import a variable
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ menu:
|
||||||
weight: 205
|
weight: 205
|
||||||
"v2.0/tags": [variables]
|
"v2.0/tags": [variables]
|
||||||
---
|
---
|
||||||
|
|
||||||
Delete an existing variable in the InfluxDB user interface (UI).
|
Delete an existing variable in the InfluxDB user interface (UI).
|
||||||
|
|
||||||
### Delete a variable
|
### Delete a variable
|
||||||
|
@ -17,4 +18,9 @@ Delete an existing variable in the InfluxDB user interface (UI).
|
||||||
{{< nav-icon "settings" >}}
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
2. Select the **Variables** tab.
|
2. Select the **Variables** tab.
|
||||||
3. Hover over a variable and click the trash can icon.
|
3. Hover over a variable, click the **{{< icon "trash" >}}** icon, and **Delete**.
|
||||||
|
|
||||||
|
{{% warn %}}
|
||||||
|
Once deleted, any dashboards with queries that utilize the variable will no
|
||||||
|
longer function correctly.
|
||||||
|
{{% /warn %}}
|
||||||
|
|
|
@ -18,7 +18,8 @@ Variables are exported as downloadable JSON files.
|
||||||
{{< nav-icon "settings" >}}
|
{{< nav-icon "settings" >}}
|
||||||
|
|
||||||
2. Select the **Variables** tab.
|
2. Select the **Variables** tab.
|
||||||
3. Hover over a variable in the list, then click the gear icon ({{< icon "gear" >}}) and select **Export**.
|
3. Hover over a variable in the list, then click the gear icon (**{{< icon "gear" >}}**)
|
||||||
|
and select **Export**.
|
||||||
4. Review the JSON in the window that appears.
|
4. Review the JSON in the window that appears.
|
||||||
5. Select one of the following options:
|
5. Select one of the following options:
|
||||||
* **Download JSON**: Download the dashboard as a JSON file.
|
* **Download JSON**: Download the dashboard as a JSON file.
|
||||||
|
|
|
@ -19,5 +19,5 @@ Update an existing dashboard variable's name or JSON content in the InfluxDB use
|
||||||
|
|
||||||
2. Select the **Variables** tab.
|
2. Select the **Variables** tab.
|
||||||
3. Click on a variable's name from the list.
|
3. Click on a variable's name from the list.
|
||||||
4. Update the variable's name and query.
|
4. Update the variable's name, type, and associated information.
|
||||||
5. Click **Submit**.
|
5. Click **Submit**.
|
||||||
|
|
|
@ -9,26 +9,43 @@ weight: 207
|
||||||
"v2.0/tags": [variables]
|
"v2.0/tags": [variables]
|
||||||
---
|
---
|
||||||
|
|
||||||
{{% note %}}
|
|
||||||
In the current version of InfluxDB v2.0 alpha, only [query-populated variables](#query) are available.
|
|
||||||
{{% /note %}}
|
|
||||||
|
|
||||||
Variable types determine how a variable's list of possible values is populated.
|
Variable types determine how a variable's list of possible values is populated.
|
||||||
|
The following variable types are available:
|
||||||
|
|
||||||
|
- [Map](#map)
|
||||||
|
- [Query](#query)
|
||||||
|
- [CSV](#csv)
|
||||||
|
|
||||||
|
## Map
|
||||||
|
Map variables use a list of key value pairs in CSV format to map keys to specific values.
|
||||||
|
Keys populate the variable's value list in the InfluxDB user interface (UI), but
|
||||||
|
values are used when actually processing the query.
|
||||||
|
|
||||||
|
The most common use case for map variables is aliasing simple, human-readable keys
|
||||||
|
to complex values.
|
||||||
|
|
||||||
|
##### Map variable CSV example
|
||||||
|
```js
|
||||||
|
Juanito MacNeil,"5TKl6l8i4idg15Fxxe4P"
|
||||||
|
Astrophel Chaudhary,"bDhZbuVj5RV94NcFXZPm"
|
||||||
|
Ochieng Benes,"YIhg6SoMKRUH8FMlHs3V"
|
||||||
|
Mila Emile,"o61AhpOGr5aO3cYVArC0"
|
||||||
|
```
|
||||||
|
|
||||||
## Query
|
## Query
|
||||||
Variable values are populated using the `_value` column of a Flux query.
|
Query variable values are populated using the `_value` column of a Flux query.
|
||||||
|
|
||||||
##### Variable query example
|
##### Query variable example
|
||||||
```js
|
```js
|
||||||
// List all buckets
|
// List all buckets
|
||||||
buckets()
|
buckets()
|
||||||
|> rename(columns: {"name": "_value"})
|
|> rename(columns: {"name": "_value"})
|
||||||
|> keep(columns: ["_value"])
|
|> keep(columns: ["_value"])
|
||||||
```
|
```
|
||||||
|
|
||||||
_For examples of dashboard variable queries, see [Common variable queries](/v2.0/visualize-data/variables/common-variables)._
|
_For examples of dashboard variable queries, see [Common variable queries](/v2.0/visualize-data/variables/common-variables)._
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
#### Important things to note about variable queries
|
#### Important things to note about variable queries
|
||||||
- The variable will only use values from the `_value` column.
|
- The variable will only use values from the `_value` column.
|
||||||
If the data you’re looking for is in a column other than `_value`, use the
|
If the data you’re looking for is in a column other than `_value`, use the
|
||||||
|
@ -39,3 +56,20 @@ _For examples of dashboard variable queries, see [Common variable queries](/v2.0
|
||||||
Use the [`group()` function](/v2.0/reference/flux/functions/built-in/transformations/group)
|
Use the [`group()` function](/v2.0/reference/flux/functions/built-in/transformations/group)
|
||||||
to group everything into a single table.
|
to group everything into a single table.
|
||||||
- Do not use any [predefined dashboard variables](/v2.0/visualize-data/variables/#predefined-dashboard-variables) in variable queries.
|
- Do not use any [predefined dashboard variables](/v2.0/visualize-data/variables/#predefined-dashboard-variables) in variable queries.
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
|
## CSV
|
||||||
|
CSV variables use a CSV-formatted list to populate variable values.
|
||||||
|
A common use case is when the list of potential values is static and cannot be
|
||||||
|
queried from InfluxDB.
|
||||||
|
|
||||||
|
##### CSV variable examples
|
||||||
|
```
|
||||||
|
value1, value2, value3, value4
|
||||||
|
```
|
||||||
|
```
|
||||||
|
value1
|
||||||
|
value2
|
||||||
|
value3
|
||||||
|
value4
|
||||||
|
```
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
{{ else if eq $icon "search" }}
|
{{ else if eq $icon "search" }}
|
||||||
<span class="inline icon-ui-search middle small"></span>
|
<span class="inline icon-ui-search middle small"></span>
|
||||||
{{ else if or (eq $icon "trash") (eq $icon "trashcan") (eq $icon "delete") }}
|
{{ else if or (eq $icon "trash") (eq $icon "trashcan") (eq $icon "delete") }}
|
||||||
<span class="inline icon-ui-trash small"></span>
|
<span class="inline icon-ui-trash top small"></span>
|
||||||
{{ else if eq $icon "triangle" }}
|
{{ else if eq $icon "triangle" }}
|
||||||
<span class="inline icon-ui-triangle middle"></span>
|
<span class="inline icon-ui-triangle middle"></span>
|
||||||
{{ else if eq $icon "cloud" }}
|
{{ else if eq $icon "cloud" }}
|
||||||
|
@ -56,4 +56,6 @@
|
||||||
<span class="inline icon-ui-chat large"></span>
|
<span class="inline icon-ui-chat large"></span>
|
||||||
{{ else if eq $icon "add-label" }}
|
{{ else if eq $icon "add-label" }}
|
||||||
<span class="inline add-btn-round"></span>
|
<span class="inline add-btn-round"></span>
|
||||||
|
{{ else if eq $icon "toggle" }}
|
||||||
|
<span class="inline ui-toggle"><span class="circle"></span></span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 34 KiB |