InfluxDB tasks
Task Options
You can specify options that tasks will use. This makes it easier to reuse and modify your tasks.
option task = {
// Task name
name: "monitor task",
// Run interval
every: 5m,
// Cron job
cron : "0 * * * * *"
// Task start delay
offset: 10m,
// Maximum number of concurrent tasks
concurrency: 2,
// Number of tries before getting failed status
retry: 5,
}
Data processing and destination
You can use the to()
function to store the results in another bucket.
data
// Process
|> aggregateWindow(
every: 1h,
fn: sum
)
// Store results
|> to(bucket: "status_log", org: "logger")
You can learn more about data processing in the documentation.
Create a task in the UI
In the UI, you can create tasks by the following ways
- The Data Explorer screen
- The Task screen
- Import (in the Task screen)
- Create from template (in the Settings screen)
- Clone a taks (in the Task screen)
Data Explorer
- Open the Data Explorer
- Select Task
- Define the task options.
- Select a token.
- Click Save as Task
Task UI
- Open the Task screen
- Select Create Task
- Click New Task
- Define the task options.
- Select a token.
- Enter your script
- Click Save