Documentation

kapacitor define

The kapacitor define command creates or updates a task. A task is defined via a TICKscript that defines the data processing pipeline of the task.

When an existing task is updated, the task will be reloaded unless the -no-reload flag is included in the command.

Usage

kapacitor define [<task-id>] [flags]

Arguments

  • task-id: Unique identifier for the task

Flags

FlagDescriptionInput
-dbrpDatabase and retention policy to query (can be specified multiple times)"db"."rp" (double quotes are optional unless identifiers contain whitespace or special characters)
-filePath to a YAML or JSON template task fileFilepath
-no-reloadDo not reload the task even when enabled
-templateTemplate ID to use to create the taskTemplate ID
-tickPath to the TICKscript to use to create the taskFilepath
-typeTask typestream or batch
-varsPath to a JSON variables file when using a templateFilepath

Examples

Create a new task from a TICKscript

kapacitor define my_task \
  -dbrp mydb.myrp \
  -tick /path/to/TICKscript.tick \
  -type stream

Create a new task from a template

kapacitor define my_task \
  -dbrp mydb.myrp \
  -template alert_template \
  -vars /path/to/vars.json \  
  -type batch

Update the TICKscript of a task

kapacitor define existing_task \
  -tick /path/to/new_TICKscript.tick

Update a task without reloading the task

kapacitor define existing_task \
  -tick /path/to/new_TICKscript.tick \
  -no-reload

Update a task to query multiple DBRP combinations

If a task queries multiple database and retention policy (DBRP) combinations, to add more, you must include all existing DBRPs. Any existing DBRPs omitted from the command when updating a task are removed from the task.

kapacitor define existing_task \
  -dbrp mydb.myrp \
  -dbrp otherdb.default \
  -dbrp telegraf.autogen

Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.8

Key enhancements in InfluxDB 3.8 and the InfluxDB 3 Explorer 1.6.

See the Blog Post

InfluxDB 3.8 is now available for both Core and Enterprise, alongside the 1.6 release of the InfluxDB 3 Explorer UI. This release is focused on operational maturity and making InfluxDB easier to deploy, manage, and run reliably in production.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On April 7, 2026, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2