updates to common tasks docs
parent
34cc68eac2
commit
fb5d9f2684
|
@ -10,3 +10,11 @@ menu:
|
|||
---
|
||||
|
||||
The following articles walk through common task use cases.
|
||||
|
||||
{{% note %}}
|
||||
This list will continue to grow.
|
||||
If you have suggestions, please [create an issue](https://github.com/influxdata/docs-v2/issues/new)
|
||||
on the InfluxData documentation repository on Github.
|
||||
{{% /note %}}
|
||||
|
||||
[Downsample Data with InfluxDB](/v2.0/process-data/common-tasks/downsample-data)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: Downsample data
|
||||
title: Downsample data with InfluxDB
|
||||
seotitle: Downsample data in an InfluxDB task
|
||||
description: placeholder
|
||||
menu:
|
||||
|
@ -9,9 +9,12 @@ menu:
|
|||
weight: 4
|
||||
---
|
||||
|
||||
- Talk about Continuous Queries
|
||||
|
||||
**Requirements:**
|
||||
|
||||
- Data source
|
||||
- A "source" bucket
|
||||
- A "destination" bucket
|
||||
- Some type of aggregation
|
||||
- and a `to` statement
|
||||
|
||||
|
@ -30,8 +33,8 @@ data = from(bucket: "telegraf")
|
|||
|> range(start: -task.every * 2)
|
||||
|> filter(fn: (r) => r._measurement == "cpu")
|
||||
|
||||
downsampleHourly = (table=<-) =>
|
||||
table
|
||||
downsampleHourly = (tables=<-) =>
|
||||
tables
|
||||
|> aggregateWindow(fn: mean, every: 1h)
|
||||
|> set(key: "_measurement", value: "cpu_1h" )
|
||||
|> to(bucket: "telegraf_downsampled", org: "my-org")
|
||||
|
|
Loading…
Reference in New Issue