pipeline

package
v1.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 17 Imported by: 59

Documentation

Overview

Provides an API for constructing data processing pipelines.

The nodes defined in this package just define how nodes can be linked together not the actual implementation of the transformation functions.

Index

Constants

View Source
const (
	// NodeTypeOf is used by all Node to identify the node duration Marshal and Unmarshal
	NodeTypeOf = "typeOf"
	// NodeID is used by all Node as a unique ID duration Marshal and Unmarshal
	NodeID = "id"
)
View Source
const (
	DefaultNamespaceTag = "namespace"
	DefaultKindTag      = "kind"
	DefaultResourceTag  = "resource"
)
View Source
const DefaultBufferSize = 1000
View Source
const DefaultFlushInterval = time.Second * 10

Variables

This section is empty.

Functions

func Validate added in v1.4.0

func Validate(p *Pipeline) error

Types

type AlertHTTPPostHandler added in v1.3.0

type AlertHTTPPostHandler struct {
	*AlertNodeData `json:"-"`

	// The POST URL.
	// tick:ignore
	URL string `json:"url"`

	// Name of the endpoint to be used, as is defined in the configuration file
	Endpoint string `json:"endpoint"`

	// tick:ignore
	Headers map[string]string `tick:"Header" json:"headers"`

	// tick:ignore
	CaptureResponseFlag bool `tick:"CaptureResponse" json:"captureResponse"`

	// Timeout for HTTP Post
	Timeout time.Duration `json:"timeout"`

	// tick:ignore
	SkipSSLVerificationFlag bool `tick:"SkipSSLVerification" json:"skipSSLVerification"`
}

tick:embedded:AlertNode.Post

func (AlertHTTPPostHandler) Alert added in v1.3.0

func (n AlertHTTPPostHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (AlertHTTPPostHandler) Barrier added in v1.4.0

func (n AlertHTTPPostHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (AlertHTTPPostHandler) Bottom added in v1.3.0

func (n AlertHTTPPostHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*AlertHTTPPostHandler) CaptureResponse added in v1.4.0

func (a *AlertHTTPPostHandler) CaptureResponse() *AlertHTTPPostHandler

CaptureResponse indicates that the HTTP response should be read and logged if the status code was not an 2xx code. tick:property

func (AlertHTTPPostHandler) ChangeDetect added in v1.5.0

func (n AlertHTTPPostHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (AlertHTTPPostHandler) Combine added in v1.3.0

func (n AlertHTTPPostHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (AlertHTTPPostHandler) Count added in v1.3.0

func (n AlertHTTPPostHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (AlertHTTPPostHandler) CumulativeSum added in v1.3.0

func (n AlertHTTPPostHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (AlertHTTPPostHandler) Default added in v1.3.0

func (n AlertHTTPPostHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (AlertHTTPPostHandler) Delete added in v1.3.0

func (n AlertHTTPPostHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (AlertHTTPPostHandler) Derivative added in v1.3.0

func (n AlertHTTPPostHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (AlertHTTPPostHandler) Difference added in v1.3.0

func (n AlertHTTPPostHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (AlertHTTPPostHandler) Distinct added in v1.3.0

func (n AlertHTTPPostHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (AlertHTTPPostHandler) Ec2Autoscale added in v1.4.0

func (n AlertHTTPPostHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (AlertHTTPPostHandler) Elapsed added in v1.3.0

func (n AlertHTTPPostHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (AlertHTTPPostHandler) Eval added in v1.3.0

func (n AlertHTTPPostHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (AlertHTTPPostHandler) First added in v1.3.0

func (n AlertHTTPPostHandler) First(field string) *InfluxQLNode

Select the first point.

func (AlertHTTPPostHandler) Flatten added in v1.3.0

func (n AlertHTTPPostHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (AlertHTTPPostHandler) GroupBy added in v1.3.0

func (n AlertHTTPPostHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*AlertHTTPPostHandler) Header added in v1.3.0

Set a header key and value on the post request. Setting the Authenticate header is not allowed from within TICKscript, please use the configuration file to specify sensitive headers.

Example:

stream
     |alert()
         .post()
             .endpoint('example')
             .header('a','b')

tick:property

func (AlertHTTPPostHandler) HoltWinters added in v1.3.0

func (n AlertHTTPPostHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (AlertHTTPPostHandler) HoltWintersWithFit added in v1.3.0

func (n AlertHTTPPostHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (AlertHTTPPostHandler) HttpOut added in v1.3.0

func (n AlertHTTPPostHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (AlertHTTPPostHandler) HttpPost added in v1.3.0

func (n AlertHTTPPostHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (AlertHTTPPostHandler) InfluxDBOut added in v1.3.0

func (n AlertHTTPPostHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (AlertHTTPPostHandler) Join added in v1.3.0

func (n AlertHTTPPostHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (AlertHTTPPostHandler) K8sAutoscale added in v1.3.0

func (n AlertHTTPPostHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (AlertHTTPPostHandler) KapacitorLoopback added in v1.3.0

func (n AlertHTTPPostHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (AlertHTTPPostHandler) Last added in v1.3.0

func (n AlertHTTPPostHandler) Last(field string) *InfluxQLNode

Select the last point.

func (AlertHTTPPostHandler) Max added in v1.3.0

func (n AlertHTTPPostHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (AlertHTTPPostHandler) Mean added in v1.3.0

func (n AlertHTTPPostHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (AlertHTTPPostHandler) Median added in v1.3.0

func (n AlertHTTPPostHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (AlertHTTPPostHandler) Min added in v1.3.0

func (n AlertHTTPPostHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (AlertHTTPPostHandler) Mode added in v1.3.0

func (n AlertHTTPPostHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (AlertHTTPPostHandler) MovingAverage added in v1.3.0

func (n AlertHTTPPostHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (AlertHTTPPostHandler) Percentile added in v1.3.0

func (n AlertHTTPPostHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (AlertHTTPPostHandler) Sample added in v1.3.0

func (n AlertHTTPPostHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (AlertHTTPPostHandler) Shift added in v1.3.0

func (n AlertHTTPPostHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (AlertHTTPPostHandler) Sideload added in v1.4.0

func (n AlertHTTPPostHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*AlertHTTPPostHandler) SkipSSLVerification added in v1.5.3

func (a *AlertHTTPPostHandler) SkipSSLVerification() *AlertHTTPPostHandler

SkipSSLVerification disables ssl verification for the POST request Example:

stream
     |alert()
         .post()
             .endpoint('https'://user@pw/example/resource')
             .skipSSLVerification()

tick:property

func (AlertHTTPPostHandler) Spread added in v1.3.0

func (n AlertHTTPPostHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (AlertHTTPPostHandler) StateCount added in v1.3.0

func (n AlertHTTPPostHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (AlertHTTPPostHandler) StateDuration added in v1.3.0

func (n AlertHTTPPostHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (AlertHTTPPostHandler) Stddev added in v1.3.0

func (n AlertHTTPPostHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (AlertHTTPPostHandler) Sum added in v1.3.0

func (n AlertHTTPPostHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (AlertHTTPPostHandler) SwarmAutoscale added in v1.4.0

func (n AlertHTTPPostHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (AlertHTTPPostHandler) Top added in v1.3.0

func (n AlertHTTPPostHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (AlertHTTPPostHandler) Trickle added in v1.6.0

func (n AlertHTTPPostHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (AlertHTTPPostHandler) Union added in v1.3.0

func (n AlertHTTPPostHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (AlertHTTPPostHandler) Where added in v1.3.0

func (n AlertHTTPPostHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (AlertHTTPPostHandler) Window added in v1.3.0

func (n AlertHTTPPostHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type AlertNode

type AlertNode struct{ *AlertNodeData }

AlertNode struct wraps the default AlertNodeData tick:wraps:AlertNodeData

func (AlertNode) Alert added in v0.13.0

func (n AlertNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (AlertNode) Barrier added in v1.4.0

func (n AlertNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (AlertNode) Bottom added in v0.13.0

func (n AlertNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (AlertNode) ChangeDetect added in v1.5.0

func (n AlertNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (AlertNode) Combine added in v1.0.0

func (n AlertNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (AlertNode) Count added in v0.13.0

func (n AlertNode) Count(field string) *InfluxQLNode

Count the number of points.

func (AlertNode) CumulativeSum added in v1.1.0

func (n AlertNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (AlertNode) Default added in v0.13.0

func (n AlertNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (AlertNode) Delete added in v1.0.0

func (n AlertNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (AlertNode) Derivative added in v0.13.0

func (n AlertNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (AlertNode) Difference added in v1.0.0

func (n AlertNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (AlertNode) Distinct added in v0.13.0

func (n AlertNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (AlertNode) Ec2Autoscale added in v1.4.0

func (n AlertNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (AlertNode) Elapsed added in v0.13.0

func (n AlertNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (AlertNode) Eval added in v0.13.0

func (n AlertNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (AlertNode) First added in v0.13.0

func (n AlertNode) First(field string) *InfluxQLNode

Select the first point.

func (AlertNode) Flatten added in v1.0.0

func (n AlertNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (AlertNode) GroupBy added in v0.13.0

func (n AlertNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (AlertNode) HoltWinters added in v1.0.0

func (n AlertNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (AlertNode) HoltWintersWithFit added in v1.0.0

func (n AlertNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (AlertNode) HttpOut added in v0.13.0

func (n AlertNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (AlertNode) HttpPost added in v1.3.0

func (n AlertNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (AlertNode) InfluxDBOut added in v0.13.0

func (n AlertNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (AlertNode) Join added in v0.13.0

func (n AlertNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (AlertNode) K8sAutoscale added in v1.1.0

func (n AlertNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (AlertNode) KapacitorLoopback added in v1.3.0

func (n AlertNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (AlertNode) Last added in v0.13.0

func (n AlertNode) Last(field string) *InfluxQLNode

Select the last point.

func (*AlertNode) MarshalJSON added in v1.4.0

func (n *AlertNode) MarshalJSON() ([]byte, error)

MarshalJSON converts AlertNode to JSON tick:ignore

func (AlertNode) Max added in v0.13.0

func (n AlertNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (AlertNode) Mean added in v0.13.0

func (n AlertNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (AlertNode) Median added in v0.13.0

func (n AlertNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (AlertNode) Min added in v0.13.0

func (n AlertNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (AlertNode) Mode added in v1.0.0

func (n AlertNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (AlertNode) MovingAverage added in v1.0.0

func (n AlertNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (AlertNode) Percentile added in v0.13.0

func (n AlertNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (AlertNode) Sample added in v0.13.0

func (n AlertNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (AlertNode) Shift added in v0.13.0

func (n AlertNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (AlertNode) Sideload added in v1.4.0

func (n AlertNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (AlertNode) Spread added in v0.13.0

func (n AlertNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (AlertNode) StateCount added in v1.3.0

func (n AlertNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (AlertNode) StateDuration added in v1.3.0

func (n AlertNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (AlertNode) Stddev added in v0.13.0

func (n AlertNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (AlertNode) Sum added in v0.13.0

func (n AlertNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (AlertNode) SwarmAutoscale added in v1.4.0

func (n AlertNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (AlertNode) Top added in v0.13.0

func (n AlertNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (AlertNode) Trickle added in v1.6.0

func (n AlertNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (AlertNode) Union added in v0.13.0

func (n AlertNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*AlertNode) UnmarshalJSON added in v1.4.0

func (n *AlertNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an AlertNode tick:ignore

func (AlertNode) Where added in v0.13.0

func (n AlertNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (AlertNode) Window added in v0.13.0

func (n AlertNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type AlertNodeData added in v1.4.0

type AlertNodeData struct {

	// Category places this alert in a named category.
	// Categories are used to inhibit alerts.
	Category string `json:"category"`

	// Topic specifies the name of an alert topic to which,
	// alerts will be published.
	// Alert handlers can be configured per topic, see the API documentation.
	Topic string `json:"topic"`

	// Template for constructing a unique ID for a given alert.
	//
	// Available template data:
	//
	//    * Name -- Measurement name.
	//    * TaskName -- The name of the task
	//    * Group -- Concatenation of all group-by tags of the form [key=value,]+.
	//        If no groupBy is performed equal to literal 'nil'.
	//    * Tags -- Map of tags. Use '{{ index .Tags "key" }}' to get a specific tag value.
	//    * ServerInfo -- Information about the running server. Available nested fields are:
	//        Hostname, ClusterID and ServerID.
	//
	// Example:
	//   stream
	//       |from()
	//           .measurement('cpu')
	//           .groupBy('cpu')
	//       |alert()
	//           .id('kapacitor/{{ .Name }}/{{ .Group }}')
	//
	// ID: kapacitor/cpu/cpu=cpu0,
	//
	// Example:
	//   stream
	//       |from()
	//           .measurement('cpu')
	//           .groupBy('service')
	//       |alert()
	//           .id('kapacitor/{{ index .Tags "service" }}')
	//
	// ID: kapacitor/authentication
	//
	// Example:
	//   stream
	//       |from()
	//           .measurement('cpu')
	//           .groupBy('service', 'host')
	//       |alert()
	//           .id('kapacitor/{{ index .Tags "service" }}/{{ index .Tags "host" }}')
	//
	// ID: kapacitor/authentication/auth001.example.com
	//
	// Default: {{ .Name }}:{{ .Group }}
	Id string `json:"alertId"`

	// Template for constructing a meaningful message for the alert.
	//
	// Available template data:
	//
	//    * ID -- The ID of the alert.
	//    * Name -- Measurement name.
	//    * TaskName -- The name of the task
	//    * Group -- Concatenation of all group-by tags of the form [key=value,]+.
	//        If no groupBy is performed equal to literal 'nil'.
	//    * Tags -- Map of tags. Use '{{ index .Tags "key" }}' to get a specific tag value.
	//    * Level -- Alert Level, one of: INFO, WARNING, CRITICAL.
	//    * Fields -- Map of fields. Use '{{ index .Fields "key" }}' to get a specific field value.
	//    * Time -- The time of the point that triggered the event.
	//    * Duration -- The duration of the alert.
	//
	// Example:
	//   stream
	//       |from()
	//           .measurement('cpu')
	//           .groupBy('service', 'host')
	//       |alert()
	//           .id('{{ index .Tags "service" }}/{{ index .Tags "host" }}')
	//           .message('{{ .ID }} is {{ .Level}} value: {{ index .Fields "value" }}')
	//
	// Message: authentication/auth001.example.com is CRITICAL value:42
	//
	// Default: {{ .ID }} is {{ .Level }}
	Message string `json:"message"`

	// Template for constructing a detailed HTML message for the alert.
	// The same template data is available as the AlertNode.Message property,
	// in addition to a Message field that contains the rendered Message value.
	//
	// The intent is that the Message property be a single line summary while the
	// Details property is a more detailed message possibly spanning multiple lines,
	// and containing HTML formatting.
	//
	// This template is rendered using the html/template package in Go so that
	// safe and valid HTML can be generated.
	//
	// The `json` method is available within the template to convert any variable to a valid
	// JSON string.
	//
	// Example:
	//    |alert()
	//       .id('{{ .Name }}')
	//       .details(”'
	//<h1>{{ .ID }}</h1>
	//<b>{{ .Message }}</b>
	//Value: {{ index .Fields "value" }}
	//”')
	//       .email()
	//
	// Default: {{ json . }}
	Details string `json:"details"`

	// Filter expression for the INFO alert level.
	// An empty value indicates the level is invalid and is skipped.
	Info *ast.LambdaNode `json:"info"`
	// Filter expression for the WARNING alert level.
	// An empty value indicates the level is invalid and is skipped.
	Warn *ast.LambdaNode `json:"warn"`
	// Filter expression for the CRITICAL alert level.
	// An empty value indicates the level is invalid and is skipped.
	Crit *ast.LambdaNode `json:"crit"`

	// Filter expression for reseting the INFO alert level to lower level.
	InfoReset *ast.LambdaNode `json:"infoReset"`
	// Filter expression for reseting the WARNING alert level to lower level.
	WarnReset *ast.LambdaNode `json:"warnReset"`
	// Filter expression for reseting the CRITICAL alert level to lower level.
	CritReset *ast.LambdaNode `json:"critReset"`

	//tick:ignore
	UseFlapping bool `tick:"Flapping" json:"useFlapping"`
	//tick:ignore
	FlapLow float64 `json:"flapLow"`
	//tick:ignore
	FlapHigh float64 `json:"flapHigh"`

	// Number of previous states to remember when computing flapping levels and
	// checking for state changes.
	// Minimum value is 2 in order to keep track of current and previous states.
	//
	// Default: 21
	History int64 `json:"history"`

	// Optional tag key to use when tagging the data with the alert level.
	LevelTag string `json:"levelTag"`
	// Optional field key to add to the data, containing the alert level as a string.
	LevelField string `json:"levelField"`

	// Optional field key to add to the data, containing the alert message.
	MessageField string `json:"messageField"`

	// Optional field key to add the alert duration to the data.
	// The duration is always in units of nanoseconds.
	DurationField string `json:"durationField"`

	// Optional tag key to use when tagging the data with the alert ID.
	IdTag string `json:"idTag"`
	// Optional field key to add to the data, containing the alert ID as a string.
	IdField string `json:"idField"`

	// Indicates an alert should trigger only if all points in a batch match the criteria
	// tick:ignore
	AllFlag bool `tick:"All" json:"all"`

	// Do not send recovery events.
	// tick:ignore
	NoRecoveriesFlag bool `tick:"NoRecoveries" json:"noRecoveries"`

	// Send alerts only on state changes.
	// tick:ignore
	IsStateChangesOnly bool `tick:"StateChangesOnly" json:"stateChangesOnly"`

	// Maximum interval to ignore non state changed events
	// tick:ignore
	StateChangesOnlyDuration time.Duration `json:"stateChangesOnlyDuration"`

	// Inhibitors
	// tick:ignore
	Inhibitors []Inhibitor `tick:"Inhibit" json:"inhibitors"`

	// Post the JSON alert data to the specified URL.
	// tick:ignore
	HTTPPostHandlers []*AlertHTTPPostHandler `tick:"Post" json:"post"`

	// Send the JSON alert data to the specified endpoint via TCP.
	// tick:ignore
	TcpHandlers []*TcpHandler `tick:"Tcp" json:"tcp"`

	// Email handlers
	// tick:ignore
	EmailHandlers []*EmailHandler `tick:"Email" json:"email"`

	// A commands to run when an alert triggers
	// tick:ignore
	ExecHandlers []*ExecHandler `tick:"Exec" json:"exec"`

	// Log JSON alert data to file. One event per line.
	// tick:ignore
	LogHandlers []*LogHandler `tick:"Log" json:"log"`

	// Send alert to VictorOps.
	// tick:ignore
	VictorOpsHandlers []*VictorOpsHandler `tick:"VictorOps" json:"victorOps"`

	// Send alert to PagerDuty.
	// tick:ignore
	PagerDutyHandlers []*PagerDutyHandler `tick:"PagerDuty" json:"pagerDuty"`

	// Send alert to PagerDuty API v2.
	// tick:ignore
	PagerDuty2Handlers []*PagerDuty2Handler `tick:"PagerDuty2" json:"pagerDuty2"`

	// Send alert to Pushover.
	// tick:ignore
	PushoverHandlers []*PushoverHandler `tick:"Pushover" json:"pushover"`

	// Send alert to Sensu.
	// tick:ignore
	SensuHandlers []*SensuHandler `tick:"Sensu" json:"sensu"`

	// Send alert to Slack.
	// tick:ignore
	SlackHandlers []*SlackHandler `tick:"Slack" json:"slack"`

	// Send alert to Discord.
	// tick:ignore
	DiscordHandlers []*DiscordHandler `tick:"Discord" json:"discord"`

	// Send alert to BigPanda
	// tick:ignore
	BigPandaHandlers []*BigPandaHandler `tick:"BigPanda" json:"bigPanda"`

	// Send alert to Telegram.
	// tick:ignore
	TelegramHandlers []*TelegramHandler `tick:"Telegram" json:"telegram"`

	// Send alert to HipChat.
	// tick:ignore
	HipChatHandlers []*HipChatHandler `tick:"HipChat" json:"hipChat"`

	// Send alert to Alerta.
	// tick:ignore
	AlertaHandlers []*AlertaHandler `tick:"Alerta" json:"alerta"`

	// Send alert to OpsGenie
	// tick:ignore
	OpsGenieHandlers []*OpsGenieHandler `tick:"OpsGenie" json:"opsGenie"`

	// Send alert to OpsGenie using v2 API
	// tick:ignore
	OpsGenie2Handlers []*OpsGenie2Handler `tick:"OpsGenie2" json:"opsGenie2"`

	// Send alert to Talk.
	// tick:ignore
	TalkHandlers []*TalkHandler `tick:"Talk" json:"talk"`

	// Send alert to MQTT
	// tick:ignore
	MQTTHandlers []*MQTTHandler `tick:"Mqtt" json:"mqtt"`

	// Send alert using SNMPtraps.
	// tick:ignore
	SNMPTrapHandlers []*SNMPTrapHandler `tick:"SnmpTrap" json:"snmpTrap"`

	// Send alert to Kafka topic
	// tick:ignore
	KafkaHandlers []*KafkaHandler `tick:"Kafka" json:"kafka"`

	// Send alert to Microsoft Teams channel.
	// tick:ignore
	TeamsHandlers []*TeamsHandler `tick:"Teams" json:"teams"`

	// Send alert to ServiceNow.
	// tick:ignore
	ServiceNowHandlers []*ServiceNowHandler `tick:"ServiceNow" json:"serviceNow"`

	// Send alert to Zenoss.
	// tick:ignore
	ZenossHandlers []*ZenossHandler `tick:"Zenoss" json:"zenoss"`
	// contains filtered or unexported fields
}

An AlertNode can trigger an event of varying severity levels, and pass the event to alert handlers. The criteria for triggering an alert is specified via a [lambda expression](/kapacitor/latest/tick/expr/). See AlertNode.Info, AlertNode.Warn, and AlertNode.Crit below.

Different event handlers can be configured for each AlertNode. Some handlers like Email, HipChat, Sensu, Slack, OpsGenie, VictorOps, PagerDuty, Telegram and Talk have a configuration option 'global' that indicates that all alerts implicitly use the handler.

Available event handlers:

  • log -- log alert data to file.
  • post -- HTTP POST data to a specified URL.
  • tcp -- Send data to a specified address via raw TCP.
  • email -- Send and email with alert data.
  • exec -- Execute a command passing alert data over STDIN.
  • HipChat -- Post alert message to HipChat room.
  • Alerta -- Post alert message to Alerta.
  • Sensu -- Post alert message to Sensu client.
  • Slack -- Post alert message to Slack channel.
  • SNMPTraps -- Trigger SNMP traps.
  • OpsGenie -- Send alert to OpsGenie.
  • VictorOps -- Send alert to VictorOps.
  • PagerDuty -- Send alert to PagerDuty.
  • Pushover -- Send alert to Pushover.
  • Talk -- Post alert message to Talk client.
  • Telegram -- Post alert message to Telegram client.
  • MQTT -- Post alert message to MQTT.
  • Teams -- Post alert message to Microsoft Teams.
  • Discord -- Post alert message to Discord webhook.
  • ServiceNow -- Post alert message to ServiceNow.

See below for more details on configuring each handler.

Each event that gets sent to a handler contains the following alert data:

  • ID -- the ID of the alert, user defined.
  • Message -- the alert message, user defined.
  • Details -- the alert details, user defined HTML content.
  • Time -- the time the alert occurred.
  • Duration -- the duration of the alert in nanoseconds.
  • Level -- one of OK, INFO, WARNING or CRITICAL.
  • Data -- influxql.Result containing the data that triggered the alert.

Events are sent to handlers if the alert is in a state other than 'OK' or the alert just changed to the 'OK' state from a non 'OK' state (a.k.a. the alert recovered). Using the AlertNode.StateChangesOnly property events will only be sent to handlers if the alert changed state.

It is valid to configure multiple alert handlers, even with the same type.

Example:

stream
        .groupBy('service')
    |alert()
        .id('kapacitor/{{ index .Tags "service" }}')
        .message('{{ .ID }} is {{ .Level }} value:{{ index .Fields "value" }}')
        .info(lambda: "value" > 10)
        .warn(lambda: "value" > 20)
        .crit(lambda: "value" > 30)
        .post("http://example.com/api/alert")
        .post("http://another.example.com/api/alert")
        .tcp("exampleendpoint.com:5678")
        .email('oncall@example.com')

Each expression maintains its own state. The order of execution for the expressions is not considered to be deterministic. For each point an expression may or may not be evaluated. If no expression is true then the alert is considered to be in the OK state.

Kapacitor supports alert reset expressions. This way when an alert enters a state, it can only be lowered in severity if its reset expression evaluates to true.

Example:

stream
    |from()
        .measurement('cpu')
        .where(lambda: "host" == 'serverA')
        .groupBy('host')
    |alert()
        .info(lambda: "value" > 60)
        .infoReset(lambda: "value" < 50)
        .warn(lambda: "value" > 70)
        .warnReset(lambda: "value" < 60)
        .crit(lambda: "value" > 80)
        .critReset(lambda: "value" < 70)

For example given the following values:

61 73 64 85 62 56 47

The corresponding alert states are:

INFO WARNING WARNING CRITICAL INFO INFO OK

Available Statistics:

  • alerts_triggered -- Total number of alerts triggered
  • oks_triggered -- Number of OK alerts triggered
  • infos_triggered -- Number of Info alerts triggered
  • warns_triggered -- Number of Warn alerts triggered
  • crits_triggered -- Number of Crit alerts triggered

func (*AlertNodeData) Alert added in v1.4.0

func (n *AlertNodeData) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*AlertNodeData) Alerta added in v1.4.0

func (n *AlertNodeData) Alerta() *AlertaHandler

Send the alert to Alerta.

Example:

[alerta]
  enabled = true
  url = "https://alerta.yourdomain"
  token = "9hiWoDOZ9IbmHsOTeST123ABciWTIqXQVFDo63h9"
  environment = "Production"
  origin = "Kapacitor"

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are sent to Alerta.

Send alerts to Alerta. The resource and event properties are required.

Example:

stream
     |alert()
         .alerta()
             .resource('Hostname or service')
             .event('Something went wrong')

Alerta also accepts optional alert information.

Example:

stream
     |alert()
         .alerta()
             .resource('Hostname or service')
             .event('Something went wrong')
             .environment('Development')
             .group('Dev. Servers')
             .timeout(5m)

NOTE: Alerta cannot be configured globally because of its required properties. tick:property

func (*AlertNodeData) All added in v1.4.0

func (n *AlertNodeData) All() *AlertNodeData

Indicates an alert should trigger only if all points in a batch match the criteria. Does not apply to stream alerts. tick:property

func (*AlertNodeData) Barrier added in v1.4.0

func (n *AlertNodeData) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*AlertNodeData) BigPanda added in v1.5.8

func (n *AlertNodeData) BigPanda() *BigPandaHandler

func (*AlertNodeData) Bottom added in v1.4.0

func (n *AlertNodeData) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*AlertNodeData) ChainMethods added in v1.4.0

func (n *AlertNodeData) ChainMethods() map[string]reflect.Value

func (*AlertNodeData) ChangeDetect added in v1.5.0

func (n *AlertNodeData) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*AlertNodeData) Combine added in v1.4.0

func (n *AlertNodeData) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*AlertNodeData) Count added in v1.4.0

func (n *AlertNodeData) Count(field string) *InfluxQLNode

Count the number of points.

func (*AlertNodeData) CumulativeSum added in v1.4.0

func (n *AlertNodeData) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*AlertNodeData) Default added in v1.4.0

func (n *AlertNodeData) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*AlertNodeData) Delete added in v1.4.0

func (n *AlertNodeData) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*AlertNodeData) Derivative added in v1.4.0

func (n *AlertNodeData) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*AlertNodeData) Difference added in v1.4.0

func (n *AlertNodeData) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*AlertNodeData) Discord added in v1.5.6

func (n *AlertNodeData) Discord() *DiscordHandler

Send the alert to Discord. To allow Kapacitor to post to Discord, follow this guide https://support.discordapp.com/hc/en-us/articles/228383668 and create a new webhook and place the generated URL in the 'discord' configuration section.

Example:

[[discord]]
  enabled = true
  url = "https://discordapp.com/api/webhooks/xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are posted to the channel.

Example:

stream
     |alert()
         .discord()

Send alerts to the default workspace

Example: stream

|alert()
    .discord()
    .workspace('opencommunity')

send alerts to the opencommunity workspace

If the 'discord' section in the configuration has the option: global = true then all alerts are sent to Discord without the need to explicitly state it in the TICKscript.

Example:

[[discord]]
  enabled = true
  default = true
  workspace = examplecorp
  url = "https://discordapp.com/api/webhooks/xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  global = true
  state-changes-only = true

Example:

stream
     |alert()

Send alert to Discord. tick:property

func (*AlertNodeData) Distinct added in v1.4.0

func (n *AlertNodeData) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*AlertNodeData) Ec2Autoscale added in v1.4.0

func (n *AlertNodeData) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*AlertNodeData) Elapsed added in v1.4.0

func (n *AlertNodeData) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*AlertNodeData) Email added in v1.4.0

func (n *AlertNodeData) Email(to ...string) *EmailHandler

Email the alert data.

If the To list is empty, the To addresses from the configuration are used. The email subject is the AlertNode.Message property. The email body is the AlertNode.Details property. The emails are sent as HTML emails and so the body can contain html markup.

If the 'smtp' section in the configuration has the option: global = true then all alerts are sent via email without the need to explicitly state it in the TICKscript.

Example:

|alert()
   .id('{{ .Name }}')
   // Email subject
   .message('{{ .ID }}:{{ .Level }}')
   //Email body as HTML
   .details('''

<h1>{{ .ID }}</h1> <b>{{ .Message }}</b> Value: {{ index .Fields "value" }} ”')

.email()

Send an email with custom subject and body.

Example:

[smtp]
  enabled = true
  host = "localhost"
  port = 25
  username = ""
  password = ""
  from = "kapacitor@example.com"
  to = ["oncall@example.com"]
  # Set global to true so all alert trigger emails.
  global = true
  state-changes-only =  true

Example:

stream
     |alert()

Send email to 'oncall@example.com' from 'kapacitor@example.com'

tick:property

func (*AlertNodeData) Eval added in v1.4.0

func (n *AlertNodeData) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*AlertNodeData) Exec added in v1.4.0

func (n *AlertNodeData) Exec(executable string, args ...string) *ExecHandler

Execute a command whenever an alert is triggered and pass the alert data over STDIN in JSON format. tick:property

func (*AlertNodeData) First added in v1.4.0

func (n *AlertNodeData) First(field string) *InfluxQLNode

Select the first point.

func (*AlertNodeData) Flapping added in v1.4.0

func (n *AlertNodeData) Flapping(low, high float64) *AlertNodeData

Perform flap detection on the alerts. The method used is similar method to Nagios: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/flapping.html

Each different alerting level is considered a different state. The low and high thresholds are inverted thresholds of a percentage of state changes. Meaning that if the percentage of state changes goes above the `high` threshold, the alert enters a flapping state. The alert remains in the flapping state until the percentage of state changes goes below the `low` threshold. Typical values are low: 0.25 and high: 0.5. The percentage values represent the number state changes over the total possible number of state changes. A percentage change of 0.5 means that the alert changed state in half of the recorded history, and remained the same in the other half of the history. tick:property

func (*AlertNodeData) Flatten added in v1.4.0

func (n *AlertNodeData) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*AlertNodeData) GroupBy added in v1.4.0

func (n *AlertNodeData) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*AlertNodeData) HipChat added in v1.4.0

func (n *AlertNodeData) HipChat() *HipChatHandler

Send the alert to HipChat. For step-by-step instructions on setting up Kapacitor with HipChat, see the [Event Handler Setup Guide](https://docs.influxdata.com//kapacitor/latest/guides/event-handler-setup/#hipchat-setup). To allow Kapacitor to post to HipChat, go to the URL https://www.hipchat.com/docs/apiv2 for information on how to get your room id and tokens.

Example:

[hipchat]
  enabled = true
  url = "https://orgname.hipchat.com/v2/room"
  room = "4189212"
  token = "9hiWoDOZ9IbmHsOTeST123ABciWTIqXQVFDo63h9"

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are posted to the room.

Example:

stream
     |alert()
         .hipChat()

Send alerts to HipChat room in the configuration file.

Example:

stream
     |alert()
         .hipChat()
         .room('Kapacitor')

Send alerts to HipChat room 'Kapacitor'

If the 'hipchat' section in the configuration has the option: global = true then all alerts are sent to HipChat without the need to explicitly state it in the TICKscript.

Example:

[hipchat]
  enabled = true
  url = "https://orgname.hipchat.com/v2/room"
  room = "Test Room"
  token = "9hiWoDOZ9IbmHsOTeST123ABciWTIqXQVFDo63h9"
  global = true
  state-changes-only = true

Example:

stream
     |alert()

Send alert to HipChat using default room 'Test Room'. tick:property

func (*AlertNodeData) HoltWinters added in v1.4.0

func (n *AlertNodeData) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*AlertNodeData) HoltWintersWithFit added in v1.4.0

func (n *AlertNodeData) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*AlertNodeData) HttpOut added in v1.4.0

func (n *AlertNodeData) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*AlertNodeData) HttpPost added in v1.4.0

func (n *AlertNodeData) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*AlertNodeData) InfluxDBOut added in v1.4.0

func (n *AlertNodeData) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*AlertNodeData) Inhibit added in v1.5.0

func (n *AlertNodeData) Inhibit(category string, equalTags ...string) *AlertNodeData

Inhibit other alerts in a category. The equal tags provides a list of tags that must be equal in order for an alert event to be inhibited.

The following two TICKscripts demonstrate how to use the inhibit feature.

Example:

//cpu_alert.tick
stream
    |from()
        .measurement('cpu')
        .groupBy('host')
    |alert()
        .category('system_alerts')
        .crit(lambda: "usage_idle" < 10.0)

//host_alert.tick
stream
    |from()
        .measurement('uptime')
        .groupBy('host')
    |deadman(0.0, 1m)
        .inhibit('system_alerts', 'host')

The deadman is a kind of alert node and so can be used to inhibit all alerts in the `system_alerts` category when it triggers. The 'host` argument to the inhibit function says that the host tag must be equal between the cpu alert and the host alert in order for it to be inhibited. This has the effect of the deadman alerts only inhibits cpu alerts for hosts are are currently dead.

tick:property

func (*AlertNodeData) Join added in v1.4.0

func (n *AlertNodeData) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*AlertNodeData) K8sAutoscale added in v1.4.0

func (n *AlertNodeData) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*AlertNodeData) Kafka added in v1.5.0

func (n *AlertNodeData) Kafka() *KafkaHandler

Send the alert to a Kafka topic.

Example:

[[kafka]]
  enabled = true
  id = "default"
  brokers = ["localhost:9092"]

Example:

stream
     |alert()
         .kafka()
             .cluster('default')
             .kafkaTopic('alerts')

Mesasges are written to Kafka asynchronously. As such, errors are not reported for individual writes to Kafka, rather an error counter is recorded.

Kapacitor tracks these stats for Kafka:

* write_errors - Reports the number of errors encountered when writing to Kafka for a given topic and cluster. * write_messages - Reports the number of messages written to Kafka for a given topic and cluster.

tick:property

func (*AlertNodeData) KapacitorLoopback added in v1.4.0

func (n *AlertNodeData) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*AlertNodeData) Last added in v1.4.0

func (n *AlertNodeData) Last(field string) *InfluxQLNode

Select the last point.

func (*AlertNodeData) Log added in v1.4.0

func (n *AlertNodeData) Log(filepath string) *LogHandler

Log JSON alert data to file. One event per line. Must specify the absolute path to the log file. It will be created if it does not exist. Example:

stream
     |alert()
         .log('/tmp/alert')

Example:

stream
     |alert()
         .log('/tmp/alert')
         .mode(0644)

tick:property

func (*AlertNodeData) Max added in v1.4.0

func (n *AlertNodeData) Max(field string) *InfluxQLNode

Select the maximum point.

func (*AlertNodeData) Mean added in v1.4.0

func (n *AlertNodeData) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*AlertNodeData) Median added in v1.4.0

func (n *AlertNodeData) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*AlertNodeData) Min added in v1.4.0

func (n *AlertNodeData) Min(field string) *InfluxQLNode

Select the minimum point.

func (*AlertNodeData) Mode added in v1.4.0

func (n *AlertNodeData) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*AlertNodeData) MovingAverage added in v1.4.0

func (n *AlertNodeData) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*AlertNodeData) Mqtt added in v1.4.0

func (n *AlertNodeData) Mqtt(topic string) *MQTTHandler

Send alert to an MQTT broker tick:property

func (*AlertNodeData) NoRecoveries added in v1.4.0

func (n *AlertNodeData) NoRecoveries() *AlertNodeData

Do not send recovery alerts. tick:property

func (*AlertNodeData) OpsGenie added in v1.4.0

func (n *AlertNodeData) OpsGenie() *OpsGenieHandler

Send alert to OpsGenie. To use OpsGenie alerting you must first enable the 'Alert Ingestion API' in the 'Integrations' section of OpsGenie. Then place the API key from the URL into the 'opsgenie' section of the Kapacitor configuration.

Example:

[opsgenie]
  enabled = true
  api-key = "xxxxx"
  teams = ["everyone"]
  recipients = ["jim", "bob"]

With the correct configuration you can now use OpsGenie in TICKscripts.

Example:

stream
     |alert()
         .opsGenie()

Send alerts to OpsGenie using the teams and recipients in the configuration file.

Example:

stream
     |alert()
         .opsGenie()
         .teams('team_rocket','team_test')

Send alerts to OpsGenie with team set to 'team_rocket' and 'team_test'

If the 'opsgenie' section in the configuration has the option: global = true then all alerts are sent to OpsGenie without the need to explicitly state it in the TICKscript.

Example:

[opsgenie]
  enabled = true
  api-key = "xxxxx"
  recipients = ["johndoe"]
  global = true

Example:

stream
     |alert()

Send alert to OpsGenie using the default recipients, found in the configuration. tick:property

func (*AlertNodeData) OpsGenie2 added in v1.5.0

func (n *AlertNodeData) OpsGenie2() *OpsGenie2Handler

Send alert to OpsGenie using the v2 API. To use OpsGenie2 alerting you must first enable the 'Alert Ingestion API' in the 'Integrations' section of OpsGenie2. Then place the API key from the URL into the 'opsgenie2' section of the Kapacitor configuration.

Example:

[opsgenie2]
  enabled = true
  api-key = "xxxxx"
  teams = ["everyone"]
  recipients = ["jim", "bob"]

With the correct configuration you can now use OpsGenie2 in TICKscripts.

Example:

stream
     |alert()
         .opsGenie()

Send alerts to OpsGenie2 using the teams and recipients in the configuration file.

Example:

stream
     |alert()
         .opsGenie()
         .teams('team_rocket','team_test')

Send alerts to OpsGenie2 with team set to 'team_rocket' and 'team_test'

If the 'opsgenie2' section in the configuration has the option: global = true then all alerts are sent to OpsGenie2 without the need to explicitly state it in the TICKscript.

Example:

[opsgenie2]
  enabled = true
  api-key = "xxxxx"
  recipients = ["johndoe"]
  details = false
  global = true

Example:

stream
     |alert()

Send alert to OpsGenie2 using the default recipients, found in the configuration. tick:property

func (*AlertNodeData) PagerDuty added in v1.4.0

func (n *AlertNodeData) PagerDuty() *PagerDutyHandler

Send the alert to PagerDuty. To use PagerDuty alerting you must first follow the steps to enable a new 'Generic API' service.

From https://developer.pagerduty.com/documentation/integration/events

  1. In your account, under the Services tab, click "Add New Service".
  2. Enter a name for the service and select an escalation policy. Then, select "Generic API" for the Service Type.
  3. Click the "Add Service" button.
  4. Once the service is created, you'll be taken to the service page. On this page, you'll see the "Service key", which is needed to access the API

Place the 'service key' into the 'pagerduty' section of the Kapacitor configuration as the option 'service-key'.

Example:

[pagerduty]
  enabled = true
  service-key = "xxxxxxxxx"

With the correct configuration you can now use PagerDuty in TICKscripts.

Example:

stream
     |alert()
         .pagerDuty()

If the 'pagerduty' section in the configuration has the option: global = true then all alerts are sent to PagerDuty without the need to explicitly state it in the TICKscript.

Example:

[pagerduty]
  enabled = true
  service-key = "xxxxxxxxx"
  global = true

Example:

stream
     |alert()

Send alert to PagerDuty. tick:property

func (*AlertNodeData) PagerDuty2 added in v1.5.0

func (n *AlertNodeData) PagerDuty2() *PagerDuty2Handler

Send the alert to PagerDuty API v2. To use PagerDuty alerting you must first follow the steps to enable a new 'Generic API' service. NOTE: the API v2 endpoint is different and requires a new configuration in order to process/handle alerts

From https://developer.pagerduty.com/documentation/integration/events

  1. In your account, under the Services tab, click "Add New Service".
  2. Enter a name for the service and select an escalation policy. Then, select "Generic API" for the Service Type.
  3. Click the "Add Service" button.
  4. Once the service is created, you'll be taken to the service page. On this page, you'll see the "Integration key", which is needed to access the API

Place the 'integration key' into the 'pagerduty' section of the Kapacitor configuration as the option 'routing-key'.

Example:

[pagerduty2]
  enabled = true
  routing-key = "xxxxxxxxx"

With the correct configuration you can now use PagerDuty in TICKscripts.

Example:

stream
     |alert()
         .pagerDuty2()

If the 'pagerduty' section in the configuration has the option: global = true then all alerts are sent to PagerDuty without the need to explicitly state it in the TICKscript.

Example:

[pagerduty2]
  enabled = true
  routing-key = "xxxxxxxxx"
  global = true

Example:

stream
     |alert()

Send alert to PagerDuty API v2. tick:property

func (*AlertNodeData) Percentile added in v1.4.0

func (n *AlertNodeData) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*AlertNodeData) Post added in v1.4.0

func (n *AlertNodeData) Post(urls ...string) *AlertHTTPPostHandler

HTTP POST JSON alert data to a specified URL.

Example:

stream
     |alert()
         .post()
             .endpoint('example')

Example:

stream
     |alert()
         .post('http://example.com')

tick:property

func (*AlertNodeData) Pushover added in v1.4.0

func (n *AlertNodeData) Pushover() *PushoverHandler

Send the alert to Pushover. Register your application with Pushover at https://pushover.net/apps/build to get a Pushover token.

Alert Level Mapping: OK - Sends a -2 priority level. Info - Sends a -1 priority level. Warning - Sends a 0 priority level. Critical - Sends a 1 priority level.

Example:

[pushover]
  enabled = true
  token = "9hiWoDOZ9IbmHsOTeST123ABciWTIqXQVFDo63h9"
  user-key = "Pushover"

Example:

stream
     |alert()
         .pushover()
          .sound('siren')
          .userKey('other user key or delivery group key')
          .device('mydev')
          .title('mytitle')
          .URL('myurl')
          .URLTitle('mytitle')

If the userKey() is omitted from above, the default userKey is used from the global pushover configuration

Send alerts to Pushover.

tick:property

func (*AlertNodeData) Sample added in v1.4.0

func (n *AlertNodeData) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*AlertNodeData) Sensu added in v1.4.0

func (n *AlertNodeData) Sensu() *SensuHandler

Send the alert to Sensu.

Example:

[sensu]
  enabled = true
  addr = "sensu:3030"
  source = "Kapacitor"
  handlers = ["sns","slack"]

Example:

stream
     |alert()
         .sensu()

Send alerts to Sensu client.

Example:

stream
     |alert()
         .sensu()
         .handlers('sns','slack')

Send alerts to Sensu specifying the handlers

tick:property

func (*AlertNodeData) ServiceNow added in v1.5.7

func (n *AlertNodeData) ServiceNow() *ServiceNowHandler

Send the alert to ServiceNow.

Example:

[serviceNow]
  enabled = true
  url = "https://instance.service-now.com/api/global/em/jsonv2"

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are posted to the room.

Example:

stream
     |alert()
         .serviceNow()

If the 'serviceNow' section in the configuration has the option: global = true then all alerts are sent to ServiceNow without the need to explicitly state it in the TICKscript.

Example:

[serviceNow]
  enabled = true
  url = "https://instance.service-now.com/api/global/em/jsonv2"
  global = true
  state-changes-only = true

Example:

stream
     |alert()

Send alert to ServiceNow using default url. tick:property

func (*AlertNodeData) Shift added in v1.4.0

func (n *AlertNodeData) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*AlertNodeData) Sideload added in v1.4.0

func (n *AlertNodeData) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*AlertNodeData) Slack added in v1.4.0

func (n *AlertNodeData) Slack() *SlackHandler

Send the alert to Slack. To allow Kapacitor to post to Slack, go to the URL https://slack.com/services/new/incoming-webhook and create a new incoming webhook and place the generated URL in the 'slack' configuration section.

Example:

[slack]
  enabled = true
  url = "https://hooks.slack.com/services/xxxxxxxxx/xxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx"
  channel = "#general"

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are posted to the channel.

Example:

stream
     |alert()
         .slack()

Send alerts to the default worskace Slack channel in the configuration file.

Example:

stream
     |alert()
         .slack()
         .channel('#alerts')

Send alerts to the default workspace with Slack channel '#alerts'

Example:

stream
     |alert()
         .slack()
         .channel('@jsmith')

Send alert to user '@jsmith'

Example: stream

|alert()
    .slack()
    .workspace('opencommunity')
    .channel('#support')

send alerts to the opencommunity workspace on the channel '#support'

If the 'slack' section in the configuration has the option: global = true then all alerts are sent to Slack without the need to explicitly state it in the TICKscript.

Example:

[[slack]]
  enabled = true
  default = true
  workspace = examplecorp
  url = "https://hooks.slack.com/services/xxxxxxxxx/xxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx"
  channel = "#general"
  global = true
  state-changes-only = true

Example:

stream
     |alert()

Send alert to Slack using default channel '#general'. tick:property

func (*AlertNodeData) SnmpTrap added in v1.4.0

func (n *AlertNodeData) SnmpTrap(trapOid string) *SNMPTrapHandler

Send the alert using SNMP traps. To allow Kapacitor to post SNMP traps,

Example:

[snmptrap]
  enabled = true
  addr = "127.0.0.1:9162"
  community = "public"

Example:

stream
     |alert()
         .snmpTrap('1.1.1.1')
             .data('1.3.6.1.2.1.1.7', 'i', '{{ index .Field "value" }}')

Send alerts to `target-ip:target-port` on OID '1.3.6.1.2.1.1.7'

tick:property

func (*AlertNodeData) Spread added in v1.4.0

func (n *AlertNodeData) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*AlertNodeData) StateChangesOnly added in v1.4.0

func (n *AlertNodeData) StateChangesOnly(maxInterval ...time.Duration) *AlertNodeData

Only sends events where the state changed. Each different alert level OK, INFO, WARNING, and CRITICAL are considered different states.

Example:

stream
    |from()
        .measurement('cpu')
    |window()
         .period(10s)
         .every(10s)
    |alert()
        .crit(lambda: "value" > 10)
        .stateChangesOnly()
        .slack()

If the "value" is greater than 10 for a total of 60s, then only two events will be sent. First, when the value crosses the threshold, and second, when it falls back into an OK state. Without stateChangesOnly, the alert would have triggered 7 times: 6 times for each 10s period where the condition was met and once more for the recovery.

An optional maximum interval duration can be provided. An event will not be ignore (aka trigger an alert) if more than the maximum interval has elapsed since the last alert.

Example:

stream
    |from()
        .measurement('cpu')
    |window()
         .period(10s)
         .every(10s)
    |alert()
        .crit(lambda: "value" > 10)
        .stateChangesOnly(10m)
        .slack()

The above usage will only trigger alerts to slack on state changes or at least every 10 minutes.

tick:property

func (*AlertNodeData) StateCount added in v1.4.0

func (n *AlertNodeData) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*AlertNodeData) StateDuration added in v1.4.0

func (n *AlertNodeData) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*AlertNodeData) Stddev added in v1.4.0

func (n *AlertNodeData) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*AlertNodeData) Sum added in v1.4.0

func (n *AlertNodeData) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*AlertNodeData) SwarmAutoscale added in v1.4.0

func (n *AlertNodeData) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*AlertNodeData) Talk added in v1.4.0

func (n *AlertNodeData) Talk() *TalkHandler

Send the alert to Talk. To use Talk alerting you must first follow the steps to create a new incoming webhook.

  1. Go to the URL https:/account.jianliao.com/signin.
  2. Sign in with you account. under the Team tab, click "Integrations".
  3. Select "Customize service", click incoming Webhook "Add" button.
  4. After choose the topic to connect with "xxx", click "Confirm Add" button.
  5. Once the service is created, you'll see the "Generate Webhook url".

Place the 'Generate Webhook url' into the 'Talk' section of the Kapacitor configuration as the option 'url'.

Example:

[talk]
  enabled = true
  url = "https://jianliao.com/v2/services/webhook/uuid"
  author_name = "Kapacitor"

Example:

stream
     |alert()
         .talk()

Send alerts to Talk client.

tick:property

func (*AlertNodeData) Tcp added in v1.4.0

func (n *AlertNodeData) Tcp(address string) *TcpHandler

Send JSON alert data to a specified address over TCP. tick:property

func (*AlertNodeData) Teams added in v1.5.6

func (n *AlertNodeData) Teams() *TeamsHandler

Send the alert to a Microsoft Teams channel. To allow Kapacitor to post to Teams, to to the URL https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/connectors#setting-up-a-custom-incoming-webhook and follow instructions to create a webhook for a Teams channel. Add the webhook URL to the configuration.

Example:

[teams]
  enabled = true
  channel-url = "https://outlook.office.com/webhook/..."

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are posted to the room.

Example:

stream
     |alert()
         .teams()

Send alerts to Teams channel in the configuration file.

Example:

stream
     |alert()
         .teams()
         .channelURL('https://outlook.office.com/webhook/...')

Send alerts to Teams channel with webhook (overrides configuration file).

If the 'teams' section in the configuration has the option: global = true then all alerts are sent to Teams without the need to explicitly state it in the TICKscript.

Example:

[teams]
  enabled = true
  channel-url = "https://outlook.office.com/webhook/..."
  global = true
  state-changes-only = true

Example:

stream
     |alert()

Send alert to Teams using default channel. tick:property

func (*AlertNodeData) Telegram added in v1.4.0

func (n *AlertNodeData) Telegram() *TelegramHandler

Send the alert to Telegram. For step-by-step instructions on setting up Kapacitor with Telegram, see the [Event Handler Setup Guide](https://docs.influxdata.com//kapacitor/latest/guides/event-handler-setup/#telegram-setup). To allow Kapacitor to post to Telegram,

Example:

   [telegram]
     enabled = true
     token = "123456789:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
     chat-id = "xxxxxxxxx"
     parse-mode = "Markdown"
	disable-web-page-preview = true
	disable-notification = false

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are posted to the chat-id.

Example:

stream
     |alert()
         .telegram()

Send alerts to Telegram chat-id in the configuration file.

Example:

stream
     |alert()
         .telegram()
         .chatId('xxxxxxx')

Send alerts to Telegram user/group 'xxxxxx'

If the 'telegram' section in the configuration has the option: global = true then all alerts are sent to Telegram without the need to explicitly state it in the TICKscript.

Example:

[telegram]
  enabled = true
  token = "123456789:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  chat-id = "xxxxxxxxx"
  global = true
  state-changes-only = true

Example:

stream
     |alert()

Send alert to Telegram using default chat-id 'xxxxxxxx'. tick:property

func (*AlertNodeData) Top added in v1.4.0

func (n *AlertNodeData) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*AlertNodeData) Trickle added in v1.6.0

func (n *AlertNodeData) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*AlertNodeData) Union added in v1.4.0

func (n *AlertNodeData) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*AlertNodeData) VictorOps added in v1.4.0

func (n *AlertNodeData) VictorOps() *VictorOpsHandler

Send alert to VictorOps. To use VictorOps alerting you must first enable the 'Alert Ingestion API' in the 'Integrations' section of VictorOps. Then place the API key from the URL into the 'victorops' section of the Kapacitor configuration.

Example:

[victorops]
  enabled = true
  api-key = "xxxxx"
  routing-key = "everyone"

With the correct configuration you can now use VictorOps in TICKscripts.

Example:

stream
     |alert()
         .victorOps()

Send alerts to VictorOps using the routing key in the configuration file.

Example:

stream
     |alert()
         .victorOps()
         .routingKey('team_rocket')

Send alerts to VictorOps with routing key 'team_rocket'

If the 'victorops' section in the configuration has the option: global = true then all alerts are sent to VictorOps without the need to explicitly state it in the TICKscript.

Example:

[victorops]
  enabled = true
  api-key = "xxxxx"
  routing-key = "everyone"
  global = true

Example:

stream
     |alert()

Send alert to VictorOps using the default routing key, found in the configuration. tick:property

func (*AlertNodeData) Where added in v1.4.0

func (n *AlertNodeData) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*AlertNodeData) Window added in v1.4.0

func (n *AlertNodeData) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

func (*AlertNodeData) Zenoss added in v1.6.0

func (n *AlertNodeData) Zenoss() *ZenossHandler

Send the alert to Zenoss.

Example:

[zenoss]
  enabled = true
  url = "https://tenant.zenoss.io:8080/zport/dmd/evconsole_router"

In order to not post a message every alert interval use AlertNode.StateChangesOnly so that only events where the alert changed state are posted.

Example:

stream
     |alert()
         .zenoss()
             .summary('Alert {{ .ID }}')
             .message('{{ .Message }}')
             .eventClass('/App')

If the 'zenoss' section in the configuration has the option: global = true then all alerts are sent to Zenoss without the need to explicitly state it in the TICKscript.

Example:

[zenoss]
  enabled = true
  url = "https://tenant.zenoss.io:8080/zport/dmd/evconsole_router"
  global = true
  state-changes-only = true

Example:

stream
     |alert()
         .zenoss()
             .summary('Alert {{ .ID }}')
             .message('{{ .Message }}')
             .eventClass('/App')

Send alert to Zenoss using default url. tick:property

type AlertaHandler added in v0.10.0

type AlertaHandler struct {
	*AlertNodeData `json:"-"`

	// Alerta authentication token.
	// If empty uses the token from the configuration.
	Token string `json:"token"`

	// Alerta resource.
	// Can be a template and has access to the same data as the AlertNode.Details property.
	// Default: {{ .Name }}
	Resource string `json:"resource"`

	// Alerta event.
	// Can be a template and has access to the same data as the idInfo property.
	// Default: {{ .ID }}
	Event string `json:"event"`

	// Alerta environment.
	// Can be a template and has access to the same data as the AlertNode.Details property.
	// Defaut is set from the configuration.
	Environment string `json:"environment"`

	// Alerta group.
	// Can be a template and has access to the same data as the AlertNode.Details property.
	// Default: {{ .Group }}
	Group string `json:"group"`

	// Alerta value.
	// Can be a template and has access to the same data as the AlertNode.Details property.
	// Default is an empty string.
	Value string `json:"value"`

	// Alerta origin.
	// If empty uses the origin from the configuration.
	Origin string `json:"origin"`

	// List of effected Services
	// tick:ignore
	Service []string `tick:"Services" json:"service"`

	// List of Correlated
	Correlate []string `tick:"Correlated" json:"correlate"`

	// Map of alert Attributes
	Attributes map[string]interface{} `tick:"Attribute" json:"attributes"`

	// Alerta timeout.
	// Default: 24h
	Timeout time.Duration `json:"timeout"`
}

tick:embedded:AlertNode.Alerta

func (AlertaHandler) Alert added in v0.13.0

func (n AlertaHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*AlertaHandler) Attribute added in v1.6.3

func (a *AlertaHandler) Attribute(k string, v interface{}) *AlertaHandler

func (AlertaHandler) Barrier added in v1.4.0

func (n AlertaHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (AlertaHandler) Bottom added in v0.13.0

func (n AlertaHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (AlertaHandler) ChangeDetect added in v1.5.0

func (n AlertaHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (AlertaHandler) Combine added in v1.0.0

func (n AlertaHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*AlertaHandler) Correlated added in v1.5.8

func (a *AlertaHandler) Correlated(correlate ...string) *AlertaHandler

func (AlertaHandler) Count added in v0.13.0

func (n AlertaHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (AlertaHandler) CumulativeSum added in v1.1.0

func (n AlertaHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (AlertaHandler) Default added in v0.13.0

func (n AlertaHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (AlertaHandler) Delete added in v1.0.0

func (n AlertaHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (AlertaHandler) Derivative added in v0.13.0

func (n AlertaHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (AlertaHandler) Difference added in v1.0.0

func (n AlertaHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (AlertaHandler) Distinct added in v0.13.0

func (n AlertaHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (AlertaHandler) Ec2Autoscale added in v1.4.0

func (n AlertaHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (AlertaHandler) Elapsed added in v0.13.0

func (n AlertaHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (AlertaHandler) Eval added in v0.13.0

func (n AlertaHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (AlertaHandler) First added in v0.13.0

func (n AlertaHandler) First(field string) *InfluxQLNode

Select the first point.

func (AlertaHandler) Flatten added in v1.0.0

func (n AlertaHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (AlertaHandler) GroupBy added in v0.13.0

func (n AlertaHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (AlertaHandler) HoltWinters added in v1.0.0

func (n AlertaHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (AlertaHandler) HoltWintersWithFit added in v1.0.0

func (n AlertaHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (AlertaHandler) HttpOut added in v0.13.0

func (n AlertaHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (AlertaHandler) HttpPost added in v1.3.0

func (n AlertaHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (AlertaHandler) InfluxDBOut added in v0.13.0

func (n AlertaHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (AlertaHandler) Join added in v0.13.0

func (n AlertaHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (AlertaHandler) K8sAutoscale added in v1.1.0

func (n AlertaHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (AlertaHandler) KapacitorLoopback added in v1.3.0

func (n AlertaHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (AlertaHandler) Last added in v0.13.0

func (n AlertaHandler) Last(field string) *InfluxQLNode

Select the last point.

func (AlertaHandler) Max added in v0.13.0

func (n AlertaHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (AlertaHandler) Mean added in v0.13.0

func (n AlertaHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (AlertaHandler) Median added in v0.13.0

func (n AlertaHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (AlertaHandler) Min added in v0.13.0

func (n AlertaHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (AlertaHandler) Mode added in v1.0.0

func (n AlertaHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (AlertaHandler) MovingAverage added in v1.0.0

func (n AlertaHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (AlertaHandler) Percentile added in v0.13.0

func (n AlertaHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (AlertaHandler) Sample added in v0.13.0

func (n AlertaHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*AlertaHandler) Services added in v0.11.0

func (a *AlertaHandler) Services(service ...string) *AlertaHandler

List of effected services. If not specified defaults to the Name of the stream. tick:property

func (AlertaHandler) Shift added in v0.13.0

func (n AlertaHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (AlertaHandler) Sideload added in v1.4.0

func (n AlertaHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (AlertaHandler) Spread added in v0.13.0

func (n AlertaHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (AlertaHandler) StateCount added in v1.3.0

func (n AlertaHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (AlertaHandler) StateDuration added in v1.3.0

func (n AlertaHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (AlertaHandler) Stddev added in v0.13.0

func (n AlertaHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (AlertaHandler) Sum added in v0.13.0

func (n AlertaHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (AlertaHandler) SwarmAutoscale added in v1.4.0

func (n AlertaHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (AlertaHandler) Top added in v0.13.0

func (n AlertaHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (AlertaHandler) Trickle added in v1.6.0

func (n AlertaHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (AlertaHandler) Union added in v0.13.0

func (n AlertaHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (AlertaHandler) Where added in v0.13.0

func (n AlertaHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (AlertaHandler) Window added in v0.13.0

func (n AlertaHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type BarrierNode added in v1.4.0

type BarrierNode struct {

	// Emit barrier based on idle time since the last received message.
	// Must be greater than zero.
	Idle time.Duration `json:"idle"`

	// Emit barrier based on periodic timer.  The timer is based on system
	// clock rather than message time.
	// Must be greater than zero.
	Period time.Duration `json:"period"`

	// Delete indicates that the group should be deleted after processing each barrier.
	// This includes the barrier node itself, meaning that if delete is true then the barrier will be triggered
	// only once for each group and then the barrier node will forget about that group.
	// The group will be created again if a new point is received for that group.
	// This is useful if you have increasing cardinality over time as once a barrier is triggered for a group it is then deleted,
	// freeing any resources managing the group.
	Delete bool `json:"delete,omitempty"`
	// contains filtered or unexported fields
}

A BarrierNode will emit a barrier with the current time, according to the system clock. Since the BarrierNode emits based on system time, it allows pipelines to be forced in the absence of data traffic. The barrier emitted will be based on either idle time since the last received message or on a periodic timer based on the system clock. Any messages received after an emitted barrier that is older than the last emitted barrier will be dropped.

Example:

stream
    |barrier().idle(5s)
    |window()
        .period(10s)
        .every(5s)
    |top(10, 'value')
    //Post the top 10 results over the last 10s updated every 5s.
    |httpPost('http://example.com/api/top10')

func (*BarrierNode) Alert added in v1.4.0

func (n *BarrierNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*BarrierNode) Barrier added in v1.4.0

func (n *BarrierNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*BarrierNode) Bottom added in v1.4.0

func (n *BarrierNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*BarrierNode) ChainMethods added in v1.5.2

func (n *BarrierNode) ChainMethods() map[string]reflect.Value

func (*BarrierNode) ChangeDetect added in v1.5.0

func (n *BarrierNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*BarrierNode) Combine added in v1.4.0

func (n *BarrierNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*BarrierNode) Count added in v1.4.0

func (n *BarrierNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*BarrierNode) CumulativeSum added in v1.4.0

func (n *BarrierNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*BarrierNode) Default added in v1.4.0

func (n *BarrierNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*BarrierNode) Delete added in v1.4.0

func (n *BarrierNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*BarrierNode) Derivative added in v1.4.0

func (n *BarrierNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*BarrierNode) Difference added in v1.4.0

func (n *BarrierNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*BarrierNode) Distinct added in v1.4.0

func (n *BarrierNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*BarrierNode) Ec2Autoscale added in v1.4.0

func (n *BarrierNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*BarrierNode) Elapsed added in v1.4.0

func (n *BarrierNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*BarrierNode) Eval added in v1.4.0

func (n *BarrierNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*BarrierNode) First added in v1.4.0

func (n *BarrierNode) First(field string) *InfluxQLNode

Select the first point.

func (*BarrierNode) Flatten added in v1.4.0

func (n *BarrierNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*BarrierNode) GroupBy added in v1.4.0

func (n *BarrierNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*BarrierNode) HoltWinters added in v1.4.0

func (n *BarrierNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*BarrierNode) HoltWintersWithFit added in v1.4.0

func (n *BarrierNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*BarrierNode) HttpOut added in v1.4.0

func (n *BarrierNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*BarrierNode) HttpPost added in v1.4.0

func (n *BarrierNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*BarrierNode) InfluxDBOut added in v1.4.0

func (n *BarrierNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*BarrierNode) Join added in v1.4.0

func (n *BarrierNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*BarrierNode) K8sAutoscale added in v1.4.0

func (n *BarrierNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*BarrierNode) KapacitorLoopback added in v1.4.0

func (n *BarrierNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*BarrierNode) Last added in v1.4.0

func (n *BarrierNode) Last(field string) *InfluxQLNode

Select the last point.

func (*BarrierNode) Log added in v1.4.0

func (n *BarrierNode) Log() *LogNode

Create a node that logs all data it receives.

func (*BarrierNode) MarshalJSON added in v1.4.0

func (n *BarrierNode) MarshalJSON() ([]byte, error)

MarshalJSON converts BarrierNode to JSON tick:ignore

func (*BarrierNode) Max added in v1.4.0

func (n *BarrierNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*BarrierNode) Mean added in v1.4.0

func (n *BarrierNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*BarrierNode) Median added in v1.4.0

func (n *BarrierNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*BarrierNode) Min added in v1.4.0

func (n *BarrierNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*BarrierNode) Mode added in v1.4.0

func (n *BarrierNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*BarrierNode) MovingAverage added in v1.4.0

func (n *BarrierNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*BarrierNode) Percentile added in v1.4.0

func (n *BarrierNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*BarrierNode) Sample added in v1.4.0

func (n *BarrierNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*BarrierNode) Shift added in v1.4.0

func (n *BarrierNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*BarrierNode) Sideload added in v1.4.0

func (n *BarrierNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*BarrierNode) Spread added in v1.4.0

func (n *BarrierNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*BarrierNode) StateCount added in v1.4.0

func (n *BarrierNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*BarrierNode) StateDuration added in v1.4.0

func (n *BarrierNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*BarrierNode) Stddev added in v1.4.0

func (n *BarrierNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*BarrierNode) Sum added in v1.4.0

func (n *BarrierNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*BarrierNode) SwarmAutoscale added in v1.4.0

func (n *BarrierNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*BarrierNode) Top added in v1.4.0

func (n *BarrierNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*BarrierNode) Trickle added in v1.6.0

func (n *BarrierNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*BarrierNode) Union added in v1.4.0

func (n *BarrierNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*BarrierNode) UnmarshalJSON added in v1.4.0

func (n *BarrierNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an BarrierNode tick:ignore

func (*BarrierNode) Where added in v1.4.0

func (n *BarrierNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*BarrierNode) Window added in v1.4.0

func (n *BarrierNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type BatchNode

type BatchNode struct {
	// contains filtered or unexported fields
}

func (*BatchNode) Children added in v0.13.0

func (n *BatchNode) Children() []Node

tick:ignore

func (*BatchNode) Deadman added in v0.13.0

func (n *BatchNode) Deadman(threshold float64, interval time.Duration, expr ...*ast.LambdaNode) *AlertNode

Helper function for creating an alert on low throughput, a.k.a. deadman's switch.

- Threshold -- trigger alert if throughput drops below threshold in points/interval. - Interval -- how often to check the throughput. - Expressions -- optional list of expressions to also evaluate. Useful for time of day alerting.

Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
//Do normal processing of data
data...

The above is equivalent to this Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |stats(10s)
        .align()
    |derivative('emitted')
        .unit(10s)
        .nonNegative()
    |alert()
        .id('node \'stream0\' in task \'{{ .TaskName }}\'')
        .message('{{ .ID }} is {{ if eq .Level "OK" }}alive{{ else }}dead{{ end }}: {{ index .Fields "emitted" | printf "%0.3f" }} points/10s.')
        .crit(lambda: "emitted" <= 100.0)
//Do normal processing of data
data...

The `id` and `message` alert properties can be configured globally via the 'deadman' configuration section.

Since the AlertNode is the last piece it can be further modified as usual. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
        .slack()
        .channel('#dead_tasks')
//Do normal processing of data
data...

You can specify additional lambda expressions to further constrain when the deadman's switch is triggered. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
// Only trigger the alert if the time of day is between 8am-5pm.
data
    |deadman(100.0, 10s, lambda: hour("time") >= 8 AND hour("time") <= 17)
//Do normal processing of data
data...

func (*BatchNode) Desc added in v0.12.0

func (n *BatchNode) Desc() string

tick:ignore

func (*BatchNode) ID added in v0.13.0

func (n *BatchNode) ID() ID

tick:ignore

func (*BatchNode) IsQuiet added in v1.5.0

func (n *BatchNode) IsQuiet() bool

tick:ignore

func (*BatchNode) MarshalJSON added in v1.4.0

func (n *BatchNode) MarshalJSON() ([]byte, error)

MarshalJSON converts BatchNode to JSON tick:ignore

func (*BatchNode) Name added in v0.13.0

func (n *BatchNode) Name() string

tick:ignore

func (*BatchNode) Parents added in v0.13.0

func (n *BatchNode) Parents() []Node

tick:ignore

func (*BatchNode) Provides added in v0.13.0

func (n *BatchNode) Provides() EdgeType

tick:ignore

func (*BatchNode) Query added in v0.13.0

func (b *BatchNode) Query(q string) *QueryNode

The query to execute. Must not contain a time condition in the `WHERE` clause or contain a `GROUP BY` clause. The time conditions are added dynamically according to the period, offset and schedule. The `GROUP BY` clause is added dynamically according to the dimensions passed to the `groupBy` method.

func (*BatchNode) QueryFlux added in v1.6.0

func (b *BatchNode) QueryFlux(q string) *QueryFluxNode

The flux script to execute.

func (*BatchNode) Quiet added in v1.5.0

func (n *BatchNode) Quiet()

Quiet suppresses all error logging events from this node. tick:property

func (*BatchNode) SetName added in v0.13.0

func (n *BatchNode) SetName(name string)

tick:ignore

func (*BatchNode) Stats added in v0.13.0

func (n *BatchNode) Stats(interval time.Duration) *StatsNode

Create a new stream of data that contains the internal statistics of the node. The interval represents how often to emit the statistics based on real time. This means the interval time is independent of the times of the data points the source node is receiving.

func (*BatchNode) UnmarshalJSON added in v1.4.0

func (n *BatchNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an BatchNode tick:ignore

func (*BatchNode) Wants added in v0.13.0

func (n *BatchNode) Wants() EdgeType

tick:ignore

type BigPandaHandler added in v1.5.8

type BigPandaHandler struct {
	*AlertNodeData `json:"-"`
	// Application key
	// If empty uses the default config
	AppKey string `json:"app-key"`

	// Object that caused the alert
	Host string `json:"host"`

	// Custom primary BigPanda property
	PrimaryProperty string `json:"primary-property"`

	// Custom secondary BigPanda property
	SecondaryProperty string `json:"secondary-property"`

	// Additional attributes
	// tick:ignore
	Attributes map[string]interface{} `tick:"Attribute" json:"attributes"`
}

tick:embedded:AlertNode.BigPanda

func (BigPandaHandler) Alert added in v1.5.8

func (n BigPandaHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*BigPandaHandler) Attribute added in v1.6.3

func (bp *BigPandaHandler) Attribute(key string, value interface{}) *BigPandaHandler

Attribute adds additional attributes to the request. tick:property

func (BigPandaHandler) Barrier added in v1.5.8

func (n BigPandaHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (BigPandaHandler) Bottom added in v1.5.8

func (n BigPandaHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (BigPandaHandler) ChangeDetect added in v1.5.8

func (n BigPandaHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (BigPandaHandler) Combine added in v1.5.8

func (n BigPandaHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (BigPandaHandler) Count added in v1.5.8

func (n BigPandaHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (BigPandaHandler) CumulativeSum added in v1.5.8

func (n BigPandaHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (BigPandaHandler) Default added in v1.5.8

func (n BigPandaHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (BigPandaHandler) Delete added in v1.5.8

func (n BigPandaHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (BigPandaHandler) Derivative added in v1.5.8

func (n BigPandaHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (BigPandaHandler) Difference added in v1.5.8

func (n BigPandaHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (BigPandaHandler) Distinct added in v1.5.8

func (n BigPandaHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (BigPandaHandler) Ec2Autoscale added in v1.5.8

func (n BigPandaHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (BigPandaHandler) Elapsed added in v1.5.8

func (n BigPandaHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (BigPandaHandler) Eval added in v1.5.8

func (n BigPandaHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (BigPandaHandler) First added in v1.5.8

func (n BigPandaHandler) First(field string) *InfluxQLNode

Select the first point.

func (BigPandaHandler) Flatten added in v1.5.8

func (n BigPandaHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (BigPandaHandler) GroupBy added in v1.5.8

func (n BigPandaHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (BigPandaHandler) HoltWinters added in v1.5.8

func (n BigPandaHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (BigPandaHandler) HoltWintersWithFit added in v1.5.8

func (n BigPandaHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (BigPandaHandler) HttpOut added in v1.5.8

func (n BigPandaHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (BigPandaHandler) HttpPost added in v1.5.8

func (n BigPandaHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (BigPandaHandler) InfluxDBOut added in v1.5.8

func (n BigPandaHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (BigPandaHandler) Join added in v1.5.8

func (n BigPandaHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (BigPandaHandler) K8sAutoscale added in v1.5.8

func (n BigPandaHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (BigPandaHandler) KapacitorLoopback added in v1.5.8

func (n BigPandaHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (BigPandaHandler) Last added in v1.5.8

func (n BigPandaHandler) Last(field string) *InfluxQLNode

Select the last point.

func (BigPandaHandler) Max added in v1.5.8

func (n BigPandaHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (BigPandaHandler) Mean added in v1.5.8

func (n BigPandaHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (BigPandaHandler) Median added in v1.5.8

func (n BigPandaHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (BigPandaHandler) Min added in v1.5.8

func (n BigPandaHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (BigPandaHandler) Mode added in v1.5.8

func (n BigPandaHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (BigPandaHandler) MovingAverage added in v1.5.8

func (n BigPandaHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (BigPandaHandler) Percentile added in v1.5.8

func (n BigPandaHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (BigPandaHandler) Sample added in v1.5.8

func (n BigPandaHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (BigPandaHandler) Shift added in v1.5.8

func (n BigPandaHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (BigPandaHandler) Sideload added in v1.5.8

func (n BigPandaHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (BigPandaHandler) Spread added in v1.5.8

func (n BigPandaHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (BigPandaHandler) StateCount added in v1.5.8

func (n BigPandaHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (BigPandaHandler) StateDuration added in v1.5.8

func (n BigPandaHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (BigPandaHandler) Stddev added in v1.5.8

func (n BigPandaHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (BigPandaHandler) Sum added in v1.5.8

func (n BigPandaHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (BigPandaHandler) SwarmAutoscale added in v1.5.8

func (n BigPandaHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (BigPandaHandler) Top added in v1.5.8

func (n BigPandaHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (BigPandaHandler) Trickle added in v1.6.0

func (n BigPandaHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (BigPandaHandler) Union added in v1.5.8

func (n BigPandaHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (BigPandaHandler) Where added in v1.5.8

func (n BigPandaHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (BigPandaHandler) Window added in v1.5.8

func (n BigPandaHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type ChangeDetectNode added in v1.5.0

type ChangeDetectNode struct {

	// The field to use when calculating the changeDetect
	// tick:ignore
	Fields []string `json:"fields"`
	// contains filtered or unexported fields
}

Compute the changeDetect of a stream or batch. The changeDetect is computed on a single field, discarding consecutive duplicate values, detecting detects the points at which the series field changes from one value to another.

Example:

stream
    |from()
        .measurement('packets')
    |changeDetect('value')
    ...

with source data: packets value="bad" 0000000000 packets value="good" 0000000001 packets value="bad" 0000000002 packets value="bad" 0000000003 packets value="bad" 0000000004 packets value="good" 0000000005

Would have output: packets value="bad" 0000000000 packets value="good" 0000000001 packets value="bad" 0000000002 packets value="good" 0000000005

Where the data are unchanged, but only the points where the value changes from the previous value are emitted.

It is also possible to provide a list of many fields and if any field changes the point will be emitted.

Example:

stream
    |from()
        .measurement('packets')
    |changeDetect('in','out')
    ...

with source data: packets in=0,out=0 0000000000 packets in=1,out=0 0000000001 packets in=1,out=1 0000000002 packets in=1,out=1 0000000003 packets in=2,out=1 0000000004 packets in=2,out=1 0000000005

Would have output: packets in=0,out=0 0000000000 packets in=1,out=0 0000000001 packets in=1,out=1 0000000002 packets in=2,out=1 0000000004

func (*ChangeDetectNode) Alert added in v1.5.0

func (n *ChangeDetectNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*ChangeDetectNode) Barrier added in v1.5.0

func (n *ChangeDetectNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*ChangeDetectNode) Bottom added in v1.5.0

func (n *ChangeDetectNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*ChangeDetectNode) ChangeDetect added in v1.5.0

func (n *ChangeDetectNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*ChangeDetectNode) Combine added in v1.5.0

func (n *ChangeDetectNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*ChangeDetectNode) Count added in v1.5.0

func (n *ChangeDetectNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*ChangeDetectNode) CumulativeSum added in v1.5.0

func (n *ChangeDetectNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*ChangeDetectNode) Default added in v1.5.0

func (n *ChangeDetectNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*ChangeDetectNode) Delete added in v1.5.0

func (n *ChangeDetectNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*ChangeDetectNode) Derivative added in v1.5.0

func (n *ChangeDetectNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*ChangeDetectNode) Difference added in v1.5.0

func (n *ChangeDetectNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*ChangeDetectNode) Distinct added in v1.5.0

func (n *ChangeDetectNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*ChangeDetectNode) Ec2Autoscale added in v1.5.0

func (n *ChangeDetectNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*ChangeDetectNode) Elapsed added in v1.5.0

func (n *ChangeDetectNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*ChangeDetectNode) Eval added in v1.5.0

func (n *ChangeDetectNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*ChangeDetectNode) First added in v1.5.0

func (n *ChangeDetectNode) First(field string) *InfluxQLNode

Select the first point.

func (*ChangeDetectNode) Flatten added in v1.5.0

func (n *ChangeDetectNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*ChangeDetectNode) GroupBy added in v1.5.0

func (n *ChangeDetectNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*ChangeDetectNode) HoltWinters added in v1.5.0

func (n *ChangeDetectNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*ChangeDetectNode) HoltWintersWithFit added in v1.5.0

func (n *ChangeDetectNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*ChangeDetectNode) HttpOut added in v1.5.0

func (n *ChangeDetectNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*ChangeDetectNode) HttpPost added in v1.5.0

func (n *ChangeDetectNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*ChangeDetectNode) InfluxDBOut added in v1.5.0

func (n *ChangeDetectNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*ChangeDetectNode) Join added in v1.5.0

func (n *ChangeDetectNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*ChangeDetectNode) K8sAutoscale added in v1.5.0

func (n *ChangeDetectNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*ChangeDetectNode) KapacitorLoopback added in v1.5.0

func (n *ChangeDetectNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*ChangeDetectNode) Last added in v1.5.0

func (n *ChangeDetectNode) Last(field string) *InfluxQLNode

Select the last point.

func (*ChangeDetectNode) Log added in v1.5.0

func (n *ChangeDetectNode) Log() *LogNode

Create a node that logs all data it receives.

func (*ChangeDetectNode) MarshalJSON added in v1.5.0

func (n *ChangeDetectNode) MarshalJSON() ([]byte, error)

MarshalJSON converts ChangeDetectNode to JSON tick:ignore

func (*ChangeDetectNode) Max added in v1.5.0

func (n *ChangeDetectNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*ChangeDetectNode) Mean added in v1.5.0

func (n *ChangeDetectNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*ChangeDetectNode) Median added in v1.5.0

func (n *ChangeDetectNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*ChangeDetectNode) Min added in v1.5.0

func (n *ChangeDetectNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*ChangeDetectNode) Mode added in v1.5.0

func (n *ChangeDetectNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*ChangeDetectNode) MovingAverage added in v1.5.0

func (n *ChangeDetectNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*ChangeDetectNode) Percentile added in v1.5.0

func (n *ChangeDetectNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*ChangeDetectNode) Sample added in v1.5.0

func (n *ChangeDetectNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*ChangeDetectNode) Shift added in v1.5.0

func (n *ChangeDetectNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*ChangeDetectNode) Sideload added in v1.5.0

func (n *ChangeDetectNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*ChangeDetectNode) Spread added in v1.5.0

func (n *ChangeDetectNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*ChangeDetectNode) StateCount added in v1.5.0

func (n *ChangeDetectNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*ChangeDetectNode) StateDuration added in v1.5.0

func (n *ChangeDetectNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*ChangeDetectNode) Stddev added in v1.5.0

func (n *ChangeDetectNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*ChangeDetectNode) Sum added in v1.5.0

func (n *ChangeDetectNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*ChangeDetectNode) SwarmAutoscale added in v1.5.0

func (n *ChangeDetectNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*ChangeDetectNode) Top added in v1.5.0

func (n *ChangeDetectNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*ChangeDetectNode) Trickle added in v1.6.0

func (n *ChangeDetectNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*ChangeDetectNode) Union added in v1.5.0

func (n *ChangeDetectNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*ChangeDetectNode) UnmarshalJSON added in v1.5.0

func (n *ChangeDetectNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an ChangeDetectNode tick:ignore

func (*ChangeDetectNode) Where added in v1.5.0

func (n *ChangeDetectNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*ChangeDetectNode) Window added in v1.5.0

func (n *ChangeDetectNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type CombineNode added in v1.0.0

type CombineNode struct {

	// The list of expressions for matching pairs
	// tick:ignore
	Lambdas []*ast.LambdaNode `json:"lambdas"`

	// The alias names of the two parents.
	// Note:
	//       Names[1] corresponds to the left  parent
	//       Names[0] corresponds to the right parent
	// tick:ignore
	Names []string `tick:"As" json:"as"`

	// The delimiter between the As names and existing field an tag keys.
	// Can be the empty string, but you are responsible for ensuring conflicts are not possible if you use the empty string.
	Delimiter string `json:"delimiter"`

	// The maximum duration of time that two incoming points
	// can be apart and still be considered to be equal in time.
	// The joined data point's time will be rounded to the nearest
	// multiple of the tolerance duration.
	Tolerance time.Duration `json:"-"`

	// Maximum number of possible combinations.
	// Since the number of possible combinations can grow very rapidly
	// you can set a maximum number of combinations allowed.
	// If the max is crossed, an error is logged and the combinations are not calculated.
	// Default: 10,000
	Max int64 `json:"max"`
	// contains filtered or unexported fields
}

Combine the data from a single node with itself. Points with the same time are grouped and then combinations are created. The size of the combinations is defined by how many expressions are given. Combinations are order independent and will not ever include the same point multiple times.

Example:

stream
    |from()
        .measurement('request_latency')
    |combine(lambda: "service" == 'login', lambda: TRUE)
        .as('login', 'other')
        // points that are within 1 second are considered the same time.
        .tolerance(1s)
        // delimiter for new field and tag names
        .delimiter('.')
    // Change group by to be new other.service tag
    |groupBy('other.service')
    // Both the "value" fields from each data point have been prefixed
    // with the respective names 'login' and 'other'.
    |eval(lambda: "login.value" / "other.value")
       .as('ratio')
    ...

In the above example the data points for the `login` service are combined with the data points from all other services.

Example:

|combine(lambda: TRUE, lambda: TRUE)
    .as('login', 'other')

In the above example all combination pairs are created.

Example:

|combine(lambda: TRUE, lambda: TRUE, lambda: TRUE)
    .as('login', 'other', 'another')

In the above example all combinations triples are created.

func (*CombineNode) Alert added in v1.0.0

func (n *CombineNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*CombineNode) As added in v1.0.0

func (n *CombineNode) As(names ...string) *CombineNode

Prefix names for all fields from the respective nodes. Each field from the parent nodes will be prefixed with the provided name and a '.'. See the example above.

The names cannot have a dot '.' character.

tick:property

func (*CombineNode) Barrier added in v1.4.0

func (n *CombineNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*CombineNode) Bottom added in v1.0.0

func (n *CombineNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*CombineNode) ChangeDetect added in v1.5.0

func (n *CombineNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*CombineNode) Combine added in v1.0.0

func (n *CombineNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*CombineNode) Count added in v1.0.0

func (n *CombineNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*CombineNode) CumulativeSum added in v1.1.0

func (n *CombineNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*CombineNode) Default added in v1.0.0

func (n *CombineNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*CombineNode) Delete added in v1.0.0

func (n *CombineNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*CombineNode) Derivative added in v1.0.0

func (n *CombineNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*CombineNode) Difference added in v1.0.0

func (n *CombineNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*CombineNode) Distinct added in v1.0.0

func (n *CombineNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*CombineNode) Ec2Autoscale added in v1.4.0

func (n *CombineNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*CombineNode) Elapsed added in v1.0.0

func (n *CombineNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*CombineNode) Eval added in v1.0.0

func (n *CombineNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*CombineNode) First added in v1.0.0

func (n *CombineNode) First(field string) *InfluxQLNode

Select the first point.

func (*CombineNode) Flatten added in v1.0.0

func (n *CombineNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*CombineNode) GroupBy added in v1.0.0

func (n *CombineNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*CombineNode) HoltWinters added in v1.0.0

func (n *CombineNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*CombineNode) HoltWintersWithFit added in v1.0.0

func (n *CombineNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*CombineNode) HttpOut added in v1.0.0

func (n *CombineNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*CombineNode) HttpPost added in v1.3.0

func (n *CombineNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*CombineNode) InfluxDBOut added in v1.0.0

func (n *CombineNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*CombineNode) Join added in v1.0.0

func (n *CombineNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*CombineNode) K8sAutoscale added in v1.1.0

func (n *CombineNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*CombineNode) KapacitorLoopback added in v1.3.0

func (n *CombineNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*CombineNode) Last added in v1.0.0

func (n *CombineNode) Last(field string) *InfluxQLNode

Select the last point.

func (*CombineNode) Log added in v1.0.0

func (n *CombineNode) Log() *LogNode

Create a node that logs all data it receives.

func (*CombineNode) MarshalJSON added in v1.4.0

func (n *CombineNode) MarshalJSON() ([]byte, error)

MarshalJSON converts CombineNode to JSON tick:ignore

func (*CombineNode) Max added in v1.0.0

func (n *CombineNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*CombineNode) Mean added in v1.0.0

func (n *CombineNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*CombineNode) Median added in v1.0.0

func (n *CombineNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*CombineNode) Min added in v1.0.0

func (n *CombineNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*CombineNode) Mode added in v1.0.0

func (n *CombineNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*CombineNode) MovingAverage added in v1.0.0

func (n *CombineNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*CombineNode) Percentile added in v1.0.0

func (n *CombineNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*CombineNode) Sample added in v1.0.0

func (n *CombineNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*CombineNode) Shift added in v1.0.0

func (n *CombineNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*CombineNode) Sideload added in v1.4.0

func (n *CombineNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*CombineNode) Spread added in v1.0.0

func (n *CombineNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*CombineNode) StateCount added in v1.3.0

func (n *CombineNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*CombineNode) StateDuration added in v1.3.0

func (n *CombineNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*CombineNode) Stddev added in v1.0.0

func (n *CombineNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*CombineNode) Sum added in v1.0.0

func (n *CombineNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*CombineNode) SwarmAutoscale added in v1.4.0

func (n *CombineNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*CombineNode) Top added in v1.0.0

func (n *CombineNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*CombineNode) Trickle added in v1.6.0

func (n *CombineNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*CombineNode) Union added in v1.0.0

func (n *CombineNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*CombineNode) UnmarshalJSON added in v1.4.0

func (n *CombineNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an CombineNode tick:ignore

func (*CombineNode) Where added in v1.0.0

func (n *CombineNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*CombineNode) Window added in v1.0.0

func (n *CombineNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type DeadmanService added in v0.10.0

type DeadmanService interface {
	Interval() time.Duration
	Threshold() float64
	Id() string
	Message() string
	Global() bool
}

Information relavant to configuring a deadman's swith

type DefaultNode added in v0.13.0

type DefaultNode struct {

	// Set of fields to default
	// tick:ignore
	Fields map[string]interface{} `tick:"Field" json:"fields"`

	// Set of tags to default
	// tick:ignore
	Tags map[string]string `tick:"Tag" json:"tags"`
	// contains filtered or unexported fields
}

Defaults fields and tags on data points.

Example:

stream
    |default()
        .field('value', 0.0)
        .tag('host', '')

The above example will set the field `value` to float64(0) if it does not already exist It will also set the tag `host` to string("") if it does not already exist.

Available Statistics:

  • fields_defaulted -- number of fields that were missing
  • tags_defaulted -- number of tags that were missing

func (*DefaultNode) Alert added in v0.13.0

func (n *DefaultNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*DefaultNode) Barrier added in v1.4.0

func (n *DefaultNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*DefaultNode) Bottom added in v0.13.0

func (n *DefaultNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*DefaultNode) ChangeDetect added in v1.5.0

func (n *DefaultNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*DefaultNode) Combine added in v1.0.0

func (n *DefaultNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*DefaultNode) Count added in v0.13.0

func (n *DefaultNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*DefaultNode) CumulativeSum added in v1.1.0

func (n *DefaultNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*DefaultNode) Default added in v0.13.0

func (n *DefaultNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*DefaultNode) Delete added in v1.0.0

func (n *DefaultNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*DefaultNode) Derivative added in v0.13.0

func (n *DefaultNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*DefaultNode) Difference added in v1.0.0

func (n *DefaultNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*DefaultNode) Distinct added in v0.13.0

func (n *DefaultNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*DefaultNode) Ec2Autoscale added in v1.4.0

func (n *DefaultNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*DefaultNode) Elapsed added in v0.13.0

func (n *DefaultNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*DefaultNode) Eval added in v0.13.0

func (n *DefaultNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*DefaultNode) Field added in v0.13.0

func (n *DefaultNode) Field(name string, value interface{}) *DefaultNode

Define a field default. tick:property

func (*DefaultNode) First added in v0.13.0

func (n *DefaultNode) First(field string) *InfluxQLNode

Select the first point.

func (*DefaultNode) Flatten added in v1.0.0

func (n *DefaultNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*DefaultNode) GroupBy added in v0.13.0

func (n *DefaultNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*DefaultNode) HoltWinters added in v1.0.0

func (n *DefaultNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*DefaultNode) HoltWintersWithFit added in v1.0.0

func (n *DefaultNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*DefaultNode) HttpOut added in v0.13.0

func (n *DefaultNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*DefaultNode) HttpPost added in v1.3.0

func (n *DefaultNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*DefaultNode) InfluxDBOut added in v0.13.0

func (n *DefaultNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*DefaultNode) Join added in v0.13.0

func (n *DefaultNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*DefaultNode) K8sAutoscale added in v1.1.0

func (n *DefaultNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*DefaultNode) KapacitorLoopback added in v1.3.0

func (n *DefaultNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*DefaultNode) Last added in v0.13.0

func (n *DefaultNode) Last(field string) *InfluxQLNode

Select the last point.

func (*DefaultNode) Log added in v0.13.0

func (n *DefaultNode) Log() *LogNode

Create a node that logs all data it receives.

func (*DefaultNode) MarshalJSON added in v1.4.0

func (n *DefaultNode) MarshalJSON() ([]byte, error)

MarshalJSON converts DefaultNode to JSON tick:ignore

func (*DefaultNode) Max added in v0.13.0

func (n *DefaultNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*DefaultNode) Mean added in v0.13.0

func (n *DefaultNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*DefaultNode) Median added in v0.13.0

func (n *DefaultNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*DefaultNode) Min added in v0.13.0

func (n *DefaultNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*DefaultNode) Mode added in v1.0.0

func (n *DefaultNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*DefaultNode) MovingAverage added in v1.0.0

func (n *DefaultNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*DefaultNode) Percentile added in v0.13.0

func (n *DefaultNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*DefaultNode) Sample added in v0.13.0

func (n *DefaultNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*DefaultNode) Shift added in v0.13.0

func (n *DefaultNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*DefaultNode) Sideload added in v1.4.0

func (n *DefaultNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*DefaultNode) Spread added in v0.13.0

func (n *DefaultNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*DefaultNode) StateCount added in v1.3.0

func (n *DefaultNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*DefaultNode) StateDuration added in v1.3.0

func (n *DefaultNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*DefaultNode) Stddev added in v0.13.0

func (n *DefaultNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*DefaultNode) Sum added in v0.13.0

func (n *DefaultNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*DefaultNode) SwarmAutoscale added in v1.4.0

func (n *DefaultNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*DefaultNode) Tag added in v0.13.0

func (n *DefaultNode) Tag(name string, value string) *DefaultNode

Define a tag default. tick:property

func (*DefaultNode) Top added in v0.13.0

func (n *DefaultNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*DefaultNode) Trickle added in v1.6.0

func (n *DefaultNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*DefaultNode) Union added in v0.13.0

func (n *DefaultNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*DefaultNode) UnmarshalJSON added in v1.4.0

func (n *DefaultNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an DefaultNode tick:ignore

func (*DefaultNode) Where added in v0.13.0

func (n *DefaultNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*DefaultNode) Window added in v0.13.0

func (n *DefaultNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type DeleteNode added in v1.0.0

type DeleteNode struct {

	// Set of fields to delete
	// tick:ignore
	Fields []string `tick:"Field" json:"fields"`

	// Set of tags to delete
	// tick:ignore
	Tags []string `tick:"Tag" json:"tags"`
	// contains filtered or unexported fields
}

Deletes fields and tags from data points.

Example:

stream
    |delete()
        .field('value')
        .tag('host')

The above example will remove the field `value` and the tag `host`, from each point.

Available Statistics:

  • fields_deleted -- number of fields that were deleted. Only counts if the field already existed.
  • tags_deleted -- number of tags that were deleted. Only counts if the tag already existed.

func (*DeleteNode) Alert added in v1.0.0

func (n *DeleteNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*DeleteNode) Barrier added in v1.4.0

func (n *DeleteNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*DeleteNode) Bottom added in v1.0.0

func (n *DeleteNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*DeleteNode) ChangeDetect added in v1.5.0

func (n *DeleteNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*DeleteNode) Combine added in v1.0.0

func (n *DeleteNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*DeleteNode) Count added in v1.0.0

func (n *DeleteNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*DeleteNode) CumulativeSum added in v1.1.0

func (n *DeleteNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*DeleteNode) Default added in v1.0.0

func (n *DeleteNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*DeleteNode) Delete added in v1.0.0

func (n *DeleteNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*DeleteNode) Derivative added in v1.0.0

func (n *DeleteNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*DeleteNode) Difference added in v1.0.0

func (n *DeleteNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*DeleteNode) Distinct added in v1.0.0

func (n *DeleteNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*DeleteNode) Ec2Autoscale added in v1.4.0

func (n *DeleteNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*DeleteNode) Elapsed added in v1.0.0

func (n *DeleteNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*DeleteNode) Eval added in v1.0.0

func (n *DeleteNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*DeleteNode) Field added in v1.0.0

func (n *DeleteNode) Field(name string) *DeleteNode

Delete a field. tick:property

func (*DeleteNode) First added in v1.0.0

func (n *DeleteNode) First(field string) *InfluxQLNode

Select the first point.

func (*DeleteNode) Flatten added in v1.0.0

func (n *DeleteNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*DeleteNode) GroupBy added in v1.0.0

func (n *DeleteNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*DeleteNode) HoltWinters added in v1.0.0

func (n *DeleteNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*DeleteNode) HoltWintersWithFit added in v1.0.0

func (n *DeleteNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*DeleteNode) HttpOut added in v1.0.0

func (n *DeleteNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*DeleteNode) HttpPost added in v1.3.0

func (n *DeleteNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*DeleteNode) InfluxDBOut added in v1.0.0

func (n *DeleteNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*DeleteNode) Join added in v1.0.0

func (n *DeleteNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*DeleteNode) K8sAutoscale added in v1.1.0

func (n *DeleteNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*DeleteNode) KapacitorLoopback added in v1.3.0

func (n *DeleteNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*DeleteNode) Last added in v1.0.0

func (n *DeleteNode) Last(field string) *InfluxQLNode

Select the last point.

func (*DeleteNode) Log added in v1.0.0

func (n *DeleteNode) Log() *LogNode

Create a node that logs all data it receives.

func (*DeleteNode) MarshalJSON added in v1.4.0

func (n *DeleteNode) MarshalJSON() ([]byte, error)

MarshalJSON converts DeleteNode to JSON tick:ignore

func (*DeleteNode) Max added in v1.0.0

func (n *DeleteNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*DeleteNode) Mean added in v1.0.0

func (n *DeleteNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*DeleteNode) Median added in v1.0.0

func (n *DeleteNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*DeleteNode) Min added in v1.0.0

func (n *DeleteNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*DeleteNode) Mode added in v1.0.0

func (n *DeleteNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*DeleteNode) MovingAverage added in v1.0.0

func (n *DeleteNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*DeleteNode) Percentile added in v1.0.0

func (n *DeleteNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*DeleteNode) Sample added in v1.0.0

func (n *DeleteNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*DeleteNode) Shift added in v1.0.0

func (n *DeleteNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*DeleteNode) Sideload added in v1.4.0

func (n *DeleteNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*DeleteNode) Spread added in v1.0.0

func (n *DeleteNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*DeleteNode) StateCount added in v1.3.0

func (n *DeleteNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*DeleteNode) StateDuration added in v1.3.0

func (n *DeleteNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*DeleteNode) Stddev added in v1.0.0

func (n *DeleteNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*DeleteNode) Sum added in v1.0.0

func (n *DeleteNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*DeleteNode) SwarmAutoscale added in v1.4.0

func (n *DeleteNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*DeleteNode) Tag added in v1.0.0

func (n *DeleteNode) Tag(name string) *DeleteNode

Delete a tag. tick:property

func (*DeleteNode) Top added in v1.0.0

func (n *DeleteNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*DeleteNode) Trickle added in v1.6.0

func (n *DeleteNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*DeleteNode) Union added in v1.0.0

func (n *DeleteNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*DeleteNode) UnmarshalJSON added in v1.4.0

func (n *DeleteNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an DeleteNode tick:ignore

func (*DeleteNode) Where added in v1.0.0

func (n *DeleteNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*DeleteNode) Window added in v1.0.0

func (n *DeleteNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type DerivativeNode

type DerivativeNode struct {

	// The field to use when calculating the derivative
	// tick:ignore
	Field string `json:"field"`

	// The new name of the derivative field.
	// Default is the name of the field used
	// when calculating the derivative.
	As string `json:"as"`

	// The time unit of the resulting derivative value.
	// Default: 1s
	Unit time.Duration `json:"unit"`

	// Where negative values are acceptable.
	// tick:ignore
	NonNegativeFlag bool `tick:"NonNegative" json:"nonNegative"`
	// contains filtered or unexported fields
}

Compute the derivative of a stream or batch. The derivative is computed on a single field and behaves similarly to the InfluxQL derivative function. Kapacitor has its own implementation of the derivative function, and, as a result, is not part of the normal InfluxQL functions.

Example:

stream
    |from()
        .measurement('net_rx_packets')
    |derivative('value')
       .unit(1s) // default
       .nonNegative()
    ...

Computes the derivative via:

(current - previous ) / ( time_difference / unit)

The derivative is computed for each point, and because of boundary conditions the first point is dropped.

func (*DerivativeNode) Alert

func (n *DerivativeNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*DerivativeNode) Barrier added in v1.4.0

func (n *DerivativeNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*DerivativeNode) Bottom added in v0.11.0

func (n *DerivativeNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*DerivativeNode) ChangeDetect added in v1.5.0

func (n *DerivativeNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*DerivativeNode) Combine added in v1.0.0

func (n *DerivativeNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*DerivativeNode) Count added in v0.11.0

func (n *DerivativeNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*DerivativeNode) CumulativeSum added in v1.1.0

func (n *DerivativeNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*DerivativeNode) Default added in v0.13.0

func (n *DerivativeNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*DerivativeNode) Delete added in v1.0.0

func (n *DerivativeNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*DerivativeNode) Derivative

func (n *DerivativeNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*DerivativeNode) Difference added in v1.0.0

func (n *DerivativeNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*DerivativeNode) Distinct added in v0.11.0

func (n *DerivativeNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*DerivativeNode) Ec2Autoscale added in v1.4.0

func (n *DerivativeNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*DerivativeNode) Elapsed added in v0.13.0

func (n *DerivativeNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*DerivativeNode) Eval

func (n *DerivativeNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*DerivativeNode) First added in v0.11.0

func (n *DerivativeNode) First(field string) *InfluxQLNode

Select the first point.

func (*DerivativeNode) Flatten added in v1.0.0

func (n *DerivativeNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*DerivativeNode) GroupBy

func (n *DerivativeNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*DerivativeNode) HoltWinters added in v1.0.0

func (n *DerivativeNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*DerivativeNode) HoltWintersWithFit added in v1.0.0

func (n *DerivativeNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*DerivativeNode) HttpOut

func (n *DerivativeNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*DerivativeNode) HttpPost added in v1.3.0

func (n *DerivativeNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*DerivativeNode) InfluxDBOut

func (n *DerivativeNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*DerivativeNode) Join

func (n *DerivativeNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*DerivativeNode) K8sAutoscale added in v1.1.0

func (n *DerivativeNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*DerivativeNode) KapacitorLoopback added in v1.3.0

func (n *DerivativeNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*DerivativeNode) Last added in v0.11.0

func (n *DerivativeNode) Last(field string) *InfluxQLNode

Select the last point.

func (*DerivativeNode) Log added in v0.11.0

func (n *DerivativeNode) Log() *LogNode

Create a node that logs all data it receives.

func (*DerivativeNode) MarshalJSON added in v1.4.0

func (n *DerivativeNode) MarshalJSON() ([]byte, error)

MarshalJSON converts DerivativeNode to JSON tick:ignore

func (*DerivativeNode) Max added in v0.11.0

func (n *DerivativeNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*DerivativeNode) Mean added in v0.11.0

func (n *DerivativeNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*DerivativeNode) Median added in v0.11.0

func (n *DerivativeNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*DerivativeNode) Min added in v0.11.0

func (n *DerivativeNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*DerivativeNode) Mode added in v1.0.0

func (n *DerivativeNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*DerivativeNode) MovingAverage added in v1.0.0

func (n *DerivativeNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*DerivativeNode) NonNegative

func (d *DerivativeNode) NonNegative() *DerivativeNode

If called the derivative will skip negative results. tick:property

func (*DerivativeNode) Percentile added in v0.11.0

func (n *DerivativeNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*DerivativeNode) Sample

func (n *DerivativeNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*DerivativeNode) Shift added in v0.11.0

func (n *DerivativeNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*DerivativeNode) Sideload added in v1.4.0

func (n *DerivativeNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*DerivativeNode) Spread added in v0.11.0

func (n *DerivativeNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*DerivativeNode) StateCount added in v1.3.0

func (n *DerivativeNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*DerivativeNode) StateDuration added in v1.3.0

func (n *DerivativeNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*DerivativeNode) Stddev added in v0.11.0

func (n *DerivativeNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*DerivativeNode) Sum added in v0.11.0

func (n *DerivativeNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*DerivativeNode) SwarmAutoscale added in v1.4.0

func (n *DerivativeNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*DerivativeNode) Top added in v0.11.0

func (n *DerivativeNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*DerivativeNode) Trickle added in v1.6.0

func (n *DerivativeNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*DerivativeNode) Union

func (n *DerivativeNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*DerivativeNode) UnmarshalJSON added in v1.4.0

func (n *DerivativeNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an DerivativeNode tick:ignore

func (*DerivativeNode) Where

func (n *DerivativeNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*DerivativeNode) Window

func (n *DerivativeNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type DiscordHandler added in v1.5.6

type DiscordHandler struct {
	*AlertNodeData `json:"-"`

	// Discord workspace ID to use when posting to webhook
	// If empty uses the default config
	Workspace string `json:"workspace"`
	// Username of webhook
	// If empty uses the default config
	Username string `json:"username"`
	// URL of webhook's avatar
	// If empty uses the default config
	AvatarURL string `json:"avatarUrl"`
	// Embed title
	// If empty uses the default config
	EmbedTitle string `json:"embedTitle"`
}

tick:embedded:AlertNode.Discord

func (DiscordHandler) Alert added in v1.5.6

func (n DiscordHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (DiscordHandler) Barrier added in v1.5.6

func (n DiscordHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (DiscordHandler) Bottom added in v1.5.6

func (n DiscordHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (DiscordHandler) ChangeDetect added in v1.5.6

func (n DiscordHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (DiscordHandler) Combine added in v1.5.6

func (n DiscordHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (DiscordHandler) Count added in v1.5.6

func (n DiscordHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (DiscordHandler) CumulativeSum added in v1.5.6

func (n DiscordHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (DiscordHandler) Default added in v1.5.6

func (n DiscordHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (DiscordHandler) Delete added in v1.5.6

func (n DiscordHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (DiscordHandler) Derivative added in v1.5.6

func (n DiscordHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (DiscordHandler) Difference added in v1.5.6

func (n DiscordHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (DiscordHandler) Distinct added in v1.5.6

func (n DiscordHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (DiscordHandler) Ec2Autoscale added in v1.5.6

func (n DiscordHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (DiscordHandler) Elapsed added in v1.5.6

func (n DiscordHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (DiscordHandler) Eval added in v1.5.6

func (n DiscordHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (DiscordHandler) First added in v1.5.6

func (n DiscordHandler) First(field string) *InfluxQLNode

Select the first point.

func (DiscordHandler) Flatten added in v1.5.6

func (n DiscordHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (DiscordHandler) GroupBy added in v1.5.6

func (n DiscordHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (DiscordHandler) HoltWinters added in v1.5.6

func (n DiscordHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (DiscordHandler) HoltWintersWithFit added in v1.5.6

func (n DiscordHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (DiscordHandler) HttpOut added in v1.5.6

func (n DiscordHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (DiscordHandler) HttpPost added in v1.5.6

func (n DiscordHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (DiscordHandler) InfluxDBOut added in v1.5.6

func (n DiscordHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (DiscordHandler) Join added in v1.5.6

func (n DiscordHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (DiscordHandler) K8sAutoscale added in v1.5.6

func (n DiscordHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (DiscordHandler) KapacitorLoopback added in v1.5.6

func (n DiscordHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (DiscordHandler) Last added in v1.5.6

func (n DiscordHandler) Last(field string) *InfluxQLNode

Select the last point.

func (DiscordHandler) Max added in v1.5.6

func (n DiscordHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (DiscordHandler) Mean added in v1.5.6

func (n DiscordHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (DiscordHandler) Median added in v1.5.6

func (n DiscordHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (DiscordHandler) Min added in v1.5.6

func (n DiscordHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (DiscordHandler) Mode added in v1.5.6

func (n DiscordHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (DiscordHandler) MovingAverage added in v1.5.6

func (n DiscordHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (DiscordHandler) Percentile added in v1.5.6

func (n DiscordHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (DiscordHandler) Sample added in v1.5.6

func (n DiscordHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (DiscordHandler) Shift added in v1.5.6

func (n DiscordHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (DiscordHandler) Sideload added in v1.5.6

func (n DiscordHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (DiscordHandler) Spread added in v1.5.6

func (n DiscordHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (DiscordHandler) StateCount added in v1.5.6

func (n DiscordHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (DiscordHandler) StateDuration added in v1.5.6

func (n DiscordHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (DiscordHandler) Stddev added in v1.5.6

func (n DiscordHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (DiscordHandler) Sum added in v1.5.6

func (n DiscordHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (DiscordHandler) SwarmAutoscale added in v1.5.6

func (n DiscordHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (DiscordHandler) Top added in v1.5.6

func (n DiscordHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (DiscordHandler) Trickle added in v1.6.0

func (n DiscordHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (DiscordHandler) Union added in v1.5.6

func (n DiscordHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (DiscordHandler) Where added in v1.5.6

func (n DiscordHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (DiscordHandler) Window added in v1.5.6

func (n DiscordHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type Ec2AutoscaleNode added in v1.4.0

type Ec2AutoscaleNode struct {

	// Cluster is the ID of ec2 autoscale group to use.
	// The ID of the cluster is specified in the kapacitor configuration.
	Cluster string

	// GroupName is the name of the autoscaling group to autoscale.
	GroupName string
	// GroupName is the name of a tag which contains the name of the autoscaling group to autoscale.
	GroupNameTag string
	// OutputGroupName is the name of a tag into which the group name will be written for output autoscale events.
	// Defaults to the value of GroupNameTag if its not empty.
	OutputGroupNameTag string

	// CurrentField is the name of a field into which the current replica count will be set as an int.
	// If empty no field will be set.
	// Useful for computing deltas on the current state.
	//
	// Example:
	//    |ec2Autoscale()
	//        .currentField('replicas')
	//        // Increase the replicas by 1 if the qps is over the threshold
	//        .replicas(lambda: if("qps" > threshold, "replicas" + 1, "replicas"))
	//
	CurrentField string

	// The maximum scale factor to set.
	// If 0 then there is no upper limit.
	// Default: 0, a.k.a no limit.
	Max int64

	// The minimum scale factor to set.
	// Default: 1
	Min int64

	// Replicas is a lambda expression that should evaluate to the desired number of replicas for the resource.
	Replicas *ast.LambdaNode

	// Only one increase event can be triggered per resource every IncreaseCooldown interval.
	IncreaseCooldown time.Duration
	// Only one decrease event can be triggered per resource every DecreaseCooldown interval.
	DecreaseCooldown time.Duration
	// contains filtered or unexported fields
}

EC2AutoscaleNode triggers autoscale events for a group on a AWS Autoscaling group. The node also outputs points for the triggered events.

Example:

// Target 80% cpu per ec2 instance
var target = 80.0
var min = 1
var max = 10
var period = 5m
var every = period
stream
    |from()
        .measurement('cpu')
        .groupBy('host_name','group_name')
        .where(lambda: "cpu" == 'cpu-total')
    |eval(lambda: 100.0 - "usage_idle")
        .as('usage_percent')
    |window()
        .period(period)
        .every(every)
    |mean('usage_percent')
        .as('mean_cpu')
    |groupBy('group_name')
    |sum('mean_cpu')
        .as('total_cpu')
    |ec2Autoscale()
        // Get the group name of the VM(EC2 instance) from "group_name" tag.
        .groupNameTag('group_name')
        .min(min)
        .max(max)
        // Set the desired number of replicas based on target.
        .replicas(lambda: int(ceil("total_cpu" / target)))
    |influxDBOut()
        .database('deployments')
        .measurement('scale_events')
        .precision('s')

The above example computes the mean of cpu usage_percent by host_name name and group_name Then sum of mean cpu_usage is calculated as total_cpu. Using the total_cpu over the last time period a desired number of replicas is computed based on the target percentage usage of cpu.

If the desired number of replicas has changed, Kapacitor makes the appropriate API call to AWS autoscaling group to update the replicas spec.

Any time the Ec2Autoscale node changes a replica count, it emits a point. The point is tagged with the group name, using the groupName respectively In addition the group by tags will be preserved on the emitted point. The point contains two fields: `old`, and `new` representing change in the replicas.

Available Statistics:

  • increase_events -- number of times the replica count was increased.
  • decrease_events -- number of times the replica count was decreased.
  • cooldown_drops -- number of times an event was dropped because of a cooldown timer.
  • errors -- number of errors encountered, typically related to communicating with the AWS autoscaling API.

func (*Ec2AutoscaleNode) Alert added in v1.4.0

func (n *Ec2AutoscaleNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*Ec2AutoscaleNode) Barrier added in v1.4.0

func (n *Ec2AutoscaleNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*Ec2AutoscaleNode) Bottom added in v1.4.0

func (n *Ec2AutoscaleNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*Ec2AutoscaleNode) ChangeDetect added in v1.5.0

func (n *Ec2AutoscaleNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*Ec2AutoscaleNode) Combine added in v1.4.0

func (n *Ec2AutoscaleNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*Ec2AutoscaleNode) Count added in v1.4.0

func (n *Ec2AutoscaleNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*Ec2AutoscaleNode) CumulativeSum added in v1.4.0

func (n *Ec2AutoscaleNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*Ec2AutoscaleNode) Default added in v1.4.0

func (n *Ec2AutoscaleNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*Ec2AutoscaleNode) Delete added in v1.4.0

func (n *Ec2AutoscaleNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*Ec2AutoscaleNode) Derivative added in v1.4.0

func (n *Ec2AutoscaleNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*Ec2AutoscaleNode) Difference added in v1.4.0

func (n *Ec2AutoscaleNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*Ec2AutoscaleNode) Distinct added in v1.4.0

func (n *Ec2AutoscaleNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*Ec2AutoscaleNode) Ec2Autoscale added in v1.4.0

func (n *Ec2AutoscaleNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*Ec2AutoscaleNode) Elapsed added in v1.4.0

func (n *Ec2AutoscaleNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*Ec2AutoscaleNode) Eval added in v1.4.0

func (n *Ec2AutoscaleNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*Ec2AutoscaleNode) First added in v1.4.0

func (n *Ec2AutoscaleNode) First(field string) *InfluxQLNode

Select the first point.

func (*Ec2AutoscaleNode) Flatten added in v1.4.0

func (n *Ec2AutoscaleNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*Ec2AutoscaleNode) GroupBy added in v1.4.0

func (n *Ec2AutoscaleNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*Ec2AutoscaleNode) HoltWinters added in v1.4.0

func (n *Ec2AutoscaleNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*Ec2AutoscaleNode) HoltWintersWithFit added in v1.4.0

func (n *Ec2AutoscaleNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*Ec2AutoscaleNode) HttpOut added in v1.4.0

func (n *Ec2AutoscaleNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*Ec2AutoscaleNode) HttpPost added in v1.4.0

func (n *Ec2AutoscaleNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*Ec2AutoscaleNode) InfluxDBOut added in v1.4.0

func (n *Ec2AutoscaleNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*Ec2AutoscaleNode) Join added in v1.4.0

func (n *Ec2AutoscaleNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*Ec2AutoscaleNode) K8sAutoscale added in v1.4.0

func (n *Ec2AutoscaleNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*Ec2AutoscaleNode) KapacitorLoopback added in v1.4.0

func (n *Ec2AutoscaleNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*Ec2AutoscaleNode) Last added in v1.4.0

func (n *Ec2AutoscaleNode) Last(field string) *InfluxQLNode

Select the last point.

func (*Ec2AutoscaleNode) Log added in v1.4.0

func (n *Ec2AutoscaleNode) Log() *LogNode

Create a node that logs all data it receives.

func (*Ec2AutoscaleNode) Max added in v1.4.0

func (n *Ec2AutoscaleNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*Ec2AutoscaleNode) Mean added in v1.4.0

func (n *Ec2AutoscaleNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*Ec2AutoscaleNode) Median added in v1.4.0

func (n *Ec2AutoscaleNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*Ec2AutoscaleNode) Min added in v1.4.0

func (n *Ec2AutoscaleNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*Ec2AutoscaleNode) Mode added in v1.4.0

func (n *Ec2AutoscaleNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*Ec2AutoscaleNode) MovingAverage added in v1.4.0

func (n *Ec2AutoscaleNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*Ec2AutoscaleNode) Percentile added in v1.4.0

func (n *Ec2AutoscaleNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*Ec2AutoscaleNode) Sample added in v1.4.0

func (n *Ec2AutoscaleNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*Ec2AutoscaleNode) Shift added in v1.4.0

func (n *Ec2AutoscaleNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*Ec2AutoscaleNode) Sideload added in v1.4.0

func (n *Ec2AutoscaleNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*Ec2AutoscaleNode) Spread added in v1.4.0

func (n *Ec2AutoscaleNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*Ec2AutoscaleNode) StateCount added in v1.4.0

func (n *Ec2AutoscaleNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*Ec2AutoscaleNode) StateDuration added in v1.4.0

func (n *Ec2AutoscaleNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*Ec2AutoscaleNode) Stddev added in v1.4.0

func (n *Ec2AutoscaleNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*Ec2AutoscaleNode) Sum added in v1.4.0

func (n *Ec2AutoscaleNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*Ec2AutoscaleNode) SwarmAutoscale added in v1.4.0

func (n *Ec2AutoscaleNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*Ec2AutoscaleNode) Top added in v1.4.0

func (n *Ec2AutoscaleNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*Ec2AutoscaleNode) Trickle added in v1.6.0

func (n *Ec2AutoscaleNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*Ec2AutoscaleNode) Union added in v1.4.0

func (n *Ec2AutoscaleNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*Ec2AutoscaleNode) Where added in v1.4.0

func (n *Ec2AutoscaleNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*Ec2AutoscaleNode) Window added in v1.4.0

func (n *Ec2AutoscaleNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type Edge added in v1.4.0

type Edge struct {
	Parent ID `json:"parent,string"`
	Child  ID `json:"child,string"`
}

Edge is a connection between a parent ID and a ChildID tick:ignore

type EdgeType

type EdgeType int

The type of data that travels along an edge connecting two nodes in a Pipeline.

const (
	// No data are transferred.
	NoEdge EdgeType = iota
	// Data are transferred immediately and one point at a time.
	StreamEdge
	// Data are transferred in batches as soon as the data are ready.
	BatchEdge
)

func (EdgeType) String

func (e EdgeType) String() string

type EmailHandler added in v0.2.4

type EmailHandler struct {
	*AlertNodeData `json:"-"`

	// List of email recipients.
	// tick:ignore
	ToList []string `tick:"To" json:"to"`

	// ToTemplatesList is the Field or Value from which to grab email addresses
	// tick:ignore
	ToTemplatesList []string `tick:"ToTemplates" json:"to-templates"`
}

Email AlertHandler tick:embedded:AlertNode.Email

func (EmailHandler) Alert added in v0.13.0

func (n EmailHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (EmailHandler) Barrier added in v1.4.0

func (n EmailHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (EmailHandler) Bottom added in v0.13.0

func (n EmailHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (EmailHandler) ChangeDetect added in v1.5.0

func (n EmailHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (EmailHandler) Combine added in v1.0.0

func (n EmailHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (EmailHandler) Count added in v0.13.0

func (n EmailHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (EmailHandler) CumulativeSum added in v1.1.0

func (n EmailHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (EmailHandler) Default added in v0.13.0

func (n EmailHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (EmailHandler) Delete added in v1.0.0

func (n EmailHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (EmailHandler) Derivative added in v0.13.0

func (n EmailHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (EmailHandler) Difference added in v1.0.0

func (n EmailHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (EmailHandler) Distinct added in v0.13.0

func (n EmailHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (EmailHandler) Ec2Autoscale added in v1.4.0

func (n EmailHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (EmailHandler) Elapsed added in v0.13.0

func (n EmailHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (EmailHandler) Eval added in v0.13.0

func (n EmailHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (EmailHandler) First added in v0.13.0

func (n EmailHandler) First(field string) *InfluxQLNode

Select the first point.

func (EmailHandler) Flatten added in v1.0.0

func (n EmailHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (EmailHandler) GroupBy added in v0.13.0

func (n EmailHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (EmailHandler) HoltWinters added in v1.0.0

func (n EmailHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (EmailHandler) HoltWintersWithFit added in v1.0.0

func (n EmailHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (EmailHandler) HttpOut added in v0.13.0

func (n EmailHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (EmailHandler) HttpPost added in v1.3.0

func (n EmailHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (EmailHandler) InfluxDBOut added in v0.13.0

func (n EmailHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (EmailHandler) Join added in v0.13.0

func (n EmailHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (EmailHandler) K8sAutoscale added in v1.1.0

func (n EmailHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (EmailHandler) KapacitorLoopback added in v1.3.0

func (n EmailHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (EmailHandler) Last added in v0.13.0

func (n EmailHandler) Last(field string) *InfluxQLNode

Select the last point.

func (EmailHandler) Max added in v0.13.0

func (n EmailHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (EmailHandler) Mean added in v0.13.0

func (n EmailHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (EmailHandler) Median added in v0.13.0

func (n EmailHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (EmailHandler) Min added in v0.13.0

func (n EmailHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (EmailHandler) Mode added in v1.0.0

func (n EmailHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (EmailHandler) MovingAverage added in v1.0.0

func (n EmailHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (EmailHandler) Percentile added in v0.13.0

func (n EmailHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (EmailHandler) Sample added in v0.13.0

func (n EmailHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (EmailHandler) Shift added in v0.13.0

func (n EmailHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (EmailHandler) Sideload added in v1.4.0

func (n EmailHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (EmailHandler) Spread added in v0.13.0

func (n EmailHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (EmailHandler) StateCount added in v1.3.0

func (n EmailHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (EmailHandler) StateDuration added in v1.3.0

func (n EmailHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (EmailHandler) Stddev added in v0.13.0

func (n EmailHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (EmailHandler) Sum added in v0.13.0

func (n EmailHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (EmailHandler) SwarmAutoscale added in v1.4.0

func (n EmailHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*EmailHandler) To added in v1.0.0

func (h *EmailHandler) To(to ...string) *EmailHandler

Define the To addresses for the email alert. Multiple calls append to the existing list of addresses. If empty uses the addresses from the configuration.

Example:

|alert()
   .id('{{ .Name }}')
   // Email subject
   .message('{{ .ID }}:{{ .Level }}')
   //Email body as HTML
   .details('''

<h1>{{ .ID }}</h1> <b>{{ .Message }}</b> Value: {{ index .Fields "value" }} ”')

.email('admin@example.com')
  .to('oncall@example.com')
  .to('support@example.com')

All three email addresses will receive the alert message.

Passing addresses to the `email` property directly or using the `email.to` property is the same. tick:property

func (*EmailHandler) ToTemplates added in v1.6.3

func (h *EmailHandler) ToTemplates(to ...string) *EmailHandler

Define the To addresses for the email alert. Multiple calls append to the existing list of addresses. If empty uses the addresses from the configuration.

Example:

|alert()
   .id('{{ .Name }}')
   // Email subject
   .message('{{ .ID }}:{{ .Level }}')
   //Email body as HTML
   .details('''

<h1>{{ .ID }}</h1> <b>{{ .Message }}</b> Value: {{ index .Fields "value" }} ”')

.email('admin@example.com')
  .toTemplates('oncall@example.com')

All three email addresses will receive the alert message.

Passing addresses to the `email` property directly or using the `email.to` property is the same. tick:property

func (EmailHandler) Top added in v0.13.0

func (n EmailHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (EmailHandler) Trickle added in v1.6.0

func (n EmailHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (EmailHandler) Union added in v0.13.0

func (n EmailHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (EmailHandler) Where added in v0.13.0

func (n EmailHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (EmailHandler) Window added in v0.13.0

func (n EmailHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type EvalNode

type EvalNode struct {

	// The name of the field that results from applying the expression.
	// tick:ignore
	AsList []string `tick:"As" json:"as"`

	// The names of the expressions that should be converted to tags.
	// tick:ignore
	TagsList []string `tick:"Tags" json:"tags"`

	// tick:ignore
	Lambdas []*ast.LambdaNode `json:"lambdas"`

	// tick:ignore
	KeepFlag bool `tick:"Keep" json:"keep"`
	// List of fields to keep
	// if empty and KeepFlag is true
	// keep all fields.
	// tick:ignore
	KeepList []string `json:"keepList"`
	// contains filtered or unexported fields
}

Evaluates expressions on each data point it receives. A list of expressions may be provided and will be evaluated in the order they are given. The results of expressions are available to later expressions in the list. See the property EvalNode.As for details on how to reference the results.

Example:

stream
    |eval(lambda: "error_count" / "total_count")
      .as('error_percent')

The above example will add a new field `error_percent` to each data point with the result of `error_count / total_count` where `error_count` and `total_count` are existing fields on the data point.

Available Statistics:

  • eval_errors -- number of errors evaluating any expressions.

func (*EvalNode) Alert

func (n *EvalNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*EvalNode) As

func (e *EvalNode) As(names ...string) *EvalNode

List of names for each expression. The expressions are evaluated in order. The result of an expression may be referenced by later expressions via the name provided.

Example:

stream
    |eval(lambda: "value" * "value", lambda: 1.0 / "value2")
        .as('value2', 'inv_value2')

The above example calculates two fields from the value and names them `value2` and `inv_value2` respectively.

tick:property

func (*EvalNode) Barrier added in v1.4.0

func (n *EvalNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*EvalNode) Bottom added in v0.11.0

func (n *EvalNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*EvalNode) ChangeDetect added in v1.5.0

func (n *EvalNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*EvalNode) Combine added in v1.0.0

func (n *EvalNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*EvalNode) Count added in v0.11.0

func (n *EvalNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*EvalNode) CumulativeSum added in v1.1.0

func (n *EvalNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*EvalNode) Default added in v0.13.0

func (n *EvalNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*EvalNode) Delete added in v1.0.0

func (n *EvalNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*EvalNode) Derivative

func (n *EvalNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*EvalNode) Difference added in v1.0.0

func (n *EvalNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*EvalNode) Distinct added in v0.11.0

func (n *EvalNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*EvalNode) Ec2Autoscale added in v1.4.0

func (n *EvalNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*EvalNode) Elapsed added in v0.13.0

func (n *EvalNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*EvalNode) Eval

func (n *EvalNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*EvalNode) First added in v0.11.0

func (n *EvalNode) First(field string) *InfluxQLNode

Select the first point.

func (*EvalNode) Flatten added in v1.0.0

func (n *EvalNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*EvalNode) GroupBy

func (n *EvalNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*EvalNode) HoltWinters added in v1.0.0

func (n *EvalNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*EvalNode) HoltWintersWithFit added in v1.0.0

func (n *EvalNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*EvalNode) HttpOut

func (n *EvalNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*EvalNode) HttpPost added in v1.3.0

func (n *EvalNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*EvalNode) InfluxDBOut

func (n *EvalNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*EvalNode) Join

func (n *EvalNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*EvalNode) K8sAutoscale added in v1.1.0

func (n *EvalNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*EvalNode) KapacitorLoopback added in v1.3.0

func (n *EvalNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*EvalNode) Keep

func (e *EvalNode) Keep(fields ...string) *EvalNode

If called the existing fields will be preserved in addition to the new fields being set. If not called then only new fields are preserved. (Tags are always preserved regardless how `keep` is used.)

Optionally, intermediate values can be discarded by passing a list of field names to be kept. Only fields in the list will be retained, the rest will be discarded. If no list is given then all fields are retained.

Example:

stream
    |eval(lambda: "value" * "value", lambda: 1.0 / "value2")
        .as('value2', 'inv_value2')
        .keep('value', 'inv_value2')

In the above example the original field `value` is preserved. The new field `value2` is calculated and used in evaluating `inv_value2` but is discarded before the point is sent on to child nodes. The resulting point has only two fields: `value` and `inv_value2`.

tick:property

func (*EvalNode) Last added in v0.11.0

func (n *EvalNode) Last(field string) *InfluxQLNode

Select the last point.

func (*EvalNode) Log added in v0.11.0

func (n *EvalNode) Log() *LogNode

Create a node that logs all data it receives.

func (*EvalNode) MarshalJSON added in v1.4.0

func (n *EvalNode) MarshalJSON() ([]byte, error)

MarshalJSON converts EvalNode to JSON tick:ignore

func (*EvalNode) Max added in v0.11.0

func (n *EvalNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*EvalNode) Mean added in v0.11.0

func (n *EvalNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*EvalNode) Median added in v0.11.0

func (n *EvalNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*EvalNode) Min added in v0.11.0

func (n *EvalNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*EvalNode) Mode added in v1.0.0

func (n *EvalNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*EvalNode) MovingAverage added in v1.0.0

func (n *EvalNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*EvalNode) Percentile added in v0.11.0

func (n *EvalNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*EvalNode) Sample

func (n *EvalNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*EvalNode) Shift added in v0.11.0

func (n *EvalNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*EvalNode) Sideload added in v1.4.0

func (n *EvalNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*EvalNode) Spread added in v0.11.0

func (n *EvalNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*EvalNode) StateCount added in v1.3.0

func (n *EvalNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*EvalNode) StateDuration added in v1.3.0

func (n *EvalNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*EvalNode) Stddev added in v0.11.0

func (n *EvalNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*EvalNode) Sum added in v0.11.0

func (n *EvalNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*EvalNode) SwarmAutoscale added in v1.4.0

func (n *EvalNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*EvalNode) Tags added in v1.0.0

func (e *EvalNode) Tags(names ...string) *EvalNode

Convert the result of an expression into a tag. The result must be a string. Use the `string()` expression function to convert types.

Example:

stream
    |eval(lambda: string(floor("value" / 10.0)))
        .as('value_bucket')
        .tags('value_bucket')

The above example calculates an expression from the field `value`, casts it as a string, and names it `value_bucket`. The `value_bucket` expression is then converted from a field on the point to a tag `value_bucket` on the point.

Example:

stream
    |eval(lambda: string(floor("value" / 10.0)))
        .as('value_bucket')
        .tags('value_bucket')
        .keep('value') // keep the original field `value` as well

The above example calculates an expression from the field `value`, casts it as a string, and names it `value_bucket`. The `value_bucket` expression is then converted from a field on the point to a tag `value_bucket` on the point. The `keep` property preserves the original field `value`. Tags are always kept since creating a tag implies you want to keep it.

tick:property

func (*EvalNode) Top added in v0.11.0

func (n *EvalNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*EvalNode) Trickle added in v1.6.0

func (n *EvalNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*EvalNode) Union

func (n *EvalNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*EvalNode) UnmarshalJSON added in v1.4.0

func (n *EvalNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an EvalNode tick:ignore

func (*EvalNode) Where

func (n *EvalNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*EvalNode) Window

func (n *EvalNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type ExecHandler added in v0.2.4

type ExecHandler struct {
	*AlertNodeData `json:"-"`

	// The command to execute
	// tick:ignore
	Command []string `json:"command"`
}

tick:embedded:AlertNode.Exec

func (ExecHandler) Alert added in v0.13.0

func (n ExecHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (ExecHandler) Barrier added in v1.4.0

func (n ExecHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (ExecHandler) Bottom added in v0.13.0

func (n ExecHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (ExecHandler) ChangeDetect added in v1.5.0

func (n ExecHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (ExecHandler) Combine added in v1.0.0

func (n ExecHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (ExecHandler) Count added in v0.13.0

func (n ExecHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (ExecHandler) CumulativeSum added in v1.1.0

func (n ExecHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (ExecHandler) Default added in v0.13.0

func (n ExecHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (ExecHandler) Delete added in v1.0.0

func (n ExecHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (ExecHandler) Derivative added in v0.13.0

func (n ExecHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (ExecHandler) Difference added in v1.0.0

func (n ExecHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (ExecHandler) Distinct added in v0.13.0

func (n ExecHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (ExecHandler) Ec2Autoscale added in v1.4.0

func (n ExecHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (ExecHandler) Elapsed added in v0.13.0

func (n ExecHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (ExecHandler) Eval added in v0.13.0

func (n ExecHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (ExecHandler) First added in v0.13.0

func (n ExecHandler) First(field string) *InfluxQLNode

Select the first point.

func (ExecHandler) Flatten added in v1.0.0

func (n ExecHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (ExecHandler) GroupBy added in v0.13.0

func (n ExecHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (ExecHandler) HoltWinters added in v1.0.0

func (n ExecHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (ExecHandler) HoltWintersWithFit added in v1.0.0

func (n ExecHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (ExecHandler) HttpOut added in v0.13.0

func (n ExecHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (ExecHandler) HttpPost added in v1.3.0

func (n ExecHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (ExecHandler) InfluxDBOut added in v0.13.0

func (n ExecHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (ExecHandler) Join added in v0.13.0

func (n ExecHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (ExecHandler) K8sAutoscale added in v1.1.0

func (n ExecHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (ExecHandler) KapacitorLoopback added in v1.3.0

func (n ExecHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (ExecHandler) Last added in v0.13.0

func (n ExecHandler) Last(field string) *InfluxQLNode

Select the last point.

func (ExecHandler) Max added in v0.13.0

func (n ExecHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (ExecHandler) Mean added in v0.13.0

func (n ExecHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (ExecHandler) Median added in v0.13.0

func (n ExecHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (ExecHandler) Min added in v0.13.0

func (n ExecHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (ExecHandler) Mode added in v1.0.0

func (n ExecHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (ExecHandler) MovingAverage added in v1.0.0

func (n ExecHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (ExecHandler) Percentile added in v0.13.0

func (n ExecHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (ExecHandler) Sample added in v0.13.0

func (n ExecHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (ExecHandler) Shift added in v0.13.0

func (n ExecHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (ExecHandler) Sideload added in v1.4.0

func (n ExecHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (ExecHandler) Spread added in v0.13.0

func (n ExecHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (ExecHandler) StateCount added in v1.3.0

func (n ExecHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (ExecHandler) StateDuration added in v1.3.0

func (n ExecHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (ExecHandler) Stddev added in v0.13.0

func (n ExecHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (ExecHandler) Sum added in v0.13.0

func (n ExecHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (ExecHandler) SwarmAutoscale added in v1.4.0

func (n ExecHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (ExecHandler) Top added in v0.13.0

func (n ExecHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (ExecHandler) Trickle added in v1.6.0

func (n ExecHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (ExecHandler) Union added in v0.13.0

func (n ExecHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (ExecHandler) Where added in v0.13.0

func (n ExecHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (ExecHandler) Window added in v0.13.0

func (n ExecHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type FlattenNode added in v1.0.0

type FlattenNode struct {

	// The dimensions on which to join
	// tick:ignore
	Dimensions []string `tick:"On" json:"on"`

	// The delimiter between field name parts
	Delimiter string `json:"delimiter"`

	// The maximum duration of time that two incoming points
	// can be apart and still be considered to be equal in time.
	// The joined data point's time will be rounded to the nearest
	// multiple of the tolerance duration.
	Tolerance time.Duration `json:"tolerance"`

	// DropOriginalFieldNameFlag indicates whether the original field name should
	// be included in the final field name.
	//tick:ignore
	DropOriginalFieldNameFlag bool `tick:"DropOriginalFieldName" json:"dropOriginalFieldName"`
	// contains filtered or unexported fields
}

Flatten a set of points on specific dimensions. For example given two points:

m,host=A,port=80 bytes=3512 m,host=A,port=443 bytes=6723

Flattening the points on `port` would result in a single point:

m,host=A 80.bytes=3512,443.bytes=6723

Example:

|flatten()
    .on('port')

If flattening on multiple dimensions the order is preserved:

m,host=A,port=80 bytes=3512 m,host=A,port=443 bytes=6723 m,host=B,port=443 bytes=7243

Flattening the points on `host` and `port` would result in a single point:

m A.80.bytes=3512,A.443.bytes=6723,B.443.bytes=7243

Example:

|flatten()
    .on('host', 'port')

Since flattening points creates dynamically named fields in general it is expected that the resultant data is passed to a UDF or similar for custom processing.

func (*FlattenNode) Alert added in v1.0.0

func (n *FlattenNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*FlattenNode) Barrier added in v1.4.0

func (n *FlattenNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*FlattenNode) Bottom added in v1.0.0

func (n *FlattenNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*FlattenNode) ChangeDetect added in v1.5.0

func (n *FlattenNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*FlattenNode) Combine added in v1.0.0

func (n *FlattenNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*FlattenNode) Count added in v1.0.0

func (n *FlattenNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*FlattenNode) CumulativeSum added in v1.1.0

func (n *FlattenNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*FlattenNode) Default added in v1.0.0

func (n *FlattenNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*FlattenNode) Delete added in v1.0.0

func (n *FlattenNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*FlattenNode) Derivative added in v1.0.0

func (n *FlattenNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*FlattenNode) Difference added in v1.0.0

func (n *FlattenNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*FlattenNode) Distinct added in v1.0.0

func (n *FlattenNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*FlattenNode) DropOriginalFieldName added in v1.3.0

func (f *FlattenNode) DropOriginalFieldName(drop ...bool) *FlattenNode

DropOriginalFieldName indicates whether the original field name should be dropped when constructing the final field name. tick:property

func (*FlattenNode) Ec2Autoscale added in v1.4.0

func (n *FlattenNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*FlattenNode) Elapsed added in v1.0.0

func (n *FlattenNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*FlattenNode) Eval added in v1.0.0

func (n *FlattenNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*FlattenNode) First added in v1.0.0

func (n *FlattenNode) First(field string) *InfluxQLNode

Select the first point.

func (*FlattenNode) Flatten added in v1.0.0

func (n *FlattenNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*FlattenNode) GroupBy added in v1.0.0

func (n *FlattenNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*FlattenNode) HoltWinters added in v1.0.0

func (n *FlattenNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*FlattenNode) HoltWintersWithFit added in v1.0.0

func (n *FlattenNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*FlattenNode) HttpOut added in v1.0.0

func (n *FlattenNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*FlattenNode) HttpPost added in v1.3.0

func (n *FlattenNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*FlattenNode) InfluxDBOut added in v1.0.0

func (n *FlattenNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*FlattenNode) Join added in v1.0.0

func (n *FlattenNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*FlattenNode) K8sAutoscale added in v1.1.0

func (n *FlattenNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*FlattenNode) KapacitorLoopback added in v1.3.0

func (n *FlattenNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*FlattenNode) Last added in v1.0.0

func (n *FlattenNode) Last(field string) *InfluxQLNode

Select the last point.

func (*FlattenNode) Log added in v1.0.0

func (n *FlattenNode) Log() *LogNode

Create a node that logs all data it receives.

func (*FlattenNode) MarshalJSON added in v1.4.0

func (n *FlattenNode) MarshalJSON() ([]byte, error)

MarshalJSON converts FlattenNode to JSON tick:ignore

func (*FlattenNode) Max added in v1.0.0

func (n *FlattenNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*FlattenNode) Mean added in v1.0.0

func (n *FlattenNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*FlattenNode) Median added in v1.0.0

func (n *FlattenNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*FlattenNode) Min added in v1.0.0

func (n *FlattenNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*FlattenNode) Mode added in v1.0.0

func (n *FlattenNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*FlattenNode) MovingAverage added in v1.0.0

func (n *FlattenNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*FlattenNode) On added in v1.0.0

func (f *FlattenNode) On(dims ...string) *FlattenNode

Specify the dimensions on which to flatten the points. tick:property

func (*FlattenNode) Percentile added in v1.0.0

func (n *FlattenNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*FlattenNode) Sample added in v1.0.0

func (n *FlattenNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*FlattenNode) Shift added in v1.0.0

func (n *FlattenNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*FlattenNode) Sideload added in v1.4.0

func (n *FlattenNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*FlattenNode) Spread added in v1.0.0

func (n *FlattenNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*FlattenNode) StateCount added in v1.3.0

func (n *FlattenNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*FlattenNode) StateDuration added in v1.3.0

func (n *FlattenNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*FlattenNode) Stddev added in v1.0.0

func (n *FlattenNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*FlattenNode) Sum added in v1.0.0

func (n *FlattenNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*FlattenNode) SwarmAutoscale added in v1.4.0

func (n *FlattenNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*FlattenNode) Top added in v1.0.0

func (n *FlattenNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*FlattenNode) Trickle added in v1.6.0

func (n *FlattenNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*FlattenNode) Union added in v1.0.0

func (n *FlattenNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*FlattenNode) UnmarshalJSON added in v1.4.0

func (n *FlattenNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an FlattenNode tick:ignore

func (*FlattenNode) Where added in v1.0.0

func (n *FlattenNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*FlattenNode) Window added in v1.0.0

func (n *FlattenNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type FromNode added in v0.13.0

type FromNode struct {

	// An expression to filter the data stream.
	// tick:ignore
	Lambda *ast.LambdaNode `tick:"Where" json:"where"`

	// The dimensions by which to group to the data.
	// tick:ignore
	Dimensions []interface{} `tick:"GroupBy" json:"groupBy"`

	// Whether to include the measurement in the group ID.
	// tick:ignore
	GroupByMeasurementFlag bool `tick:"GroupByMeasurement" json:"groupByMeasurement"`

	// The database name.
	// If empty any database will be used.
	Database string `json:"database"`

	// The retention policy name
	// If empty any retention policy will be used.
	RetentionPolicy string `json:"retentionPolicy"`

	// The measurement name
	// If empty any measurement will be used.
	Measurement string `json:"measurement"`

	// Optional duration for truncating timestamps.
	// Helpful to ensure data points land on specific boundaries
	// Example:
	//    stream
	//       |from()
	//           .measurement('mydata')
	//           .truncate(1s)
	//
	// All incoming data will be truncated to 1 second resolution.
	Truncate time.Duration `json:"truncate"`

	// Optional duration for rounding timestamps.
	// Helpful to ensure data points land on specific boundaries
	// Example:
	//    stream
	//       |from()
	//           .measurement('mydata')
	//           .round(1s)
	//
	// All incoming data will be rounded to the nearest 1 second boundary.
	Round time.Duration `json:"round"`
	// contains filtered or unexported fields
}

A FromNode selects a subset of the data flowing through a StreamNode. The stream node allows you to select which portion of the stream you want to process.

Example:

stream
    |from()
       .database('mydb')
       .retentionPolicy('myrp')
       .measurement('mymeasurement')
       .where(lambda: "host" =~ /logger\d+/)
    |window()
    ...

The above example selects only data points from the database `mydb` and retention policy `myrp` and measurement `mymeasurement` where the tag `host` matches the regex `logger\d+`

func (*FromNode) Alert added in v0.13.0

func (n *FromNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*FromNode) Barrier added in v1.4.0

func (n *FromNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*FromNode) Bottom added in v0.13.0

func (n *FromNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*FromNode) ChainMethods added in v0.13.0

func (n *FromNode) ChainMethods() map[string]reflect.Value

func (*FromNode) ChangeDetect added in v1.5.0

func (n *FromNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*FromNode) Combine added in v1.0.0

func (n *FromNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*FromNode) Count added in v0.13.0

func (n *FromNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*FromNode) CumulativeSum added in v1.1.0

func (n *FromNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*FromNode) Default added in v0.13.0

func (n *FromNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*FromNode) Delete added in v1.0.0

func (n *FromNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*FromNode) Derivative added in v0.13.0

func (n *FromNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*FromNode) Difference added in v1.0.0

func (n *FromNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*FromNode) Distinct added in v0.13.0

func (n *FromNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*FromNode) Ec2Autoscale added in v1.4.0

func (n *FromNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*FromNode) Elapsed added in v0.13.0

func (n *FromNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*FromNode) Eval added in v0.13.0

func (n *FromNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*FromNode) First added in v0.13.0

func (n *FromNode) First(field string) *InfluxQLNode

Select the first point.

func (*FromNode) Flatten added in v1.0.0

func (n *FromNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*FromNode) From added in v0.13.0

func (s *FromNode) From() *FromNode

Creates a new stream node that can be further filtered using the Database, RetentionPolicy, Measurement and Where properties. From can be called multiple times to create multiple independent forks of the data stream.

Example:

// Select the 'cpu' measurement from just the database 'mydb'
// and retention policy 'myrp'.
var cpu = stream
    |from()
        .database('mydb')
        .retentionPolicy('myrp')
        .measurement('cpu')
// Select the 'load' measurement from any database and retention policy.
var load = stream
    |from()
        .measurement('load')
// Join cpu and load streams and do further processing.
cpu
    |join(load)
        .as('cpu', 'load')
    ...

func (*FromNode) GroupBy added in v0.13.0

func (s *FromNode) GroupBy(tag ...interface{}) *FromNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

stream
    |from()
        .groupBy(*)

tick:property

func (*FromNode) GroupByMeasurement added in v1.0.0

func (n *FromNode) GroupByMeasurement() *FromNode

If set will include the measurement name in the group ID. Along with any other group by dimensions.

Example: stream

|from()
    .database('mydb')
    .groupByMeasurement()
    .groupBy('host')

The above example selects all measurements from the database 'mydb' and then each point is grouped by the host tag and measurement name. Thus keeping measurements in their own groups. tick:property

func (*FromNode) HoltWinters added in v1.0.0

func (n *FromNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*FromNode) HoltWintersWithFit added in v1.0.0

func (n *FromNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*FromNode) HttpOut added in v0.13.0

func (n *FromNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*FromNode) HttpPost added in v1.3.0

func (n *FromNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*FromNode) InfluxDBOut added in v0.13.0

func (n *FromNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*FromNode) Join added in v0.13.0

func (n *FromNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*FromNode) K8sAutoscale added in v1.1.0

func (n *FromNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*FromNode) KapacitorLoopback added in v1.3.0

func (n *FromNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*FromNode) Last added in v0.13.0

func (n *FromNode) Last(field string) *InfluxQLNode

Select the last point.

func (*FromNode) Log added in v0.13.0

func (n *FromNode) Log() *LogNode

Create a node that logs all data it receives.

func (*FromNode) MarshalJSON added in v1.4.0

func (n *FromNode) MarshalJSON() ([]byte, error)

MarshalJSON converts FromNode to JSON tick:ignore

func (*FromNode) Max added in v0.13.0

func (n *FromNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*FromNode) Mean added in v0.13.0

func (n *FromNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*FromNode) Median added in v0.13.0

func (n *FromNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*FromNode) Min added in v0.13.0

func (n *FromNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*FromNode) Mode added in v1.0.0

func (n *FromNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*FromNode) MovingAverage added in v1.0.0

func (n *FromNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*FromNode) Percentile added in v0.13.0

func (n *FromNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*FromNode) Sample added in v0.13.0

func (n *FromNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*FromNode) Shift added in v0.13.0

func (n *FromNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*FromNode) Sideload added in v1.4.0

func (n *FromNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*FromNode) Spread added in v0.13.0

func (n *FromNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*FromNode) StateCount added in v1.3.0

func (n *FromNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*FromNode) StateDuration added in v1.3.0

func (n *FromNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*FromNode) Stddev added in v0.13.0

func (n *FromNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*FromNode) Sum added in v0.13.0

func (n *FromNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*FromNode) SwarmAutoscale added in v1.4.0

func (n *FromNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*FromNode) Top added in v0.13.0

func (n *FromNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*FromNode) Trickle added in v1.6.0

func (n *FromNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*FromNode) Union added in v0.13.0

func (n *FromNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*FromNode) UnmarshalJSON added in v1.4.0

func (n *FromNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an FromNode tick:ignore

func (*FromNode) Where added in v0.13.0

func (s *FromNode) Where(lambda *ast.LambdaNode) *FromNode

Filter the current stream using the given expression. This expression is a Kapacitor expression. Kapacitor expressions are a superset of InfluxQL WHERE expressions. See the [expression](https://docs.influxdata.com/kapacitor/latest/tick/expr/) docs for more information.

Multiple calls to the Where method will `AND` together each expression.

Example:

stream
   |from()
      .where(lambda: condition1)
      .where(lambda: condition2)

The above is equivalent to this Example:

stream
   |from()
      .where(lambda: condition1 AND condition2)

NOTE: Becareful to always use `|from` if you want multiple different streams.

Example:

var data = stream
    |from()
        .measurement('cpu')
var total = data
    .where(lambda: "cpu" == 'cpu-total')
var others = data
    .where(lambda: "cpu" != 'cpu-total')

The example above is equivalent to the example below, which is obviously not what was intended.

Example:

var data = stream
    |from()
        .measurement('cpu')
        .where(lambda: "cpu" == 'cpu-total' AND "cpu" != 'cpu-total')
var total = data
var others = total

The example below will create two different streams each selecting a different subset of the original stream.

Example:

var data = stream
    |from()
        .measurement('cpu')
var total = stream
    |from()
        .measurement('cpu')
        .where(lambda: "cpu" == 'cpu-total')
var others = stream
    |from()
        .measurement('cpu')
        .where(lambda: "cpu" != 'cpu-total')

If empty then all data points are considered to match. tick:property

func (*FromNode) Window added in v0.13.0

func (n *FromNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type Graph added in v1.4.0

type Graph map[ID][]ID

Graph represents a series of directional edges

type GroupByNode

type GroupByNode struct {

	//The dimensions by which to group to the data.
	// tick:ignore
	Dimensions []interface{} `json:"dimensions"`

	// The dimensions to exclude.
	// Useful for substractive tags from using *.
	// tick:ignore
	ExcludedDimensions []string `tick:"Exclude" json:"exclude"`

	// Whether to include the measurement in the group ID.
	// tick:ignore
	ByMeasurementFlag bool `tick:"ByMeasurement" json:"byMeasurement"`
	// contains filtered or unexported fields
}

A GroupByNode will group the incoming data. Each group is then processed independently for the rest of the pipeline. Only tags that are dimensions in the grouping will be preserved; all other tags are dropped.

Example:

stream
    |groupBy('service', 'datacenter')
    ...

The above example groups the data along two dimensions `service` and `datacenter`. Groups are dynamically created as new data arrives and each group is processed independently.

func (*GroupByNode) Alert

func (n *GroupByNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*GroupByNode) Barrier added in v1.4.0

func (n *GroupByNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*GroupByNode) Bottom added in v0.11.0

func (n *GroupByNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*GroupByNode) ByMeasurement added in v1.0.0

func (n *GroupByNode) ByMeasurement() *GroupByNode

If set will include the measurement name in the group ID. Along with any other group by dimensions.

Example:

...
|groupBy('host')
    .byMeasurement()

The above example groups points by their host tag and measurement name.

If you want to remove the measurement name from the group ID, then groupBy all existing dimensions but without specifying 'byMeasurement'.

Example:

|groupBy(*)

The above removes the group by measurement name if any. tick:property

func (*GroupByNode) ChangeDetect added in v1.5.0

func (n *GroupByNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*GroupByNode) Combine added in v1.0.0

func (n *GroupByNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*GroupByNode) Count added in v0.11.0

func (n *GroupByNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*GroupByNode) CumulativeSum added in v1.1.0

func (n *GroupByNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*GroupByNode) Default added in v0.13.0

func (n *GroupByNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*GroupByNode) Delete added in v1.0.0

func (n *GroupByNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*GroupByNode) Derivative

func (n *GroupByNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*GroupByNode) Difference added in v1.0.0

func (n *GroupByNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*GroupByNode) Distinct added in v0.11.0

func (n *GroupByNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*GroupByNode) Ec2Autoscale added in v1.4.0

func (n *GroupByNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*GroupByNode) Elapsed added in v0.13.0

func (n *GroupByNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*GroupByNode) Eval

func (n *GroupByNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*GroupByNode) Exclude added in v1.3.0

func (n *GroupByNode) Exclude(dims ...string) *GroupByNode

Exclude removes any tags from the group.

func (*GroupByNode) First added in v0.11.0

func (n *GroupByNode) First(field string) *InfluxQLNode

Select the first point.

func (*GroupByNode) Flatten added in v1.0.0

func (n *GroupByNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*GroupByNode) GroupBy

func (n *GroupByNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*GroupByNode) HoltWinters added in v1.0.0

func (n *GroupByNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*GroupByNode) HoltWintersWithFit added in v1.0.0

func (n *GroupByNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*GroupByNode) HttpOut

func (n *GroupByNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*GroupByNode) HttpPost added in v1.3.0

func (n *GroupByNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*GroupByNode) InfluxDBOut

func (n *GroupByNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*GroupByNode) Join

func (n *GroupByNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*GroupByNode) K8sAutoscale added in v1.1.0

func (n *GroupByNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*GroupByNode) KapacitorLoopback added in v1.3.0

func (n *GroupByNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*GroupByNode) Last added in v0.11.0

func (n *GroupByNode) Last(field string) *InfluxQLNode

Select the last point.

func (*GroupByNode) Log added in v0.11.0

func (n *GroupByNode) Log() *LogNode

Create a node that logs all data it receives.

func (*GroupByNode) MarshalJSON added in v1.4.0

func (n *GroupByNode) MarshalJSON() ([]byte, error)

MarshalJSON converts GroupByNode to JSON tick:ignore

func (*GroupByNode) Max added in v0.11.0

func (n *GroupByNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*GroupByNode) Mean added in v0.11.0

func (n *GroupByNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*GroupByNode) Median added in v0.11.0

func (n *GroupByNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*GroupByNode) Min added in v0.11.0

func (n *GroupByNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*GroupByNode) Mode added in v1.0.0

func (n *GroupByNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*GroupByNode) MovingAverage added in v1.0.0

func (n *GroupByNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*GroupByNode) Percentile added in v0.11.0

func (n *GroupByNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*GroupByNode) Sample

func (n *GroupByNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*GroupByNode) Shift added in v0.11.0

func (n *GroupByNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*GroupByNode) Sideload added in v1.4.0

func (n *GroupByNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*GroupByNode) Spread added in v0.11.0

func (n *GroupByNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*GroupByNode) StateCount added in v1.3.0

func (n *GroupByNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*GroupByNode) StateDuration added in v1.3.0

func (n *GroupByNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*GroupByNode) Stddev added in v0.11.0

func (n *GroupByNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*GroupByNode) Sum added in v0.11.0

func (n *GroupByNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*GroupByNode) SwarmAutoscale added in v1.4.0

func (n *GroupByNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*GroupByNode) Top added in v0.11.0

func (n *GroupByNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*GroupByNode) Trickle added in v1.6.0

func (n *GroupByNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*GroupByNode) Union

func (n *GroupByNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*GroupByNode) UnmarshalJSON added in v1.4.0

func (n *GroupByNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an GroupByNode tick:ignore

func (*GroupByNode) Where

func (n *GroupByNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*GroupByNode) Window

func (n *GroupByNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type HTTPOutNode

type HTTPOutNode struct {

	// The relative path where the cached data is exposed
	// tick:ignore
	Endpoint string `json:"endpoint"`
	// contains filtered or unexported fields
}

An HTTPOutNode caches the most recent data for each group it has received.

The cached data is available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

Example:

stream
    |window()
        .period(10s)
        .every(5s)
    |top('value', 10)
    //Publish the top 10 results over the last 10s updated every 5s.
    |httpOut('top10')

Beware of adding a final slash ‘/’ to the URL. This will result in a 404 error for a task that does not exist.

Note that the example script above comes from the [scores](https://github.com/influxdata/kapacitor/tree/master/examples/scores) example. See the complete scores example for a concrete demonstration.

func (*HTTPOutNode) Alert added in v0.11.0

func (n *HTTPOutNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*HTTPOutNode) Barrier added in v1.4.0

func (n *HTTPOutNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*HTTPOutNode) Bottom added in v0.11.0

func (n *HTTPOutNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*HTTPOutNode) ChangeDetect added in v1.5.0

func (n *HTTPOutNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*HTTPOutNode) Combine added in v1.0.0

func (n *HTTPOutNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*HTTPOutNode) Count added in v0.11.0

func (n *HTTPOutNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*HTTPOutNode) CumulativeSum added in v1.1.0

func (n *HTTPOutNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*HTTPOutNode) Default added in v0.13.0

func (n *HTTPOutNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*HTTPOutNode) Delete added in v1.0.0

func (n *HTTPOutNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*HTTPOutNode) Derivative added in v0.11.0

func (n *HTTPOutNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*HTTPOutNode) Difference added in v1.0.0

func (n *HTTPOutNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*HTTPOutNode) Distinct added in v0.11.0

func (n *HTTPOutNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*HTTPOutNode) Ec2Autoscale added in v1.4.0

func (n *HTTPOutNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*HTTPOutNode) Elapsed added in v0.13.0

func (n *HTTPOutNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*HTTPOutNode) Eval added in v0.11.0

func (n *HTTPOutNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*HTTPOutNode) First added in v0.11.0

func (n *HTTPOutNode) First(field string) *InfluxQLNode

Select the first point.

func (*HTTPOutNode) Flatten added in v1.0.0

func (n *HTTPOutNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*HTTPOutNode) GroupBy added in v0.11.0

func (n *HTTPOutNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*HTTPOutNode) HoltWinters added in v1.0.0

func (n *HTTPOutNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*HTTPOutNode) HoltWintersWithFit added in v1.0.0

func (n *HTTPOutNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*HTTPOutNode) HttpOut added in v0.11.0

func (n *HTTPOutNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*HTTPOutNode) HttpPost added in v1.3.0

func (n *HTTPOutNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*HTTPOutNode) InfluxDBOut added in v0.11.0

func (n *HTTPOutNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*HTTPOutNode) Join added in v0.11.0

func (n *HTTPOutNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*HTTPOutNode) K8sAutoscale added in v1.1.0

func (n *HTTPOutNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*HTTPOutNode) KapacitorLoopback added in v1.3.0

func (n *HTTPOutNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*HTTPOutNode) Last added in v0.11.0

func (n *HTTPOutNode) Last(field string) *InfluxQLNode

Select the last point.

func (*HTTPOutNode) Log added in v0.11.0

func (n *HTTPOutNode) Log() *LogNode

Create a node that logs all data it receives.

func (*HTTPOutNode) MarshalJSON added in v1.4.0

func (n *HTTPOutNode) MarshalJSON() ([]byte, error)

MarshalJSON converts HTTPOutNode to JSON tick:ignore

func (*HTTPOutNode) Max added in v0.11.0

func (n *HTTPOutNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*HTTPOutNode) Mean added in v0.11.0

func (n *HTTPOutNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*HTTPOutNode) Median added in v0.11.0

func (n *HTTPOutNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*HTTPOutNode) Min added in v0.11.0

func (n *HTTPOutNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*HTTPOutNode) Mode added in v1.0.0

func (n *HTTPOutNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*HTTPOutNode) MovingAverage added in v1.0.0

func (n *HTTPOutNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*HTTPOutNode) Percentile added in v0.11.0

func (n *HTTPOutNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*HTTPOutNode) Sample added in v0.11.0

func (n *HTTPOutNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*HTTPOutNode) Shift added in v0.11.0

func (n *HTTPOutNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*HTTPOutNode) Sideload added in v1.4.0

func (n *HTTPOutNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*HTTPOutNode) Spread added in v0.11.0

func (n *HTTPOutNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*HTTPOutNode) StateCount added in v1.3.0

func (n *HTTPOutNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*HTTPOutNode) StateDuration added in v1.3.0

func (n *HTTPOutNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*HTTPOutNode) Stddev added in v0.11.0

func (n *HTTPOutNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*HTTPOutNode) Sum added in v0.11.0

func (n *HTTPOutNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*HTTPOutNode) SwarmAutoscale added in v1.4.0

func (n *HTTPOutNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*HTTPOutNode) Top added in v0.11.0

func (n *HTTPOutNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*HTTPOutNode) Trickle added in v1.6.0

func (n *HTTPOutNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*HTTPOutNode) Union added in v0.11.0

func (n *HTTPOutNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*HTTPOutNode) UnmarshalJSON added in v1.4.0

func (n *HTTPOutNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an HTTPOutNode tick:ignore

func (*HTTPOutNode) Where added in v0.11.0

func (n *HTTPOutNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*HTTPOutNode) Window added in v0.11.0

func (n *HTTPOutNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type HTTPPostNode added in v1.3.0

type HTTPPostNode struct {

	// tick:ignore
	Endpoints []string `tick:"Endpoint" json:"endpoints"`

	// Headers
	// tick:ignore
	Headers map[string]string `tick:"Header" json:"headers"`

	// CodeField is the name of the field in which to place the HTTP status code.
	// If the HTTP request fails at a layer below HTTP, (i.e. rejected TCP connection), then the status code is set to 0.
	CodeField string `json:"codeField"`

	// tick:ignore
	CaptureResponseFlag bool `tick:"CaptureResponse" json:"captureResponse"`

	// tick:ignore
	URLs []string `json:"urls"`

	// Timeout for HTTP Post
	Timeout time.Duration `json:"timeout"`
	// contains filtered or unexported fields
}

An HTTPPostNode will take the incoming data stream and POST it to an HTTP endpoint. That endpoint may be specified as a positional argument, or as an endpoint property method on httpPost. Multiple endpoint property methods may be specified.

Example:

stream
    |window()
        .period(10s)
        .every(5s)
    |top('value', 10)
    //Post the top 10 results over the last 10s updated every 5s.
    |httpPost('http://example.com/api/top10')

Example:

stream
    |window()
        .period(10s)
        .every(5s)
    |top('value', 10)
    //Post the top 10 results over the last 10s updated every 5s.
    |httpPost()
        .endpoint('example')

func (*HTTPPostNode) Alert added in v1.3.0

func (n *HTTPPostNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*HTTPPostNode) Barrier added in v1.4.0

func (n *HTTPPostNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*HTTPPostNode) Bottom added in v1.3.0

func (n *HTTPPostNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*HTTPPostNode) CaptureResponse added in v1.4.0

func (p *HTTPPostNode) CaptureResponse() *HTTPPostNode

CaptureResponse indicates that the HTTP response should be read and logged if the status code was not an 2xx code. tick:property

func (*HTTPPostNode) ChangeDetect added in v1.5.0

func (n *HTTPPostNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*HTTPPostNode) Combine added in v1.3.0

func (n *HTTPPostNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*HTTPPostNode) Count added in v1.3.0

func (n *HTTPPostNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*HTTPPostNode) CumulativeSum added in v1.3.0

func (n *HTTPPostNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*HTTPPostNode) Default added in v1.3.0

func (n *HTTPPostNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*HTTPPostNode) Delete added in v1.3.0

func (n *HTTPPostNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*HTTPPostNode) Derivative added in v1.3.0

func (n *HTTPPostNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*HTTPPostNode) Difference added in v1.3.0

func (n *HTTPPostNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*HTTPPostNode) Distinct added in v1.3.0

func (n *HTTPPostNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*HTTPPostNode) Ec2Autoscale added in v1.4.0

func (n *HTTPPostNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*HTTPPostNode) Elapsed added in v1.3.0

func (n *HTTPPostNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*HTTPPostNode) Endpoint added in v1.3.0

func (p *HTTPPostNode) Endpoint(endpoint string) *HTTPPostNode

Name of the endpoint to be used, as is defined in the configuration file.

Example:

stream
     |httpPost()
        .endpoint('example')

tick:property

func (*HTTPPostNode) Eval added in v1.3.0

func (n *HTTPPostNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*HTTPPostNode) First added in v1.3.0

func (n *HTTPPostNode) First(field string) *InfluxQLNode

Select the first point.

func (*HTTPPostNode) Flatten added in v1.3.0

func (n *HTTPPostNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*HTTPPostNode) GroupBy added in v1.3.0

func (n *HTTPPostNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*HTTPPostNode) Header added in v1.3.0

func (p *HTTPPostNode) Header(k, v string) *HTTPPostNode

Add a header to the POST request

Example:

stream
     |httpPost()
        .endpoint('example')
          .header('my', 'header')

tick:property

func (*HTTPPostNode) HoltWinters added in v1.3.0

func (n *HTTPPostNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*HTTPPostNode) HoltWintersWithFit added in v1.3.0

func (n *HTTPPostNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*HTTPPostNode) HttpOut added in v1.3.0

func (n *HTTPPostNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*HTTPPostNode) HttpPost added in v1.3.0

func (n *HTTPPostNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*HTTPPostNode) InfluxDBOut added in v1.3.0

func (n *HTTPPostNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*HTTPPostNode) Join added in v1.3.0

func (n *HTTPPostNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*HTTPPostNode) K8sAutoscale added in v1.3.0

func (n *HTTPPostNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*HTTPPostNode) KapacitorLoopback added in v1.3.0

func (n *HTTPPostNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*HTTPPostNode) Last added in v1.3.0

func (n *HTTPPostNode) Last(field string) *InfluxQLNode

Select the last point.

func (*HTTPPostNode) Log added in v1.3.0

func (n *HTTPPostNode) Log() *LogNode

Create a node that logs all data it receives.

func (*HTTPPostNode) MarshalJSON added in v1.4.0

func (n *HTTPPostNode) MarshalJSON() ([]byte, error)

MarshalJSON converts HTTPPostNode to JSON tick:ignore

func (*HTTPPostNode) Max added in v1.3.0

func (n *HTTPPostNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*HTTPPostNode) Mean added in v1.3.0

func (n *HTTPPostNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*HTTPPostNode) Median added in v1.3.0

func (n *HTTPPostNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*HTTPPostNode) Min added in v1.3.0

func (n *HTTPPostNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*HTTPPostNode) Mode added in v1.3.0

func (n *HTTPPostNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*HTTPPostNode) MovingAverage added in v1.3.0

func (n *HTTPPostNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*HTTPPostNode) Percentile added in v1.3.0

func (n *HTTPPostNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*HTTPPostNode) Sample added in v1.3.0

func (n *HTTPPostNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*HTTPPostNode) Shift added in v1.3.0

func (n *HTTPPostNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*HTTPPostNode) Sideload added in v1.4.0

func (n *HTTPPostNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*HTTPPostNode) Spread added in v1.3.0

func (n *HTTPPostNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*HTTPPostNode) StateCount added in v1.3.0

func (n *HTTPPostNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*HTTPPostNode) StateDuration added in v1.3.0

func (n *HTTPPostNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*HTTPPostNode) Stddev added in v1.3.0

func (n *HTTPPostNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*HTTPPostNode) Sum added in v1.3.0

func (n *HTTPPostNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*HTTPPostNode) SwarmAutoscale added in v1.4.0

func (n *HTTPPostNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*HTTPPostNode) Top added in v1.3.0

func (n *HTTPPostNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*HTTPPostNode) Trickle added in v1.6.0

func (n *HTTPPostNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*HTTPPostNode) Union added in v1.3.0

func (n *HTTPPostNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*HTTPPostNode) UnmarshalJSON added in v1.4.0

func (n *HTTPPostNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an HTTPPostNode tick:ignore

func (*HTTPPostNode) Where added in v1.3.0

func (n *HTTPPostNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*HTTPPostNode) Window added in v1.3.0

func (n *HTTPPostNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type HipChatHandler added in v0.2.4

type HipChatHandler struct {
	*AlertNodeData `json:"-"`

	// HipChat room in which to post messages.
	// If empty uses the channel from the configuration.
	Room string `json:"room"`

	// HipChat authentication token.
	// If empty uses the token from the configuration.
	Token string `json:"token"`
}

tick:embedded:AlertNode.HipChat

func (HipChatHandler) Alert added in v0.13.0

func (n HipChatHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (HipChatHandler) Barrier added in v1.4.0

func (n HipChatHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (HipChatHandler) Bottom added in v0.13.0

func (n HipChatHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (HipChatHandler) ChangeDetect added in v1.5.0

func (n HipChatHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (HipChatHandler) Combine added in v1.0.0

func (n HipChatHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (HipChatHandler) Count added in v0.13.0

func (n HipChatHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (HipChatHandler) CumulativeSum added in v1.1.0

func (n HipChatHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (HipChatHandler) Default added in v0.13.0

func (n HipChatHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (HipChatHandler) Delete added in v1.0.0

func (n HipChatHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (HipChatHandler) Derivative added in v0.13.0

func (n HipChatHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (HipChatHandler) Difference added in v1.0.0

func (n HipChatHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (HipChatHandler) Distinct added in v0.13.0

func (n HipChatHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (HipChatHandler) Ec2Autoscale added in v1.4.0

func (n HipChatHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (HipChatHandler) Elapsed added in v0.13.0

func (n HipChatHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (HipChatHandler) Eval added in v0.13.0

func (n HipChatHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (HipChatHandler) First added in v0.13.0

func (n HipChatHandler) First(field string) *InfluxQLNode

Select the first point.

func (HipChatHandler) Flatten added in v1.0.0

func (n HipChatHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (HipChatHandler) GroupBy added in v0.13.0

func (n HipChatHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (HipChatHandler) HoltWinters added in v1.0.0

func (n HipChatHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (HipChatHandler) HoltWintersWithFit added in v1.0.0

func (n HipChatHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (HipChatHandler) HttpOut added in v0.13.0

func (n HipChatHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (HipChatHandler) HttpPost added in v1.3.0

func (n HipChatHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (HipChatHandler) InfluxDBOut added in v0.13.0

func (n HipChatHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (HipChatHandler) Join added in v0.13.0

func (n HipChatHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (HipChatHandler) K8sAutoscale added in v1.1.0

func (n HipChatHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (HipChatHandler) KapacitorLoopback added in v1.3.0

func (n HipChatHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (HipChatHandler) Last added in v0.13.0

func (n HipChatHandler) Last(field string) *InfluxQLNode

Select the last point.

func (HipChatHandler) Max added in v0.13.0

func (n HipChatHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (HipChatHandler) Mean added in v0.13.0

func (n HipChatHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (HipChatHandler) Median added in v0.13.0

func (n HipChatHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (HipChatHandler) Min added in v0.13.0

func (n HipChatHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (HipChatHandler) Mode added in v1.0.0

func (n HipChatHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (HipChatHandler) MovingAverage added in v1.0.0

func (n HipChatHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (HipChatHandler) Percentile added in v0.13.0

func (n HipChatHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (HipChatHandler) Sample added in v0.13.0

func (n HipChatHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (HipChatHandler) Shift added in v0.13.0

func (n HipChatHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (HipChatHandler) Sideload added in v1.4.0

func (n HipChatHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (HipChatHandler) Spread added in v0.13.0

func (n HipChatHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (HipChatHandler) StateCount added in v1.3.0

func (n HipChatHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (HipChatHandler) StateDuration added in v1.3.0

func (n HipChatHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (HipChatHandler) Stddev added in v0.13.0

func (n HipChatHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (HipChatHandler) Sum added in v0.13.0

func (n HipChatHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (HipChatHandler) SwarmAutoscale added in v1.4.0

func (n HipChatHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (HipChatHandler) Top added in v0.13.0

func (n HipChatHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (HipChatHandler) Trickle added in v1.6.0

func (n HipChatHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (HipChatHandler) Union added in v0.13.0

func (n HipChatHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (HipChatHandler) Where added in v0.13.0

func (n HipChatHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (HipChatHandler) Window added in v0.13.0

func (n HipChatHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type ID

type ID int

type IRNode added in v1.4.0

type IRNode struct {
	Raw    json.RawMessage
	TypeOf TypeOf
	Pos    int
}

IRNode is the intermediate representation of a node between JSON unmarshaling and a pipeline Node tick:ignore

type InfluxDBOutNode

type InfluxDBOutNode struct {

	// The name of the InfluxDB instance to connect to.
	// If empty the configured default will be used.
	Cluster string `json:"cluster"`
	// The name of the database.
	Database string `json:"database"`
	// The name of the retention policy.
	RetentionPolicy string `json:"retentionPolicy"`
	// The name of the measurement.
	Measurement string `json:"measurement"`
	// The write consistency to use when writing the data.
	WriteConsistency string `json:"writeConsistency"`
	// The precision to use when writing the data.
	Precision string `json:"precision"`
	// Number of points to buffer when writing to InfluxDB.
	// Default: 1000
	Buffer int64 `json:"buffer"`
	// Write points to InfluxDB after interval even if buffer is not full.
	// Default: 10s
	FlushInterval time.Duration `json:"flushInterval"`
	// Static set of tags to add to all data points before writing them.
	// tick:ignore
	Tags map[string]string `tick:"Tag" json:"tags"`
	// Create the specified database and retention policy
	// tick:ignore
	CreateFlag bool `tick:"Create" json:"create"`
	// contains filtered or unexported fields
}

Writes the data to InfluxDB as it is received.

Example:

stream
    |from()
        .measurement('requests')
    |eval(lambda: "errors" / "total")
        .as('error_percent')
    // Write the transformed data to InfluxDB
    |influxDBOut()
        .database('mydb')
        .retentionPolicy('myrp')
        .measurement('errors')
        .tag('kapacitor', 'true')
        .tag('version', '0.2')

Available Statistics:

  • points_written -- number of points written to InfluxDB
  • write_errors -- number of errors attempting to write to InfluxDB

func (*InfluxDBOutNode) Children

func (n *InfluxDBOutNode) Children() []Node

tick:ignore

func (*InfluxDBOutNode) Create added in v1.0.1

func (i *InfluxDBOutNode) Create() *InfluxDBOutNode

Create indicates that both the database and retention policy will be created, when the task is started. If the retention policy name is empty then no retention policy will be specified and the default retention policy name will be created.

If the database already exists nothing happens.

tick:property

func (*InfluxDBOutNode) Deadman added in v0.10.0

func (n *InfluxDBOutNode) Deadman(threshold float64, interval time.Duration, expr ...*ast.LambdaNode) *AlertNode

Helper function for creating an alert on low throughput, a.k.a. deadman's switch.

- Threshold -- trigger alert if throughput drops below threshold in points/interval. - Interval -- how often to check the throughput. - Expressions -- optional list of expressions to also evaluate. Useful for time of day alerting.

Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
//Do normal processing of data
data...

The above is equivalent to this Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |stats(10s)
        .align()
    |derivative('emitted')
        .unit(10s)
        .nonNegative()
    |alert()
        .id('node \'stream0\' in task \'{{ .TaskName }}\'')
        .message('{{ .ID }} is {{ if eq .Level "OK" }}alive{{ else }}dead{{ end }}: {{ index .Fields "emitted" | printf "%0.3f" }} points/10s.')
        .crit(lambda: "emitted" <= 100.0)
//Do normal processing of data
data...

The `id` and `message` alert properties can be configured globally via the 'deadman' configuration section.

Since the AlertNode is the last piece it can be further modified as usual. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
        .slack()
        .channel('#dead_tasks')
//Do normal processing of data
data...

You can specify additional lambda expressions to further constrain when the deadman's switch is triggered. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
// Only trigger the alert if the time of day is between 8am-5pm.
data
    |deadman(100.0, 10s, lambda: hour("time") >= 8 AND hour("time") <= 17)
//Do normal processing of data
data...

func (*InfluxDBOutNode) Desc

func (n *InfluxDBOutNode) Desc() string

tick:ignore

func (*InfluxDBOutNode) ID

func (n *InfluxDBOutNode) ID() ID

tick:ignore

func (*InfluxDBOutNode) IsQuiet added in v1.5.0

func (n *InfluxDBOutNode) IsQuiet() bool

tick:ignore

func (*InfluxDBOutNode) MarshalJSON added in v1.4.0

func (n *InfluxDBOutNode) MarshalJSON() ([]byte, error)

MarshalJSON converts InfluxDBOutNode to JSON tick:ignore

func (*InfluxDBOutNode) Name

func (n *InfluxDBOutNode) Name() string

tick:ignore

func (*InfluxDBOutNode) Parents

func (n *InfluxDBOutNode) Parents() []Node

tick:ignore

func (*InfluxDBOutNode) Provides

func (n *InfluxDBOutNode) Provides() EdgeType

tick:ignore

func (*InfluxDBOutNode) Quiet added in v1.5.0

func (n *InfluxDBOutNode) Quiet()

Quiet suppresses all error logging events from this node. tick:property

func (*InfluxDBOutNode) SetName

func (n *InfluxDBOutNode) SetName(name string)

tick:ignore

func (*InfluxDBOutNode) Stats added in v0.10.0

func (n *InfluxDBOutNode) Stats(interval time.Duration) *StatsNode

Create a new stream of data that contains the internal statistics of the node. The interval represents how often to emit the statistics based on real time. This means the interval time is independent of the times of the data points the source node is receiving.

func (*InfluxDBOutNode) Tag

func (i *InfluxDBOutNode) Tag(key, value string) *InfluxDBOutNode

Add a static tag to all data points. Tag can be called more then once.

tick:property

func (*InfluxDBOutNode) UnmarshalJSON added in v1.4.0

func (n *InfluxDBOutNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an InfluxDBOutNode tick:ignore

func (*InfluxDBOutNode) Wants

func (n *InfluxDBOutNode) Wants() EdgeType

tick:ignore

type InfluxQLNode added in v0.11.0

type InfluxQLNode struct {

	// tick:ignore
	Method string `json:"-"`
	// tick:ignore
	Field string `json:"field"`

	// The name of the field, defaults to the name of
	// function used (i.e. .mean -> 'mean')
	As string `json:"as"`

	// tick:ignore
	ReduceCreater ReduceCreater `json:"-"`

	// tick:ignore
	PointTimes bool `tick:"UsePointTimes" json:"usePointTimes"`

	//tick:ignore
	Reducer Node

	// tick:ignore
	Args []interface{} `json:"args"`
	// contains filtered or unexported fields
}

An InfluxQLNode performs the available function from the InfluxQL language. These function can be performed on a stream or batch edge. The resulting edge is dependent on the function. For a stream edge, all points with the same time are accumulated into the function. For a batch edge, all points in the batch are accumulated into the function.

Example:

stream
    |window()
        .period(10s)
        .every(10s)
    // Sum the values for each 10s window of data.
    |sum('value')

Note: Derivative has its own implementation as a DerivativeNode instead of as part of the InfluxQL functions.

func (*InfluxQLNode) Alert added in v0.11.0

func (n *InfluxQLNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*InfluxQLNode) Barrier added in v1.4.0

func (n *InfluxQLNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*InfluxQLNode) Bottom added in v0.11.0

func (n *InfluxQLNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*InfluxQLNode) ChangeDetect added in v1.5.0

func (n *InfluxQLNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*InfluxQLNode) Combine added in v1.0.0

func (n *InfluxQLNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*InfluxQLNode) Count added in v0.11.0

func (n *InfluxQLNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*InfluxQLNode) CumulativeSum added in v1.1.0

func (n *InfluxQLNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*InfluxQLNode) Default added in v0.13.0

func (n *InfluxQLNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*InfluxQLNode) Delete added in v1.0.0

func (n *InfluxQLNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*InfluxQLNode) Derivative added in v0.11.0

func (n *InfluxQLNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*InfluxQLNode) Difference added in v1.0.0

func (n *InfluxQLNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*InfluxQLNode) Distinct added in v0.11.0

func (n *InfluxQLNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*InfluxQLNode) Ec2Autoscale added in v1.4.0

func (n *InfluxQLNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*InfluxQLNode) Elapsed added in v0.13.0

func (n *InfluxQLNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*InfluxQLNode) Eval added in v0.11.0

func (n *InfluxQLNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*InfluxQLNode) First added in v0.11.0

func (n *InfluxQLNode) First(field string) *InfluxQLNode

Select the first point.

func (*InfluxQLNode) Flatten added in v1.0.0

func (n *InfluxQLNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*InfluxQLNode) GroupBy added in v0.11.0

func (n *InfluxQLNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*InfluxQLNode) HoltWinters added in v1.0.0

func (n *InfluxQLNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*InfluxQLNode) HoltWintersWithFit added in v1.0.0

func (n *InfluxQLNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*InfluxQLNode) HttpOut added in v0.11.0

func (n *InfluxQLNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*InfluxQLNode) HttpPost added in v1.3.0

func (n *InfluxQLNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*InfluxQLNode) InfluxDBOut added in v0.11.0

func (n *InfluxQLNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*InfluxQLNode) Join added in v0.11.0

func (n *InfluxQLNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*InfluxQLNode) K8sAutoscale added in v1.1.0

func (n *InfluxQLNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*InfluxQLNode) KapacitorLoopback added in v1.3.0

func (n *InfluxQLNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*InfluxQLNode) Last added in v0.11.0

func (n *InfluxQLNode) Last(field string) *InfluxQLNode

Select the last point.

func (*InfluxQLNode) Log added in v0.11.0

func (n *InfluxQLNode) Log() *LogNode

Create a node that logs all data it receives.

func (*InfluxQLNode) MarshalJSON added in v1.4.0

func (n *InfluxQLNode) MarshalJSON() ([]byte, error)

MarshalJSON converts InfluxQLNode to JSON tick:ignore

func (*InfluxQLNode) Max added in v0.11.0

func (n *InfluxQLNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*InfluxQLNode) Mean added in v0.11.0

func (n *InfluxQLNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*InfluxQLNode) Median added in v0.11.0

func (n *InfluxQLNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*InfluxQLNode) Min added in v0.11.0

func (n *InfluxQLNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*InfluxQLNode) Mode added in v1.0.0

func (n *InfluxQLNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*InfluxQLNode) MovingAverage added in v1.0.0

func (n *InfluxQLNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*InfluxQLNode) Percentile added in v0.11.0

func (n *InfluxQLNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*InfluxQLNode) Sample added in v0.11.0

func (n *InfluxQLNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*InfluxQLNode) Shift added in v0.11.0

func (n *InfluxQLNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*InfluxQLNode) Sideload added in v1.4.0

func (n *InfluxQLNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*InfluxQLNode) Spread added in v0.11.0

func (n *InfluxQLNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*InfluxQLNode) StateCount added in v1.3.0

func (n *InfluxQLNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*InfluxQLNode) StateDuration added in v1.3.0

func (n *InfluxQLNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*InfluxQLNode) Stddev added in v0.11.0

func (n *InfluxQLNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*InfluxQLNode) Sum added in v0.11.0

func (n *InfluxQLNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*InfluxQLNode) SwarmAutoscale added in v1.4.0

func (n *InfluxQLNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*InfluxQLNode) Top added in v0.11.0

func (n *InfluxQLNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*InfluxQLNode) Trickle added in v1.6.0

func (n *InfluxQLNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*InfluxQLNode) Union added in v0.11.0

func (n *InfluxQLNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*InfluxQLNode) UnmarshalJSON added in v1.4.0

func (n *InfluxQLNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an InfluxQLNode tick:ignore

func (*InfluxQLNode) UsePointTimes added in v0.11.0

func (n *InfluxQLNode) UsePointTimes() *InfluxQLNode

Use the time of the selected point instead of the time of the batch.

Only applies to selector functions like first, last, top, bottom, etc. Aggregation functions always use the batch time. tick:property

func (*InfluxQLNode) Where added in v0.11.0

func (n *InfluxQLNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*InfluxQLNode) Window added in v0.11.0

func (n *InfluxQLNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type Inhibitor added in v1.5.0

type Inhibitor struct {
	Category  string   `json:"category"`
	EqualTags []string `json:"equalTags"`
}

Inhibitor represents a single alert inhibitor tick:ignore

type JSONNode added in v1.4.0

type JSONNode map[string]interface{}

JSONNode contains all fields associated with a node. `typeOf` is used to determine which type of node this is. JSONNode is used by UDFNode specifically for marshaling and unmarshaling the UDF to json

func NewJSONNode added in v1.4.0

func NewJSONNode(data []byte) (JSONNode, error)

NewJSONNode decodes JSON bytes into a JSONNode

func (JSONNode) CheckTypeOf added in v1.4.0

func (j JSONNode) CheckTypeOf(typ string) error

CheckTypeOf tests that the typeOf field is correctly set to typ.

func (JSONNode) Field added in v1.4.0

func (j JSONNode) Field(field string) (interface{}, error)

Field returns expected field or error if field doesn't exist

func (JSONNode) ID added in v1.4.0

func (j JSONNode) ID() (ID, error)

ID returns the unique ID for this node. This ID is used as the id of the parent and children in the Edges structure.

func (JSONNode) Set added in v1.4.0

func (j JSONNode) Set(key string, value interface{}) JSONNode

Set adds the key/value to the JSONNode

func (JSONNode) SetID added in v1.4.0

func (j JSONNode) SetID(id ID) JSONNode

SetID adds the Node ID information

func (JSONNode) SetType added in v1.4.0

func (j JSONNode) SetType(typ string) JSONNode

SetType adds the Node type information

func (JSONNode) String added in v1.4.0

func (j JSONNode) String(field string) (string, error)

String reads the field for a string value

type JSONPipeline added in v1.4.0

type JSONPipeline struct {
	Nodes []json.RawMessage `json:"nodes"`
	Edges []Edge            `json:"edges"`
}

JSONPipeline is the JSON serialization format for Pipeline tick:ignore

type JoinNode

type JoinNode struct {

	// The alias names of the two parents.
	// Note:
	//       Names[1] corresponds to the left  parent
	//       Names[0] corresponds to the right parent
	// tick:ignore
	Names []string `tick:"As" json:"as"`

	// The dimensions on which to join
	// tick:ignore
	Dimensions []string `tick:"On" json:"on"`

	// The delimiter for the field name prefixes.
	// Can be the empty string.
	Delimiter string `json:"delimiter"`

	// Deletes both sides of the join regardless what
	// side receive the delete message.
	DeleteAll bool `json:"deleteAll"`

	// The name of this new joined data stream.
	// If empty the name of the left parent is used.
	StreamName string `json:"streamName"`

	// The maximum duration of time that two incoming points
	// can be apart and still be considered to be equal in time.
	// The joined data point's time will be rounded to the nearest
	// multiple of the tolerance duration.
	Tolerance time.Duration `json:"tolerance"`

	// Fill the data.
	// The fill option implies the type of join: inner or full outer
	// Options are:
	//
	//   - none - (default) skip rows where a point is missing, inner join.
	//   - null - fill missing points with null, full outer join.
	//   - Any numerical value - fill fields with given value, full outer join.
	//
	// When using a numerical or null fill, the fields names are determined by copying
	// the field names from another point.
	// This doesn't work well when different sources have different field names.
	// Use the DefaultNode and DeleteNode to finalize the fill operation if necessary.
	//
	// Example:
	//    var maintlock = stream
	//        |from()
	//            .measurement('maintlock')
	//            .groupBy('service')
	//    var requests = stream
	//        |from()
	//            .measurement('requests')
	//            .groupBy('service')
	//    // Join the maintlock and requests streams
	//    // The intent it to drop any points in maintenance mode.
	//    maintlock
	//        |join(requests)
	//            // Provide prefix names for the fields of the data points.
	//            .as('maintlock', 'requests')
	//            // points that are within 1 second are considered the same time.
	//            .tolerance(1s)
	//            // fill missing fields with null, implies outer join.
	//            // a better default per field will be set later.
	//            .fill('null')
	//            // name the resulting stream.
	//            .streamName('requests')
	//        |default()
	//            // default maintenance mode to false, overwriting the null value if present.
	//            .field('maintlock.mode', false)
	//            // default the requests to 0, again overwriting the null value if present.
	//            .field('requests.value', 0.0)
	//        // drop any points that are in maintenance mode.
	//        |where(lambda: "maintlock.mode")
	//        |...
	Fill interface{} `json:"fill"`
	// contains filtered or unexported fields
}

Joins the data from any number of nodes. As each data point is received from a parent node it is paired with the next data points from the other parent nodes with a matching timestamp. Each parent node contributes at most one point to each joined point. A tolerance can be supplied to join points that do not have perfectly aligned timestamps. Any points that fall within the tolerance are joined on the timestamp. If multiple points fall within the same tolerance window than they are joined in the order they arrive.

Aliases are used to prefix all fields from the respective nodes.

The join can be an inner or outer join, see the JoinNode.Fill property.

Example:

var errors = stream
    |from()
        .measurement('errors')
var requests = stream
    |from()
        .measurement('requests')
// Join the errors and requests streams
errors
    |join(requests)
        // Provide prefix names for the fields of the data points.
        .as('errors', 'requests')
        // points that are within 1 second are considered the same time.
        .tolerance(1s)
        // fill missing values with 0, implies outer join.
        .fill(0.0)
        // name the resulting stream
        .streamName('error_rate')
        // treat a delete from one side of the join as a delete to all sides
        .deleteAll(TRUE)
    // Both the "value" fields from each parent have been prefixed
    // with the respective names 'errors' and 'requests'.
    |eval(lambda: "errors.value" / "requests.value")
       .as('rate')
    ...

In the above example the `errors` and `requests` streams are joined and then transformed to calculate a combined field.

func (*JoinNode) Alert

func (n *JoinNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*JoinNode) As

func (j *JoinNode) As(names ...string) *JoinNode

Prefix names for all fields from the respective nodes. Each field from the parent nodes will be prefixed with the provided name and a '.'. See the example above.

The names cannot have a dot '.' character.

tick:property

func (*JoinNode) Barrier added in v1.4.0

func (n *JoinNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*JoinNode) Bottom added in v0.11.0

func (n *JoinNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*JoinNode) ChangeDetect added in v1.5.0

func (n *JoinNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*JoinNode) Combine added in v1.0.0

func (n *JoinNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*JoinNode) Count added in v0.11.0

func (n *JoinNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*JoinNode) CumulativeSum added in v1.1.0

func (n *JoinNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*JoinNode) Default added in v0.13.0

func (n *JoinNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*JoinNode) Delete added in v1.0.0

func (n *JoinNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*JoinNode) Derivative

func (n *JoinNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*JoinNode) Difference added in v1.0.0

func (n *JoinNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*JoinNode) Distinct added in v0.11.0

func (n *JoinNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*JoinNode) Ec2Autoscale added in v1.4.0

func (n *JoinNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*JoinNode) Elapsed added in v0.13.0

func (n *JoinNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*JoinNode) Eval

func (n *JoinNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*JoinNode) First added in v0.11.0

func (n *JoinNode) First(field string) *InfluxQLNode

Select the first point.

func (*JoinNode) Flatten added in v1.0.0

func (n *JoinNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*JoinNode) GroupBy

func (n *JoinNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*JoinNode) HoltWinters added in v1.0.0

func (n *JoinNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*JoinNode) HoltWintersWithFit added in v1.0.0

func (n *JoinNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*JoinNode) HttpOut

func (n *JoinNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*JoinNode) HttpPost added in v1.3.0

func (n *JoinNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*JoinNode) InfluxDBOut

func (n *JoinNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*JoinNode) Join

func (n *JoinNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*JoinNode) K8sAutoscale added in v1.1.0

func (n *JoinNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*JoinNode) KapacitorLoopback added in v1.3.0

func (n *JoinNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*JoinNode) Last added in v0.11.0

func (n *JoinNode) Last(field string) *InfluxQLNode

Select the last point.

func (*JoinNode) Log added in v0.11.0

func (n *JoinNode) Log() *LogNode

Create a node that logs all data it receives.

func (*JoinNode) MarshalJSON added in v1.4.0

func (n *JoinNode) MarshalJSON() ([]byte, error)

MarshalJSON converts JoinNode to JSON tick:ignore

func (*JoinNode) Max added in v0.11.0

func (n *JoinNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*JoinNode) Mean added in v0.11.0

func (n *JoinNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*JoinNode) Median added in v0.11.0

func (n *JoinNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*JoinNode) Min added in v0.11.0

func (n *JoinNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*JoinNode) Mode added in v1.0.0

func (n *JoinNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*JoinNode) MovingAverage added in v1.0.0

func (n *JoinNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*JoinNode) On added in v0.11.0

func (j *JoinNode) On(dims ...string) *JoinNode

Join on a subset of the group by dimensions. This is a special case where you want a single point from one parent to join with multiple points from a different parent.

For example given two measurements:

1. building_power (a single value) -- tagged by building, value is the total power consumed by the building. 2. floor_power (multiple values) -- tagged by building and floor, values are the total power consumed by each floor.

You want to calculate the percentage of the total building power consumed by each floor. Since you only have one point per building you need it to join multiple times with the points from each floor. By defining the `on` dimensions as `building` we are saying that we want points that only have the building tag to be joined with more specifc points that more tags, in this case the `floor` tag. In other words while we have points with tags building and floor we only want to join on the building tag.

Example:

var building = stream
    |from()
        .measurement('building_power')
        .groupBy('building')
var floor = stream
    |from()
        .measurement('floor_power')
        .groupBy('building', 'floor')
building
    |join(floor)
        .as('building', 'floor')
        .on('building')
    |eval(lambda: "floor.value" / "building.value")
        ... // Values here are grouped by 'building' and 'floor'

tick:property

func (*JoinNode) Percentile added in v0.11.0

func (n *JoinNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*JoinNode) Sample

func (n *JoinNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*JoinNode) Shift added in v0.11.0

func (n *JoinNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*JoinNode) Sideload added in v1.4.0

func (n *JoinNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*JoinNode) Spread added in v0.11.0

func (n *JoinNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*JoinNode) StateCount added in v1.3.0

func (n *JoinNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*JoinNode) StateDuration added in v1.3.0

func (n *JoinNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*JoinNode) Stddev added in v0.11.0

func (n *JoinNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*JoinNode) Sum added in v0.11.0

func (n *JoinNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*JoinNode) SwarmAutoscale added in v1.4.0

func (n *JoinNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*JoinNode) Top added in v0.11.0

func (n *JoinNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*JoinNode) Trickle added in v1.6.0

func (n *JoinNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*JoinNode) Union

func (n *JoinNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*JoinNode) UnmarshalJSON added in v1.4.0

func (n *JoinNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an JoinNode tick:ignore

func (*JoinNode) Where

func (n *JoinNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*JoinNode) Window

func (n *JoinNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type K8sAutoscaleNode added in v1.1.0

type K8sAutoscaleNode struct {

	// Cluster is the name of the Kubernetes cluster to use.
	Cluster string `json:"cluster"`

	// Namespace is the namespace of the resource, if empty the default namespace will be used.
	Namespace string `json:"namespace"`

	// Kind is the type of resources to autoscale.
	// Currently only "deployments", "replicasets" and "replicationcontrollers" are supported.
	// Default: "deployments"
	Kind string `json:"kind"`

	// ResourceName is the name of the resource to autoscale.
	ResourceName string `json:"resourceName"`

	// ResourceNameTag is the name of a tag that names the resource to autoscale.
	ResourceNameTag string `json:"resourceNameTag"`

	// CurrentField is the name of a field into which the current replica count will be set as an int.
	// If empty no field will be set.
	// Useful for computing deltas on the current state.
	//
	// Example:
	//    |k8sAutoscale()
	//        .currentField('replicas')
	//        // Increase the replicas by 1 if the qps is over the threshold
	//        .replicas(lambda: if("qps" > threshold, "replicas" + 1, "replicas"))
	//
	CurrentField string `json:"currentField"`

	// The maximum scale factor to set.
	// If 0 then there is no upper limit.
	// Default: 0, a.k.a no limit.
	Max int64 `json:"max"`

	// The minimum scale factor to set.
	// Default: 1
	Min int64 `json:"min"`

	// Replicas is a lambda expression that should evaluate to the desired number of replicas for the resource.
	Replicas *ast.LambdaNode `json:"replicas"`

	// Only one increase event can be triggered per resource every IncreaseCooldown interval.
	IncreaseCooldown time.Duration `json:"increaseCooldown"`
	// Only one decrease event can be triggered per resource every DecreaseCooldown interval.
	DecreaseCooldown time.Duration `json:"decreaseCooldown"`

	// NamespaceTag is the name of a tag to use when tagging emitted points with the namespace.
	// If empty the point will not be tagged with the resource.
	// Default: namespace
	NamespaceTag string `json:"namespaceTag"`

	// KindTag is the name of a tag to use when tagging emitted points with the kind.
	// If empty the point will not be tagged with the resource.
	// Default: kind
	KindTag string `json:"kindTag"`

	// ResourceTag is the name of a tag to use when tagging emitted points the resource.
	// If empty the point will not be tagged with the resource.
	// Default: resource
	ResourceTag string `json:"resourceTag"`
	// contains filtered or unexported fields
}

K8sAutoscaleNode triggers autoscale events for a resource on a Kubernetes cluster. The node also outputs points for the triggered events.

Example:

// Target 100 requests per second per host
var target = 100.0
var min = 1
var max = 100
var period = 5m
var every = period
stream
    |from()
        .measurement('requests')
        .groupBy('host', 'deployment')
        .truncate(1s)
    |derivative('value')
        .as('requests_per_second')
        .unit(1s)
        .nonNegative()
    |groupBy('deployment')
    |sum('requests_per_second')
        .as('total_requests')
    |window()
        .period(period)
        .every(every)
    |mean('total_requests')
        .as('total_requests')
    |k8sAutoscale()
        // Get the name of the deployment from the 'deployment' tag.
        .resourceNameTag('deployment')
        .min(min)
        .max(max)
        // Set the desired number of replicas based on target.
        .replicas(lambda: int(ceil("total_requests" / target)))
    |influxDBOut()
        .database('deployments')
        .measurement('scale_events')
        .precision('s')

The above example computes the requests per second by deployment and host. Then the total_requests per second across all hosts is computed per deployment. Using the mean of the total_requests over the last time period a desired number of replicas is computed based on the target number of request per second per host.

If the desired number of replicas has changed, Kapacitor makes the appropriate API call to Kubernetes to update the replicas spec.

Any time the k8sAutoscale node changes a replica count, it emits a point. The point is tagged with the namespace, kind and resource name, using the NamespaceTag, KindTag, and ResourceTag properties respectively. In addition the group by tags will be preserved on the emitted point. The point contains two fields: `old`, and `new` representing change in the replicas.

Available Statistics:

  • increase_events -- number of times the replica count was increased.
  • decrease_events -- number of times the replica count was decreased.
  • cooldown_drops -- number of times an event was dropped because of a cooldown timer.
  • errors -- number of errors encountered, typically related to communicating with the Kubernetes API.

func (*K8sAutoscaleNode) Alert added in v1.1.0

func (n *K8sAutoscaleNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*K8sAutoscaleNode) Barrier added in v1.4.0

func (n *K8sAutoscaleNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*K8sAutoscaleNode) Bottom added in v1.1.0

func (n *K8sAutoscaleNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*K8sAutoscaleNode) ChangeDetect added in v1.5.0

func (n *K8sAutoscaleNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*K8sAutoscaleNode) Combine added in v1.1.0

func (n *K8sAutoscaleNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*K8sAutoscaleNode) Count added in v1.1.0

func (n *K8sAutoscaleNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*K8sAutoscaleNode) CumulativeSum added in v1.1.0

func (n *K8sAutoscaleNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*K8sAutoscaleNode) Default added in v1.1.0

func (n *K8sAutoscaleNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*K8sAutoscaleNode) Delete added in v1.1.0

func (n *K8sAutoscaleNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*K8sAutoscaleNode) Derivative added in v1.1.0

func (n *K8sAutoscaleNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*K8sAutoscaleNode) Difference added in v1.1.0

func (n *K8sAutoscaleNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*K8sAutoscaleNode) Distinct added in v1.1.0

func (n *K8sAutoscaleNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*K8sAutoscaleNode) Ec2Autoscale added in v1.4.0

func (n *K8sAutoscaleNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*K8sAutoscaleNode) Elapsed added in v1.1.0

func (n *K8sAutoscaleNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*K8sAutoscaleNode) Eval added in v1.1.0

func (n *K8sAutoscaleNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*K8sAutoscaleNode) First added in v1.1.0

func (n *K8sAutoscaleNode) First(field string) *InfluxQLNode

Select the first point.

func (*K8sAutoscaleNode) Flatten added in v1.1.0

func (n *K8sAutoscaleNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*K8sAutoscaleNode) GroupBy added in v1.1.0

func (n *K8sAutoscaleNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*K8sAutoscaleNode) HoltWinters added in v1.1.0

func (n *K8sAutoscaleNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*K8sAutoscaleNode) HoltWintersWithFit added in v1.1.0

func (n *K8sAutoscaleNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*K8sAutoscaleNode) HttpOut added in v1.1.0

func (n *K8sAutoscaleNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*K8sAutoscaleNode) HttpPost added in v1.3.0

func (n *K8sAutoscaleNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*K8sAutoscaleNode) InfluxDBOut added in v1.1.0

func (n *K8sAutoscaleNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*K8sAutoscaleNode) Join added in v1.1.0

func (n *K8sAutoscaleNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*K8sAutoscaleNode) K8sAutoscale added in v1.1.0

func (n *K8sAutoscaleNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*K8sAutoscaleNode) KapacitorLoopback added in v1.3.0

func (n *K8sAutoscaleNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*K8sAutoscaleNode) Last added in v1.1.0

func (n *K8sAutoscaleNode) Last(field string) *InfluxQLNode

Select the last point.

func (*K8sAutoscaleNode) Log added in v1.1.0

func (n *K8sAutoscaleNode) Log() *LogNode

Create a node that logs all data it receives.

func (*K8sAutoscaleNode) MarshalJSON added in v1.4.0

func (n *K8sAutoscaleNode) MarshalJSON() ([]byte, error)

MarshalJSON converts K8sAutoscaleNode to JSON tick:ignore

func (*K8sAutoscaleNode) Max added in v1.1.0

func (n *K8sAutoscaleNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*K8sAutoscaleNode) Mean added in v1.1.0

func (n *K8sAutoscaleNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*K8sAutoscaleNode) Median added in v1.1.0

func (n *K8sAutoscaleNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*K8sAutoscaleNode) Min added in v1.1.0

func (n *K8sAutoscaleNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*K8sAutoscaleNode) Mode added in v1.1.0

func (n *K8sAutoscaleNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*K8sAutoscaleNode) MovingAverage added in v1.1.0

func (n *K8sAutoscaleNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*K8sAutoscaleNode) Percentile added in v1.1.0

func (n *K8sAutoscaleNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*K8sAutoscaleNode) Sample added in v1.1.0

func (n *K8sAutoscaleNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*K8sAutoscaleNode) Shift added in v1.1.0

func (n *K8sAutoscaleNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*K8sAutoscaleNode) Sideload added in v1.4.0

func (n *K8sAutoscaleNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*K8sAutoscaleNode) Spread added in v1.1.0

func (n *K8sAutoscaleNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*K8sAutoscaleNode) StateCount added in v1.3.0

func (n *K8sAutoscaleNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*K8sAutoscaleNode) StateDuration added in v1.3.0

func (n *K8sAutoscaleNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*K8sAutoscaleNode) Stddev added in v1.1.0

func (n *K8sAutoscaleNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*K8sAutoscaleNode) Sum added in v1.1.0

func (n *K8sAutoscaleNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*K8sAutoscaleNode) SwarmAutoscale added in v1.4.0

func (n *K8sAutoscaleNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*K8sAutoscaleNode) Top added in v1.1.0

func (n *K8sAutoscaleNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*K8sAutoscaleNode) Trickle added in v1.6.0

func (n *K8sAutoscaleNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*K8sAutoscaleNode) Union added in v1.1.0

func (n *K8sAutoscaleNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*K8sAutoscaleNode) UnmarshalJSON added in v1.4.0

func (n *K8sAutoscaleNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an K8sAutoscaleNode tick:ignore

func (*K8sAutoscaleNode) Where added in v1.1.0

func (n *K8sAutoscaleNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*K8sAutoscaleNode) Window added in v1.1.0

func (n *K8sAutoscaleNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type KafkaHandler added in v1.5.0

type KafkaHandler struct {
	*AlertNodeData `json:"-"`

	// Cluster is the id of the configure kafka cluster
	Cluster string `json:"cluster"`

	// Kafka Topic
	KafkaTopic string `json:"kafka-topic"`

	// If false (default), messages will be routed to partitions based on their IDs
	// If true, messages will be routed to the partition with the least data regardless of IDs
	// tick:ignore
	IsDisablePartitionById bool `tick:"DisablePartitionById" json:"disable-partition-by-id"`

	// Algorithm used to hash message IDs when determining a target partition
	//
	// Valid values are:
	//
	//    * "crc32"   - Compatible with librdkafka and confluent-kafka-go
	//    * "murmur2" - Compatible with the default Java partitioner
	//    * "fnv-1a"  - Compatible with Shopify's sarama producer
	//
	// Default: crc32
	PartitionHashAlgorithm string `json:"partition-hash-algorithm,omitempty"`

	// Template used to construct the message body
	// If empty the alert data in JSON is sent as the message body.
	// tick:ignore
	Template string `json:"template,omitempty"`
}

Kafka alert Handler tick:embedded:AlertNode.Kafka

func (KafkaHandler) Alert added in v1.5.0

func (n KafkaHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (KafkaHandler) Barrier added in v1.5.0

func (n KafkaHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (KafkaHandler) Bottom added in v1.5.0

func (n KafkaHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (KafkaHandler) ChangeDetect added in v1.5.0

func (n KafkaHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (KafkaHandler) Combine added in v1.5.0

func (n KafkaHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (KafkaHandler) Count added in v1.5.0

func (n KafkaHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (KafkaHandler) CumulativeSum added in v1.5.0

func (n KafkaHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (KafkaHandler) Default added in v1.5.0

func (n KafkaHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (KafkaHandler) Delete added in v1.5.0

func (n KafkaHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (KafkaHandler) Derivative added in v1.5.0

func (n KafkaHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (KafkaHandler) Difference added in v1.5.0

func (n KafkaHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*KafkaHandler) DisablePartitionById added in v1.6.0

func (k *KafkaHandler) DisablePartitionById() *KafkaHandler

Disables use of message IDs when determining target Kafka partitions. tick:property

func (KafkaHandler) Distinct added in v1.5.0

func (n KafkaHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (KafkaHandler) Ec2Autoscale added in v1.5.0

func (n KafkaHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (KafkaHandler) Elapsed added in v1.5.0

func (n KafkaHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (KafkaHandler) Eval added in v1.5.0

func (n KafkaHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (KafkaHandler) First added in v1.5.0

func (n KafkaHandler) First(field string) *InfluxQLNode

Select the first point.

func (KafkaHandler) Flatten added in v1.5.0

func (n KafkaHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (KafkaHandler) GroupBy added in v1.5.0

func (n KafkaHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (KafkaHandler) HoltWinters added in v1.5.0

func (n KafkaHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (KafkaHandler) HoltWintersWithFit added in v1.5.0

func (n KafkaHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (KafkaHandler) HttpOut added in v1.5.0

func (n KafkaHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (KafkaHandler) HttpPost added in v1.5.0

func (n KafkaHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (KafkaHandler) InfluxDBOut added in v1.5.0

func (n KafkaHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (KafkaHandler) Join added in v1.5.0

func (n KafkaHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (KafkaHandler) K8sAutoscale added in v1.5.0

func (n KafkaHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (KafkaHandler) KapacitorLoopback added in v1.5.0

func (n KafkaHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (KafkaHandler) Last added in v1.5.0

func (n KafkaHandler) Last(field string) *InfluxQLNode

Select the last point.

func (KafkaHandler) Max added in v1.5.0

func (n KafkaHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (KafkaHandler) Mean added in v1.5.0

func (n KafkaHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (KafkaHandler) Median added in v1.5.0

func (n KafkaHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (KafkaHandler) Min added in v1.5.0

func (n KafkaHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (KafkaHandler) Mode added in v1.5.0

func (n KafkaHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (KafkaHandler) MovingAverage added in v1.5.0

func (n KafkaHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (KafkaHandler) Percentile added in v1.5.0

func (n KafkaHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (KafkaHandler) Sample added in v1.5.0

func (n KafkaHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (KafkaHandler) Shift added in v1.5.0

func (n KafkaHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (KafkaHandler) Sideload added in v1.5.0

func (n KafkaHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (KafkaHandler) Spread added in v1.5.0

func (n KafkaHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (KafkaHandler) StateCount added in v1.5.0

func (n KafkaHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (KafkaHandler) StateDuration added in v1.5.0

func (n KafkaHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (KafkaHandler) Stddev added in v1.5.0

func (n KafkaHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (KafkaHandler) Sum added in v1.5.0

func (n KafkaHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (KafkaHandler) SwarmAutoscale added in v1.5.0

func (n KafkaHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (KafkaHandler) Top added in v1.5.0

func (n KafkaHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (KafkaHandler) Trickle added in v1.6.0

func (n KafkaHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (KafkaHandler) Union added in v1.5.0

func (n KafkaHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (KafkaHandler) Where added in v1.5.0

func (n KafkaHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (KafkaHandler) Window added in v1.5.0

func (n KafkaHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type KapacitorLoopbackNode added in v1.3.0

type KapacitorLoopbackNode struct {

	// The name of the database.
	Database string `json:"database"`
	// The name of the retention policy.
	RetentionPolicy string `json:"retention_policy"`
	// The name of the measurement.
	Measurement string `json:"measurement"`
	// Static set of tags to add to all data points before writing them.
	// tick:ignore
	Tags map[string]string `tick:"Tag" json:"tags"`
	// contains filtered or unexported fields
}

Writes the data back into the Kapacitor stream. To write data to a remote Kapacitor instance use the InfluxDBOut node.

Example:

|kapacitorLoopback()
    .database('mydb')
    .retentionPolicy('myrp')
    .measurement('errors')
    .tag('kapacitor', 'true')
    .tag('version', '0.2')

NOTE: It is possible to create infinite loops using this node. Take care to ensure you do not chain tasks together creating a loop.

Available Statistics:

  • points_written -- number of points written back to Kapacitor

func (*KapacitorLoopbackNode) Children added in v1.3.0

func (n *KapacitorLoopbackNode) Children() []Node

tick:ignore

func (*KapacitorLoopbackNode) Deadman added in v1.3.0

func (n *KapacitorLoopbackNode) Deadman(threshold float64, interval time.Duration, expr ...*ast.LambdaNode) *AlertNode

Helper function for creating an alert on low throughput, a.k.a. deadman's switch.

- Threshold -- trigger alert if throughput drops below threshold in points/interval. - Interval -- how often to check the throughput. - Expressions -- optional list of expressions to also evaluate. Useful for time of day alerting.

Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
//Do normal processing of data
data...

The above is equivalent to this Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |stats(10s)
        .align()
    |derivative('emitted')
        .unit(10s)
        .nonNegative()
    |alert()
        .id('node \'stream0\' in task \'{{ .TaskName }}\'')
        .message('{{ .ID }} is {{ if eq .Level "OK" }}alive{{ else }}dead{{ end }}: {{ index .Fields "emitted" | printf "%0.3f" }} points/10s.')
        .crit(lambda: "emitted" <= 100.0)
//Do normal processing of data
data...

The `id` and `message` alert properties can be configured globally via the 'deadman' configuration section.

Since the AlertNode is the last piece it can be further modified as usual. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
        .slack()
        .channel('#dead_tasks')
//Do normal processing of data
data...

You can specify additional lambda expressions to further constrain when the deadman's switch is triggered. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
// Only trigger the alert if the time of day is between 8am-5pm.
data
    |deadman(100.0, 10s, lambda: hour("time") >= 8 AND hour("time") <= 17)
//Do normal processing of data
data...

func (*KapacitorLoopbackNode) Desc added in v1.3.0

func (n *KapacitorLoopbackNode) Desc() string

tick:ignore

func (*KapacitorLoopbackNode) ID added in v1.3.0

func (n *KapacitorLoopbackNode) ID() ID

tick:ignore

func (*KapacitorLoopbackNode) IsQuiet added in v1.5.0

func (n *KapacitorLoopbackNode) IsQuiet() bool

tick:ignore

func (*KapacitorLoopbackNode) MarshalJSON added in v1.4.0

func (n *KapacitorLoopbackNode) MarshalJSON() ([]byte, error)

MarshalJSON converts KapacitorLoopbackNode to JSON tick:ignore

func (*KapacitorLoopbackNode) Name added in v1.3.0

func (n *KapacitorLoopbackNode) Name() string

tick:ignore

func (*KapacitorLoopbackNode) Parents added in v1.3.0

func (n *KapacitorLoopbackNode) Parents() []Node

tick:ignore

func (*KapacitorLoopbackNode) Provides added in v1.3.0

func (n *KapacitorLoopbackNode) Provides() EdgeType

tick:ignore

func (*KapacitorLoopbackNode) Quiet added in v1.5.0

func (n *KapacitorLoopbackNode) Quiet()

Quiet suppresses all error logging events from this node. tick:property

func (*KapacitorLoopbackNode) SetName added in v1.3.0

func (n *KapacitorLoopbackNode) SetName(name string)

tick:ignore

func (*KapacitorLoopbackNode) Stats added in v1.3.0

func (n *KapacitorLoopbackNode) Stats(interval time.Duration) *StatsNode

Create a new stream of data that contains the internal statistics of the node. The interval represents how often to emit the statistics based on real time. This means the interval time is independent of the times of the data points the source node is receiving.

func (*KapacitorLoopbackNode) Tag added in v1.3.0

Add a static tag to all data points. Tag can be called more than once.

tick:property

func (*KapacitorLoopbackNode) UnmarshalJSON added in v1.4.0

func (n *KapacitorLoopbackNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an KapacitorLoopbackNode tick:ignore

func (*KapacitorLoopbackNode) Wants added in v1.3.0

func (n *KapacitorLoopbackNode) Wants() EdgeType

tick:ignore

type Link struct {
	Href string `json:"href"`
	Text string `json:"text"`
}

tick:ignore

type LogHandler added in v0.2.4

type LogHandler struct {
	*AlertNodeData `json:"-"`

	// Absolute path the the log file.
	// It will be created if it does not exist.
	// tick:ignore
	FilePath string `json:"filePath"`

	// File's mode and permissions, default is 0600
	// NOTE: The leading 0 is required to interpret the value as an octal integer.
	Mode int64 `json:"mode"`
}

tick:embedded:AlertNode.Log

func (LogHandler) Alert added in v0.13.0

func (n LogHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (LogHandler) Barrier added in v1.4.0

func (n LogHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (LogHandler) Bottom added in v0.13.0

func (n LogHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (LogHandler) ChangeDetect added in v1.5.0

func (n LogHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (LogHandler) Combine added in v1.0.0

func (n LogHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (LogHandler) Count added in v0.13.0

func (n LogHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (LogHandler) CumulativeSum added in v1.1.0

func (n LogHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (LogHandler) Default added in v0.13.0

func (n LogHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (LogHandler) Delete added in v1.0.0

func (n LogHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (LogHandler) Derivative added in v0.13.0

func (n LogHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (LogHandler) Difference added in v1.0.0

func (n LogHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (LogHandler) Distinct added in v0.13.0

func (n LogHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (LogHandler) Ec2Autoscale added in v1.4.0

func (n LogHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (LogHandler) Elapsed added in v0.13.0

func (n LogHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (LogHandler) Eval added in v0.13.0

func (n LogHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (LogHandler) First added in v0.13.0

func (n LogHandler) First(field string) *InfluxQLNode

Select the first point.

func (LogHandler) Flatten added in v1.0.0

func (n LogHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (LogHandler) GroupBy added in v0.13.0

func (n LogHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (LogHandler) HoltWinters added in v1.0.0

func (n LogHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (LogHandler) HoltWintersWithFit added in v1.0.0

func (n LogHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (LogHandler) HttpOut added in v0.13.0

func (n LogHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (LogHandler) HttpPost added in v1.3.0

func (n LogHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (LogHandler) InfluxDBOut added in v0.13.0

func (n LogHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (LogHandler) Join added in v0.13.0

func (n LogHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (LogHandler) K8sAutoscale added in v1.1.0

func (n LogHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (LogHandler) KapacitorLoopback added in v1.3.0

func (n LogHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (LogHandler) Last added in v0.13.0

func (n LogHandler) Last(field string) *InfluxQLNode

Select the last point.

func (LogHandler) Max added in v0.13.0

func (n LogHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (LogHandler) Mean added in v0.13.0

func (n LogHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (LogHandler) Median added in v0.13.0

func (n LogHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (LogHandler) Min added in v0.13.0

func (n LogHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (LogHandler) Mode added in v0.12.0

func (n LogHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (LogHandler) MovingAverage added in v1.0.0

func (n LogHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (LogHandler) Percentile added in v0.13.0

func (n LogHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (LogHandler) Sample added in v0.13.0

func (n LogHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (LogHandler) Shift added in v0.13.0

func (n LogHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (LogHandler) Sideload added in v1.4.0

func (n LogHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (LogHandler) Spread added in v0.13.0

func (n LogHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (LogHandler) StateCount added in v1.3.0

func (n LogHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (LogHandler) StateDuration added in v1.3.0

func (n LogHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (LogHandler) Stddev added in v0.13.0

func (n LogHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (LogHandler) Sum added in v0.13.0

func (n LogHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (LogHandler) SwarmAutoscale added in v1.4.0

func (n LogHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (LogHandler) Top added in v0.13.0

func (n LogHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (LogHandler) Trickle added in v1.6.0

func (n LogHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (LogHandler) Union added in v0.13.0

func (n LogHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (LogHandler) Where added in v0.13.0

func (n LogHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (LogHandler) Window added in v0.13.0

func (n LogHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type LogNode added in v0.11.0

type LogNode struct {

	// The level at which to log the data.
	// One of: DEBUG, INFO, WARN, ERROR
	// Default: INFO
	Level string `json:"level"`
	// Optional prefix to add to all log messages
	Prefix string `json:"prefix"`
	// contains filtered or unexported fields
}

A node that logs all data that passes through the node.

Example:

stream.from()...
  |window()
      .period(10s)
      .every(10s)
  |log()
  |count('value')

func (*LogNode) Alert added in v0.11.0

func (n *LogNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*LogNode) Barrier added in v1.4.0

func (n *LogNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*LogNode) Bottom added in v0.11.0

func (n *LogNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*LogNode) ChangeDetect added in v1.5.0

func (n *LogNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*LogNode) Combine added in v1.0.0

func (n *LogNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*LogNode) Count added in v0.11.0

func (n *LogNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*LogNode) CumulativeSum added in v1.1.0

func (n *LogNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*LogNode) Default added in v0.13.0

func (n *LogNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*LogNode) Delete added in v1.0.0

func (n *LogNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*LogNode) Derivative added in v0.11.0

func (n *LogNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*LogNode) Difference added in v1.0.0

func (n *LogNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*LogNode) Distinct added in v0.11.0

func (n *LogNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*LogNode) Ec2Autoscale added in v1.4.0

func (n *LogNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*LogNode) Elapsed added in v0.13.0

func (n *LogNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*LogNode) Eval added in v0.11.0

func (n *LogNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*LogNode) First added in v0.11.0

func (n *LogNode) First(field string) *InfluxQLNode

Select the first point.

func (*LogNode) Flatten added in v1.0.0

func (n *LogNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*LogNode) GroupBy added in v0.11.0

func (n *LogNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*LogNode) HoltWinters added in v1.0.0

func (n *LogNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*LogNode) HoltWintersWithFit added in v1.0.0

func (n *LogNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*LogNode) HttpOut added in v0.11.0

func (n *LogNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*LogNode) HttpPost added in v1.3.0

func (n *LogNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*LogNode) InfluxDBOut added in v0.11.0

func (n *LogNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*LogNode) Join added in v0.11.0

func (n *LogNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*LogNode) K8sAutoscale added in v1.1.0

func (n *LogNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*LogNode) KapacitorLoopback added in v1.3.0

func (n *LogNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*LogNode) Last added in v0.11.0

func (n *LogNode) Last(field string) *InfluxQLNode

Select the last point.

func (*LogNode) Log added in v0.11.0

func (n *LogNode) Log() *LogNode

Create a node that logs all data it receives.

func (*LogNode) MarshalJSON added in v1.4.0

func (n *LogNode) MarshalJSON() ([]byte, error)

MarshalJSON converts LogNode to JSON tick:ignore

func (*LogNode) Max added in v0.11.0

func (n *LogNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*LogNode) Mean added in v0.11.0

func (n *LogNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*LogNode) Median added in v0.11.0

func (n *LogNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*LogNode) Min added in v0.11.0

func (n *LogNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*LogNode) Mode added in v1.0.0

func (n *LogNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*LogNode) MovingAverage added in v1.0.0

func (n *LogNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*LogNode) Percentile added in v0.11.0

func (n *LogNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*LogNode) Sample added in v0.11.0

func (n *LogNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*LogNode) Shift added in v0.11.0

func (n *LogNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*LogNode) Sideload added in v1.4.0

func (n *LogNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*LogNode) Spread added in v0.11.0

func (n *LogNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*LogNode) StateCount added in v1.3.0

func (n *LogNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*LogNode) StateDuration added in v1.3.0

func (n *LogNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*LogNode) Stddev added in v0.11.0

func (n *LogNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*LogNode) Sum added in v0.11.0

func (n *LogNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*LogNode) SwarmAutoscale added in v1.4.0

func (n *LogNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*LogNode) Top added in v0.11.0

func (n *LogNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*LogNode) Trickle added in v1.6.0

func (n *LogNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*LogNode) Union added in v0.11.0

func (n *LogNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*LogNode) UnmarshalJSON added in v1.4.0

func (n *LogNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an LogNode tick:ignore

func (*LogNode) Where added in v0.11.0

func (n *LogNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*LogNode) Window added in v0.11.0

func (n *LogNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type MQTTHandler added in v1.4.0

type MQTTHandler struct {
	*AlertNodeData `json:"-"`

	// BrokerName is the name of the configured MQTT broker to use when publishing the alert.
	// If empty defaults to the configured default broker.
	BrokerName string `json:"brokerName"`

	// The topic where alerts will be dispatched to
	Topic string `json:"topic"`

	// The Qos that will be used to deliver the alerts
	//
	// Valid values are:
	//
	//    * 0 - At most once delivery
	//    * 1 - At least once delivery
	//    * 2 - Exactly once delivery
	//
	Qos int64 `json:"qos"`

	// Retained indicates whether this alert should be delivered to
	// clients that were not connected to the broker at the time of the alert.
	Retained bool `json:"retained"`
}

tick:embedded:AlertNode.Mqtt

func (MQTTHandler) Alert added in v1.4.0

func (n MQTTHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (MQTTHandler) Barrier added in v1.4.0

func (n MQTTHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (MQTTHandler) Bottom added in v1.4.0

func (n MQTTHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (MQTTHandler) ChangeDetect added in v1.5.0

func (n MQTTHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (MQTTHandler) Combine added in v1.4.0

func (n MQTTHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (MQTTHandler) Count added in v1.4.0

func (n MQTTHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (MQTTHandler) CumulativeSum added in v1.4.0

func (n MQTTHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (MQTTHandler) Default added in v1.4.0

func (n MQTTHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (MQTTHandler) Delete added in v1.4.0

func (n MQTTHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (MQTTHandler) Derivative added in v1.4.0

func (n MQTTHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (MQTTHandler) Difference added in v1.4.0

func (n MQTTHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (MQTTHandler) Distinct added in v1.4.0

func (n MQTTHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (MQTTHandler) Ec2Autoscale added in v1.4.0

func (n MQTTHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (MQTTHandler) Elapsed added in v1.4.0

func (n MQTTHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (MQTTHandler) Eval added in v1.4.0

func (n MQTTHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (MQTTHandler) First added in v1.4.0

func (n MQTTHandler) First(field string) *InfluxQLNode

Select the first point.

func (MQTTHandler) Flatten added in v1.4.0

func (n MQTTHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (MQTTHandler) GroupBy added in v1.4.0

func (n MQTTHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (MQTTHandler) HoltWinters added in v1.4.0

func (n MQTTHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (MQTTHandler) HoltWintersWithFit added in v1.4.0

func (n MQTTHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (MQTTHandler) HttpOut added in v1.4.0

func (n MQTTHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (MQTTHandler) HttpPost added in v1.4.0

func (n MQTTHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (MQTTHandler) InfluxDBOut added in v1.4.0

func (n MQTTHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (MQTTHandler) Join added in v1.4.0

func (n MQTTHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (MQTTHandler) K8sAutoscale added in v1.4.0

func (n MQTTHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (MQTTHandler) KapacitorLoopback added in v1.4.0

func (n MQTTHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (MQTTHandler) Last added in v1.4.0

func (n MQTTHandler) Last(field string) *InfluxQLNode

Select the last point.

func (MQTTHandler) Max added in v1.4.0

func (n MQTTHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (MQTTHandler) Mean added in v1.4.0

func (n MQTTHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (MQTTHandler) Median added in v1.4.0

func (n MQTTHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (MQTTHandler) Min added in v1.4.0

func (n MQTTHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (MQTTHandler) Mode added in v1.4.0

func (n MQTTHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (MQTTHandler) MovingAverage added in v1.4.0

func (n MQTTHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (MQTTHandler) Percentile added in v1.4.0

func (n MQTTHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (MQTTHandler) Sample added in v1.4.0

func (n MQTTHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (MQTTHandler) Shift added in v1.4.0

func (n MQTTHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (MQTTHandler) Sideload added in v1.4.0

func (n MQTTHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (MQTTHandler) Spread added in v1.4.0

func (n MQTTHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (MQTTHandler) StateCount added in v1.4.0

func (n MQTTHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (MQTTHandler) StateDuration added in v1.4.0

func (n MQTTHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (MQTTHandler) Stddev added in v1.4.0

func (n MQTTHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (MQTTHandler) Sum added in v1.4.0

func (n MQTTHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (MQTTHandler) SwarmAutoscale added in v1.4.0

func (n MQTTHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (MQTTHandler) Top added in v1.4.0

func (n MQTTHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (MQTTHandler) Trickle added in v1.6.0

func (n MQTTHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (MQTTHandler) Union added in v1.4.0

func (n MQTTHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (MQTTHandler) Where added in v1.4.0

func (n MQTTHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (MQTTHandler) Window added in v1.4.0

func (n MQTTHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type NoOpNode added in v0.11.0

type NoOpNode struct {
	// contains filtered or unexported fields
}

A node that does not perform any operation.

*Do not use this node in a TICKscript there should be no need for it.*

If a node does not have any children, then its emitted count remains zero. Using a NoOpNode is a work around so that statistics are accurately reported for nodes with no real children. A NoOpNode is automatically appended to any node that is a source for a StatsNode and does not have any children.

func (*NoOpNode) Alert added in v0.11.0

func (n *NoOpNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*NoOpNode) Barrier added in v1.4.0

func (n *NoOpNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*NoOpNode) Bottom added in v0.11.0

func (n *NoOpNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*NoOpNode) ChangeDetect added in v1.5.0

func (n *NoOpNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*NoOpNode) Combine added in v1.0.0

func (n *NoOpNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*NoOpNode) Count added in v0.11.0

func (n *NoOpNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*NoOpNode) CumulativeSum added in v1.1.0

func (n *NoOpNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*NoOpNode) Default added in v0.13.0

func (n *NoOpNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*NoOpNode) Delete added in v1.0.0

func (n *NoOpNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*NoOpNode) Derivative added in v0.11.0

func (n *NoOpNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*NoOpNode) Difference added in v1.0.0

func (n *NoOpNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*NoOpNode) Distinct added in v0.11.0

func (n *NoOpNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*NoOpNode) Ec2Autoscale added in v1.4.0

func (n *NoOpNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*NoOpNode) Elapsed added in v0.13.0

func (n *NoOpNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*NoOpNode) Eval added in v0.11.0

func (n *NoOpNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*NoOpNode) First added in v0.11.0

func (n *NoOpNode) First(field string) *InfluxQLNode

Select the first point.

func (*NoOpNode) Flatten added in v1.0.0

func (n *NoOpNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*NoOpNode) GroupBy added in v0.11.0

func (n *NoOpNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*NoOpNode) HoltWinters added in v1.0.0

func (n *NoOpNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*NoOpNode) HoltWintersWithFit added in v1.0.0

func (n *NoOpNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*NoOpNode) HttpOut added in v0.11.0

func (n *NoOpNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*NoOpNode) HttpPost added in v1.3.0

func (n *NoOpNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*NoOpNode) InfluxDBOut added in v0.11.0

func (n *NoOpNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*NoOpNode) Join added in v0.11.0

func (n *NoOpNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*NoOpNode) K8sAutoscale added in v1.1.0

func (n *NoOpNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*NoOpNode) KapacitorLoopback added in v1.3.0

func (n *NoOpNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*NoOpNode) Last added in v0.11.0

func (n *NoOpNode) Last(field string) *InfluxQLNode

Select the last point.

func (*NoOpNode) Log added in v0.11.0

func (n *NoOpNode) Log() *LogNode

Create a node that logs all data it receives.

func (*NoOpNode) MarshalJSON added in v1.4.0

func (n *NoOpNode) MarshalJSON() ([]byte, error)

tick:ignore

func (*NoOpNode) Max added in v0.11.0

func (n *NoOpNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*NoOpNode) Mean added in v0.11.0

func (n *NoOpNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*NoOpNode) Median added in v0.11.0

func (n *NoOpNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*NoOpNode) Min added in v0.11.0

func (n *NoOpNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*NoOpNode) Mode added in v1.0.0

func (n *NoOpNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*NoOpNode) MovingAverage added in v1.0.0

func (n *NoOpNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*NoOpNode) Percentile added in v0.11.0

func (n *NoOpNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*NoOpNode) Sample added in v0.11.0

func (n *NoOpNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*NoOpNode) Shift added in v0.11.0

func (n *NoOpNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*NoOpNode) Sideload added in v1.4.0

func (n *NoOpNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*NoOpNode) Spread added in v0.11.0

func (n *NoOpNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*NoOpNode) StateCount added in v1.3.0

func (n *NoOpNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*NoOpNode) StateDuration added in v1.3.0

func (n *NoOpNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*NoOpNode) Stddev added in v0.11.0

func (n *NoOpNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*NoOpNode) Sum added in v0.11.0

func (n *NoOpNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*NoOpNode) SwarmAutoscale added in v1.4.0

func (n *NoOpNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*NoOpNode) Top added in v0.11.0

func (n *NoOpNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*NoOpNode) Trickle added in v1.6.0

func (n *NoOpNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*NoOpNode) Union added in v0.11.0

func (n *NoOpNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*NoOpNode) UnmarshalJSON added in v1.4.0

func (n *NoOpNode) UnmarshalJSON(data []byte) error

tick:ignore

func (*NoOpNode) Where added in v0.11.0

func (n *NoOpNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*NoOpNode) Window added in v0.11.0

func (n *NoOpNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type Node

type Node interface {
	// List of parents of this node.
	Parents() []Node
	// List of children of this node.
	Children() []Node

	// Short description of the node does not need to be unique
	Desc() string

	// Friendly readable unique name of the node
	Name() string
	SetName(string)

	// Unique id for the node
	ID() ID

	// The type of input the node wants.
	Wants() EdgeType
	// The type of output the node provides.
	Provides() EdgeType

	// IsQuiet reports whether the node should suppress all errors during evaluation.
	IsQuiet() bool
	// contains filtered or unexported methods
}

Generic node in a pipeline

type OpsGenie2Handler added in v1.5.0

type OpsGenie2Handler struct {
	*AlertNodeData `json:"-"`

	// OpsGenie2 Teams.
	// tick:ignore
	TeamsList []string `tick:"Teams" json:"teams"`

	// OpsGenie2 Recipients.
	// tick:ignore
	RecipientsList []string `tick:"Recipients" json:"recipients"`

	// OpsGenie2 recovery_action
	// tick:ignore
	RecoveryActionString string `tick:"RecoveryAction" json:"recovery_action"`

	// OpsGenie2 details
	// tick:ignore
	IsDetails bool `tick:"Details" json:"details"`
}

tick:embedded:AlertNode.OpsGenie2

func (OpsGenie2Handler) Alert added in v1.5.0

func (n OpsGenie2Handler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (OpsGenie2Handler) Barrier added in v1.5.0

func (n OpsGenie2Handler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (OpsGenie2Handler) Bottom added in v1.5.0

func (n OpsGenie2Handler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (OpsGenie2Handler) ChangeDetect added in v1.5.0

func (n OpsGenie2Handler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (OpsGenie2Handler) Combine added in v1.5.0

func (n OpsGenie2Handler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (OpsGenie2Handler) Count added in v1.5.0

func (n OpsGenie2Handler) Count(field string) *InfluxQLNode

Count the number of points.

func (OpsGenie2Handler) CumulativeSum added in v1.5.0

func (n OpsGenie2Handler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (OpsGenie2Handler) Default added in v1.5.0

func (n OpsGenie2Handler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (OpsGenie2Handler) Delete added in v1.5.0

func (n OpsGenie2Handler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (OpsGenie2Handler) Derivative added in v1.5.0

func (n OpsGenie2Handler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*OpsGenie2Handler) Details added in v1.5.8

func (og *OpsGenie2Handler) Details() *OpsGenie2Handler

The action to perform when the alarm recovers. If empty defaults to the recovery_action from the configuration. tick:property

func (OpsGenie2Handler) Difference added in v1.5.0

func (n OpsGenie2Handler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (OpsGenie2Handler) Distinct added in v1.5.0

func (n OpsGenie2Handler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (OpsGenie2Handler) Ec2Autoscale added in v1.5.0

func (n OpsGenie2Handler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (OpsGenie2Handler) Elapsed added in v1.5.0

func (n OpsGenie2Handler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (OpsGenie2Handler) Eval added in v1.5.0

func (n OpsGenie2Handler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (OpsGenie2Handler) First added in v1.5.0

func (n OpsGenie2Handler) First(field string) *InfluxQLNode

Select the first point.

func (OpsGenie2Handler) Flatten added in v1.5.0

func (n OpsGenie2Handler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (OpsGenie2Handler) GroupBy added in v1.5.0

func (n OpsGenie2Handler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (OpsGenie2Handler) HoltWinters added in v1.5.0

func (n OpsGenie2Handler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (OpsGenie2Handler) HoltWintersWithFit added in v1.5.0

func (n OpsGenie2Handler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (OpsGenie2Handler) HttpOut added in v1.5.0

func (n OpsGenie2Handler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (OpsGenie2Handler) HttpPost added in v1.5.0

func (n OpsGenie2Handler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (OpsGenie2Handler) InfluxDBOut added in v1.5.0

func (n OpsGenie2Handler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (OpsGenie2Handler) Join added in v1.5.0

func (n OpsGenie2Handler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (OpsGenie2Handler) K8sAutoscale added in v1.5.0

func (n OpsGenie2Handler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (OpsGenie2Handler) KapacitorLoopback added in v1.5.0

func (n OpsGenie2Handler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (OpsGenie2Handler) Last added in v1.5.0

func (n OpsGenie2Handler) Last(field string) *InfluxQLNode

Select the last point.

func (OpsGenie2Handler) Max added in v1.5.0

func (n OpsGenie2Handler) Max(field string) *InfluxQLNode

Select the maximum point.

func (OpsGenie2Handler) Mean added in v1.5.0

func (n OpsGenie2Handler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (OpsGenie2Handler) Median added in v1.5.0

func (n OpsGenie2Handler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (OpsGenie2Handler) Min added in v1.5.0

func (n OpsGenie2Handler) Min(field string) *InfluxQLNode

Select the minimum point.

func (OpsGenie2Handler) Mode added in v1.5.0

func (n OpsGenie2Handler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (OpsGenie2Handler) MovingAverage added in v1.5.0

func (n OpsGenie2Handler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (OpsGenie2Handler) Percentile added in v1.5.0

func (n OpsGenie2Handler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*OpsGenie2Handler) Recipients added in v1.5.0

func (og *OpsGenie2Handler) Recipients(recipients ...string) *OpsGenie2Handler

The list of recipients to be alerted. If empty defaults to the recipients from the configuration. tick:property

func (*OpsGenie2Handler) RecoveryAction added in v1.5.7

func (og *OpsGenie2Handler) RecoveryAction(recoveryAction string) *OpsGenie2Handler

The action to perform when the alarm recovers. If empty defaults to the recovery_action from the configuration. tick:property

func (OpsGenie2Handler) Sample added in v1.5.0

func (n OpsGenie2Handler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (OpsGenie2Handler) Shift added in v1.5.0

func (n OpsGenie2Handler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (OpsGenie2Handler) Sideload added in v1.5.0

func (n OpsGenie2Handler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (OpsGenie2Handler) Spread added in v1.5.0

func (n OpsGenie2Handler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (OpsGenie2Handler) StateCount added in v1.5.0

func (n OpsGenie2Handler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (OpsGenie2Handler) StateDuration added in v1.5.0

func (n OpsGenie2Handler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (OpsGenie2Handler) Stddev added in v1.5.0

func (n OpsGenie2Handler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (OpsGenie2Handler) Sum added in v1.5.0

func (n OpsGenie2Handler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (OpsGenie2Handler) SwarmAutoscale added in v1.5.0

func (n OpsGenie2Handler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*OpsGenie2Handler) Teams added in v1.5.0

func (og *OpsGenie2Handler) Teams(teams ...string) *OpsGenie2Handler

The list of teams to be alerted. If empty defaults to the teams from the configuration. tick:property

func (OpsGenie2Handler) Top added in v1.5.0

func (n OpsGenie2Handler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (OpsGenie2Handler) Trickle added in v1.6.0

func (n OpsGenie2Handler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (OpsGenie2Handler) Union added in v1.5.0

func (n OpsGenie2Handler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (OpsGenie2Handler) Where added in v1.5.0

func (n OpsGenie2Handler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (OpsGenie2Handler) Window added in v1.5.0

func (n OpsGenie2Handler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type OpsGenieHandler added in v0.2.4

type OpsGenieHandler struct {
	*AlertNodeData `json:"-"`

	// OpsGenie Teams.
	// tick:ignore
	TeamsList []string `tick:"Teams" json:"teams"`

	// OpsGenie Recipients.
	// tick:ignore
	RecipientsList []string `tick:"Recipients" json:"recipients"`
}

tick:embedded:AlertNode.OpsGenie

func (OpsGenieHandler) Alert added in v0.13.0

func (n OpsGenieHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (OpsGenieHandler) Barrier added in v1.4.0

func (n OpsGenieHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (OpsGenieHandler) Bottom added in v0.13.0

func (n OpsGenieHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (OpsGenieHandler) ChangeDetect added in v1.5.0

func (n OpsGenieHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (OpsGenieHandler) Combine added in v1.0.0

func (n OpsGenieHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (OpsGenieHandler) Count added in v0.13.0

func (n OpsGenieHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (OpsGenieHandler) CumulativeSum added in v1.1.0

func (n OpsGenieHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (OpsGenieHandler) Default added in v0.13.0

func (n OpsGenieHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (OpsGenieHandler) Delete added in v1.0.0

func (n OpsGenieHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (OpsGenieHandler) Derivative added in v0.13.0

func (n OpsGenieHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (OpsGenieHandler) Difference added in v1.0.0

func (n OpsGenieHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (OpsGenieHandler) Distinct added in v0.13.0

func (n OpsGenieHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (OpsGenieHandler) Ec2Autoscale added in v1.4.0

func (n OpsGenieHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (OpsGenieHandler) Elapsed added in v0.13.0

func (n OpsGenieHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (OpsGenieHandler) Eval added in v0.13.0

func (n OpsGenieHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (OpsGenieHandler) First added in v0.13.0

func (n OpsGenieHandler) First(field string) *InfluxQLNode

Select the first point.

func (OpsGenieHandler) Flatten added in v1.0.0

func (n OpsGenieHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (OpsGenieHandler) GroupBy added in v0.13.0

func (n OpsGenieHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (OpsGenieHandler) HoltWinters added in v1.0.0

func (n OpsGenieHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (OpsGenieHandler) HoltWintersWithFit added in v1.0.0

func (n OpsGenieHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (OpsGenieHandler) HttpOut added in v0.13.0

func (n OpsGenieHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (OpsGenieHandler) HttpPost added in v1.3.0

func (n OpsGenieHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (OpsGenieHandler) InfluxDBOut added in v0.13.0

func (n OpsGenieHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (OpsGenieHandler) Join added in v0.13.0

func (n OpsGenieHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (OpsGenieHandler) K8sAutoscale added in v1.1.0

func (n OpsGenieHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (OpsGenieHandler) KapacitorLoopback added in v1.3.0

func (n OpsGenieHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (OpsGenieHandler) Last added in v0.13.0

func (n OpsGenieHandler) Last(field string) *InfluxQLNode

Select the last point.

func (OpsGenieHandler) Max added in v0.13.0

func (n OpsGenieHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (OpsGenieHandler) Mean added in v0.13.0

func (n OpsGenieHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (OpsGenieHandler) Median added in v0.13.0

func (n OpsGenieHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (OpsGenieHandler) Min added in v0.13.0

func (n OpsGenieHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (OpsGenieHandler) Mode added in v1.0.0

func (n OpsGenieHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (OpsGenieHandler) MovingAverage added in v1.0.0

func (n OpsGenieHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (OpsGenieHandler) Percentile added in v0.13.0

func (n OpsGenieHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*OpsGenieHandler) Recipients added in v0.2.4

func (og *OpsGenieHandler) Recipients(recipients ...string) *OpsGenieHandler

The list of recipients to be alerted. If empty defaults to the recipients from the configuration. tick:property

func (OpsGenieHandler) Sample added in v0.13.0

func (n OpsGenieHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (OpsGenieHandler) Shift added in v0.13.0

func (n OpsGenieHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (OpsGenieHandler) Sideload added in v1.4.0

func (n OpsGenieHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (OpsGenieHandler) Spread added in v0.13.0

func (n OpsGenieHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (OpsGenieHandler) StateCount added in v1.3.0

func (n OpsGenieHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (OpsGenieHandler) StateDuration added in v1.3.0

func (n OpsGenieHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (OpsGenieHandler) Stddev added in v0.13.0

func (n OpsGenieHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (OpsGenieHandler) Sum added in v0.13.0

func (n OpsGenieHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (OpsGenieHandler) SwarmAutoscale added in v1.4.0

func (n OpsGenieHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*OpsGenieHandler) Teams added in v0.2.4

func (og *OpsGenieHandler) Teams(teams ...string) *OpsGenieHandler

The list of teams to be alerted. If empty defaults to the teams from the configuration. tick:property

func (OpsGenieHandler) Top added in v0.13.0

func (n OpsGenieHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (OpsGenieHandler) Trickle added in v1.6.0

func (n OpsGenieHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (OpsGenieHandler) Union added in v0.13.0

func (n OpsGenieHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (OpsGenieHandler) Where added in v0.13.0

func (n OpsGenieHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (OpsGenieHandler) Window added in v0.13.0

func (n OpsGenieHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type PagerDuty2Handler added in v1.5.0

type PagerDuty2Handler struct {
	*AlertNodeData `json:"-"`

	// The routing key to use for the alert.
	// Defaults to the value in the configuration if empty.
	RoutingKey string `json:"routingKey"`
	// tick:ignore
	Links []Link `tick:"Link" json:"links"`
	// contains filtered or unexported fields
}

tick:embedded:AlertNode.PagerDuty

func (PagerDuty2Handler) Alert added in v1.5.0

func (n PagerDuty2Handler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (PagerDuty2Handler) Barrier added in v1.5.0

func (n PagerDuty2Handler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (PagerDuty2Handler) Bottom added in v1.5.0

func (n PagerDuty2Handler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (PagerDuty2Handler) ChangeDetect added in v1.5.0

func (n PagerDuty2Handler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (PagerDuty2Handler) Combine added in v1.5.0

func (n PagerDuty2Handler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (PagerDuty2Handler) Count added in v1.5.0

func (n PagerDuty2Handler) Count(field string) *InfluxQLNode

Count the number of points.

func (PagerDuty2Handler) CumulativeSum added in v1.5.0

func (n PagerDuty2Handler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (PagerDuty2Handler) Default added in v1.5.0

func (n PagerDuty2Handler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (PagerDuty2Handler) Delete added in v1.5.0

func (n PagerDuty2Handler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (PagerDuty2Handler) Derivative added in v1.5.0

func (n PagerDuty2Handler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (PagerDuty2Handler) Difference added in v1.5.0

func (n PagerDuty2Handler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (PagerDuty2Handler) Distinct added in v1.5.0

func (n PagerDuty2Handler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (PagerDuty2Handler) Ec2Autoscale added in v1.5.0

func (n PagerDuty2Handler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (PagerDuty2Handler) Elapsed added in v1.5.0

func (n PagerDuty2Handler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (PagerDuty2Handler) Eval added in v1.5.0

func (n PagerDuty2Handler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (PagerDuty2Handler) First added in v1.5.0

func (n PagerDuty2Handler) First(field string) *InfluxQLNode

Select the first point.

func (PagerDuty2Handler) Flatten added in v1.5.0

func (n PagerDuty2Handler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (PagerDuty2Handler) GroupBy added in v1.5.0

func (n PagerDuty2Handler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (PagerDuty2Handler) HoltWinters added in v1.5.0

func (n PagerDuty2Handler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (PagerDuty2Handler) HoltWintersWithFit added in v1.5.0

func (n PagerDuty2Handler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (PagerDuty2Handler) HttpOut added in v1.5.0

func (n PagerDuty2Handler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (PagerDuty2Handler) HttpPost added in v1.5.0

func (n PagerDuty2Handler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (PagerDuty2Handler) InfluxDBOut added in v1.5.0

func (n PagerDuty2Handler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (PagerDuty2Handler) Join added in v1.5.0

func (n PagerDuty2Handler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (PagerDuty2Handler) K8sAutoscale added in v1.5.0

func (n PagerDuty2Handler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (PagerDuty2Handler) KapacitorLoopback added in v1.5.0

func (n PagerDuty2Handler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (PagerDuty2Handler) Last added in v1.5.0

func (n PagerDuty2Handler) Last(field string) *InfluxQLNode

Select the last point.

func (pd2 *PagerDuty2Handler) Link(url string, text ...string) *PagerDuty2Handler

Set a link to be reported to pagerduty

Example:

stream
  |alert()
    .pagerduty2()
      .link('https://grafana.example.com/dashboard/db/thechart', 'Overview Graph')
      .link('https://grafana.example.com/dashboard/db/service_{{ .index Tags "service" }}', 'Service Graph')
      .link('https://grafana.example.com/')

tick:property

func (PagerDuty2Handler) Max added in v1.5.0

func (n PagerDuty2Handler) Max(field string) *InfluxQLNode

Select the maximum point.

func (PagerDuty2Handler) Mean added in v1.5.0

func (n PagerDuty2Handler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (PagerDuty2Handler) Median added in v1.5.0

func (n PagerDuty2Handler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (PagerDuty2Handler) Min added in v1.5.0

func (n PagerDuty2Handler) Min(field string) *InfluxQLNode

Select the minimum point.

func (PagerDuty2Handler) Mode added in v1.5.0

func (n PagerDuty2Handler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (PagerDuty2Handler) MovingAverage added in v1.5.0

func (n PagerDuty2Handler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (PagerDuty2Handler) Percentile added in v1.5.0

func (n PagerDuty2Handler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (PagerDuty2Handler) Sample added in v1.5.0

func (n PagerDuty2Handler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*PagerDuty2Handler) ServiceKey added in v1.5.0

func (pd2 *PagerDuty2Handler) ServiceKey(serviceKey string) *PagerDuty2Handler

Allow ServiceKey as backwards compatible way to set the routing key tick:property

func (PagerDuty2Handler) Shift added in v1.5.0

func (n PagerDuty2Handler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (PagerDuty2Handler) Sideload added in v1.5.0

func (n PagerDuty2Handler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (PagerDuty2Handler) Spread added in v1.5.0

func (n PagerDuty2Handler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (PagerDuty2Handler) StateCount added in v1.5.0

func (n PagerDuty2Handler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (PagerDuty2Handler) StateDuration added in v1.5.0

func (n PagerDuty2Handler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (PagerDuty2Handler) Stddev added in v1.5.0

func (n PagerDuty2Handler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (PagerDuty2Handler) Sum added in v1.5.0

func (n PagerDuty2Handler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (PagerDuty2Handler) SwarmAutoscale added in v1.5.0

func (n PagerDuty2Handler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (PagerDuty2Handler) Top added in v1.5.0

func (n PagerDuty2Handler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (PagerDuty2Handler) Trickle added in v1.6.0

func (n PagerDuty2Handler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (PagerDuty2Handler) Union added in v1.5.0

func (n PagerDuty2Handler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (PagerDuty2Handler) Where added in v1.5.0

func (n PagerDuty2Handler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (PagerDuty2Handler) Window added in v1.5.0

func (n PagerDuty2Handler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type PagerDutyHandler added in v0.2.4

type PagerDutyHandler struct {
	*AlertNodeData `json:"-"`

	// The service key to use for the alert.
	// Defaults to the value in the configuration if empty.
	ServiceKey string `json:"serviceKey"`
}

tick:embedded:AlertNode.PagerDuty

func (PagerDutyHandler) Alert added in v0.13.0

func (n PagerDutyHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (PagerDutyHandler) Barrier added in v1.4.0

func (n PagerDutyHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (PagerDutyHandler) Bottom added in v0.13.0

func (n PagerDutyHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (PagerDutyHandler) ChangeDetect added in v1.5.0

func (n PagerDutyHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (PagerDutyHandler) Combine added in v1.0.0

func (n PagerDutyHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (PagerDutyHandler) Count added in v0.13.0

func (n PagerDutyHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (PagerDutyHandler) CumulativeSum added in v1.1.0

func (n PagerDutyHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (PagerDutyHandler) Default added in v0.13.0

func (n PagerDutyHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (PagerDutyHandler) Delete added in v1.0.0

func (n PagerDutyHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (PagerDutyHandler) Derivative added in v0.13.0

func (n PagerDutyHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (PagerDutyHandler) Difference added in v1.0.0

func (n PagerDutyHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (PagerDutyHandler) Distinct added in v0.13.0

func (n PagerDutyHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (PagerDutyHandler) Ec2Autoscale added in v1.4.0

func (n PagerDutyHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (PagerDutyHandler) Elapsed added in v0.13.0

func (n PagerDutyHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (PagerDutyHandler) Eval added in v0.13.0

func (n PagerDutyHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (PagerDutyHandler) First added in v0.13.0

func (n PagerDutyHandler) First(field string) *InfluxQLNode

Select the first point.

func (PagerDutyHandler) Flatten added in v1.0.0

func (n PagerDutyHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (PagerDutyHandler) GroupBy added in v0.13.0

func (n PagerDutyHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (PagerDutyHandler) HoltWinters added in v1.0.0

func (n PagerDutyHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (PagerDutyHandler) HoltWintersWithFit added in v1.0.0

func (n PagerDutyHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (PagerDutyHandler) HttpOut added in v0.13.0

func (n PagerDutyHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (PagerDutyHandler) HttpPost added in v1.3.0

func (n PagerDutyHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (PagerDutyHandler) InfluxDBOut added in v0.13.0

func (n PagerDutyHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (PagerDutyHandler) Join added in v0.13.0

func (n PagerDutyHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (PagerDutyHandler) K8sAutoscale added in v1.1.0

func (n PagerDutyHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (PagerDutyHandler) KapacitorLoopback added in v1.3.0

func (n PagerDutyHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (PagerDutyHandler) Last added in v0.13.0

func (n PagerDutyHandler) Last(field string) *InfluxQLNode

Select the last point.

func (PagerDutyHandler) Max added in v0.13.0

func (n PagerDutyHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (PagerDutyHandler) Mean added in v0.13.0

func (n PagerDutyHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (PagerDutyHandler) Median added in v0.13.0

func (n PagerDutyHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (PagerDutyHandler) Min added in v0.13.0

func (n PagerDutyHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (PagerDutyHandler) Mode added in v1.0.0

func (n PagerDutyHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (PagerDutyHandler) MovingAverage added in v1.0.0

func (n PagerDutyHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (PagerDutyHandler) Percentile added in v0.13.0

func (n PagerDutyHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (PagerDutyHandler) Sample added in v0.13.0

func (n PagerDutyHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (PagerDutyHandler) Shift added in v0.13.0

func (n PagerDutyHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (PagerDutyHandler) Sideload added in v1.4.0

func (n PagerDutyHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (PagerDutyHandler) Spread added in v0.13.0

func (n PagerDutyHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (PagerDutyHandler) StateCount added in v1.3.0

func (n PagerDutyHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (PagerDutyHandler) StateDuration added in v1.3.0

func (n PagerDutyHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (PagerDutyHandler) Stddev added in v0.13.0

func (n PagerDutyHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (PagerDutyHandler) Sum added in v0.13.0

func (n PagerDutyHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (PagerDutyHandler) SwarmAutoscale added in v1.4.0

func (n PagerDutyHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (PagerDutyHandler) Top added in v0.13.0

func (n PagerDutyHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (PagerDutyHandler) Trickle added in v1.6.0

func (n PagerDutyHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (PagerDutyHandler) Union added in v0.13.0

func (n PagerDutyHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (PagerDutyHandler) Where added in v0.13.0

func (n PagerDutyHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (PagerDutyHandler) Window added in v0.13.0

func (n PagerDutyHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

A complete data processing pipeline. Starts with a single source. tick:ignore

func CreatePipeline

func CreatePipeline(
	script string,
	sourceEdge EdgeType,
	scope *stateful.Scope,
	deadman DeadmanService,
	predefinedVars map[string]tick.Var,
) (*Pipeline, error)

Create a pipeline from a given script. tick:ignore

func CreatePipelineSources added in v1.4.0

func CreatePipelineSources(srcs ...Node) *Pipeline

func (*Pipeline) Dot

func (p *Pipeline) Dot(name string) []byte

Return a graphviz .dot formatted byte array. tick:ignore

func (*Pipeline) Len added in v1.0.0

func (p *Pipeline) Len() int

The number of nodes in the pipeline. tick:ignore

func (*Pipeline) MarshalJSON added in v1.4.0

func (p *Pipeline) MarshalJSON() ([]byte, error)

func (*Pipeline) Stats added in v1.4.0

func (p *Pipeline) Stats() []*StatsNode

Stats returns all stats nodes within the pipeline

func (*Pipeline) Unmarshal added in v1.4.0

func (p *Pipeline) Unmarshal(data []byte) error

func (*Pipeline) Walk

func (p *Pipeline) Walk(f func(n Node) error) error

Walks the entire pipeline and calls func f on each node exactly once. f will be called on a node n only after all of its parents have already had f called. tick:ignore

type PipelineSorter added in v1.4.0

type PipelineSorter struct {
	Edges         []Edge
	ChildrenOf    Graph
	ParentsOf     Graph
	SortedIndexes map[ID]int
	// contains filtered or unexported fields
}

PipelineSorter performs topological sort on the Edges of JSONPipeline. tick:ignore

func NewPipelineSorter added in v1.4.0

func NewPipelineSorter(edges []Edge) *PipelineSorter

func (*PipelineSorter) Graphs added in v1.4.0

func (p *PipelineSorter) Graphs() (childrenOf Graph, parentsOf Graph)

func (*PipelineSorter) Sort added in v1.4.0

func (p *PipelineSorter) Sort() (map[ID]int, error)

type PushoverHandler added in v1.3.0

type PushoverHandler struct {
	*AlertNodeData `json:"-"`

	// User/Group key of your user (or you), viewable when logged
	// into the Pushover dashboard. Often referred to as USER_KEY
	// in the Pushover documentation.
	// If empty uses the user from the configuration.
	UserKey string `json:"userKey"`

	// Users device name to send message directly to that device,
	// rather than all of a user's devices (multiple device names may
	// be separated by a comma)
	Device string `json:"device"`

	// Your message's title, otherwise your apps name is used
	Title string `json:"title"`

	// A supplementary URL to show with your message
	URL string `json:"url"`

	// A title for your supplementary URL, otherwise just URL is shown
	URLTitle string `json:"urlTitle"`

	// The name of one of the sounds supported by the device clients to override
	// the user's default sound choice
	Sound string `json:"sound"`
}

tick:embedded:AlertNode.Pushover

func (PushoverHandler) Alert added in v1.3.0

func (n PushoverHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (PushoverHandler) Barrier added in v1.4.0

func (n PushoverHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (PushoverHandler) Bottom added in v1.3.0

func (n PushoverHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (PushoverHandler) ChangeDetect added in v1.5.0

func (n PushoverHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (PushoverHandler) Combine added in v1.3.0

func (n PushoverHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (PushoverHandler) Count added in v1.3.0

func (n PushoverHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (PushoverHandler) CumulativeSum added in v1.3.0

func (n PushoverHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (PushoverHandler) Default added in v1.3.0

func (n PushoverHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (PushoverHandler) Delete added in v1.3.0

func (n PushoverHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (PushoverHandler) Derivative added in v1.3.0

func (n PushoverHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (PushoverHandler) Difference added in v1.3.0

func (n PushoverHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (PushoverHandler) Distinct added in v1.3.0

func (n PushoverHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (PushoverHandler) Ec2Autoscale added in v1.4.0

func (n PushoverHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (PushoverHandler) Elapsed added in v1.3.0

func (n PushoverHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (PushoverHandler) Eval added in v1.3.0

func (n PushoverHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (PushoverHandler) First added in v1.3.0

func (n PushoverHandler) First(field string) *InfluxQLNode

Select the first point.

func (PushoverHandler) Flatten added in v1.3.0

func (n PushoverHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (PushoverHandler) GroupBy added in v1.3.0

func (n PushoverHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (PushoverHandler) HoltWinters added in v1.3.0

func (n PushoverHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (PushoverHandler) HoltWintersWithFit added in v1.3.0

func (n PushoverHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (PushoverHandler) HttpOut added in v1.3.0

func (n PushoverHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (PushoverHandler) HttpPost added in v1.3.0

func (n PushoverHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (PushoverHandler) InfluxDBOut added in v1.3.0

func (n PushoverHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (PushoverHandler) Join added in v1.3.0

func (n PushoverHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (PushoverHandler) K8sAutoscale added in v1.3.0

func (n PushoverHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (PushoverHandler) KapacitorLoopback added in v1.3.0

func (n PushoverHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (PushoverHandler) Last added in v1.3.0

func (n PushoverHandler) Last(field string) *InfluxQLNode

Select the last point.

func (PushoverHandler) Max added in v1.3.0

func (n PushoverHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (PushoverHandler) Mean added in v1.3.0

func (n PushoverHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (PushoverHandler) Median added in v1.3.0

func (n PushoverHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (PushoverHandler) Min added in v1.3.0

func (n PushoverHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (PushoverHandler) Mode added in v1.3.0

func (n PushoverHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (PushoverHandler) MovingAverage added in v1.3.0

func (n PushoverHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (PushoverHandler) Percentile added in v1.3.0

func (n PushoverHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (PushoverHandler) Sample added in v1.3.0

func (n PushoverHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (PushoverHandler) Shift added in v1.3.0

func (n PushoverHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (PushoverHandler) Sideload added in v1.4.0

func (n PushoverHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (PushoverHandler) Spread added in v1.3.0

func (n PushoverHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (PushoverHandler) StateCount added in v1.3.0

func (n PushoverHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (PushoverHandler) StateDuration added in v1.3.0

func (n PushoverHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (PushoverHandler) Stddev added in v1.3.0

func (n PushoverHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (PushoverHandler) Sum added in v1.3.0

func (n PushoverHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (PushoverHandler) SwarmAutoscale added in v1.4.0

func (n PushoverHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (PushoverHandler) Top added in v1.3.0

func (n PushoverHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (PushoverHandler) Trickle added in v1.6.0

func (n PushoverHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (PushoverHandler) Union added in v1.3.0

func (n PushoverHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (PushoverHandler) Where added in v1.3.0

func (n PushoverHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (PushoverHandler) Window added in v1.3.0

func (n PushoverHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type QueryFluxNode added in v1.6.0

type QueryFluxNode struct {

	// The query text
	//tick:ignore
	QueryStr string `json:"queryStr"`

	// The period or length of time that will be queried from InfluxDB
	Period time.Duration `json:"period"`

	// How often to query InfluxDB.
	//
	// The Every property is mutually exclusive with the Cron property.
	Every time.Duration `json:"every"`

	// Align start and end times with the Every value
	// Does not apply if Cron is used.
	// tick:ignore
	AlignFlag bool `tick:"Align" json:"align"`

	// Define a schedule using a cron syntax.
	//
	// The specific cron implementation is documented here:
	// https://github.com/gorhill/cronexpr#implementation
	//
	// The Cron property is mutually exclusive with the Every property.
	Cron string `json:"cron"`

	// How far back in time to query from the current time
	//
	// For example an Offest of 2 hours and an Every of 5m,
	// Kapacitor will query InfluxDB every 5 minutes for the window of data 2 hours ago.
	//
	// This applies to Cron schedules as well. If the cron specifies to run every Sunday at
	// 1 AM and the Offset is 1 hour. Then at 1 AM on Sunday the data from 12 AM will be queried.
	Offset time.Duration `json:"offset"`

	// The name of a configured InfluxDB cluster.
	// If empty the default cluster will be used.
	Cluster string `json:"cluster"`

	// The influxdb 2x organization for flux
	// if empty the default org will be used
	Org string `json:"org"`

	// The influxdb 2x organization-id for flux
	// if empty the default orgid will be used
	OrgID string `json:"orgid"`
	// contains filtered or unexported fields
}

A QueryFluxNode defines a source and a schedule for processing batch data. The data is queried from an InfluxDB database and then passed into the data pipeline.

Example: batch

|fluxQuery('''
    from(bucket: "example-bucket")
    |> range(start: -1m)
    |> filter(fn: (r) =>
      r._measurement == "example-measurement" and
      r._field == "example-field"
    )
''')
    .period(1m)
    .every(20s)
...

In the above example InfluxDB is queried every 20 seconds; the window of time returned

func (*QueryFluxNode) Alert added in v1.6.0

func (n *QueryFluxNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*QueryFluxNode) Align added in v1.6.0

func (n *QueryFluxNode) Align() *QueryFluxNode

Align start and stop times for queries with even boundaries of the QueryNode.Every property. Does not apply if using the QueryNode.Cron property. tick:property

func (*QueryFluxNode) Barrier added in v1.6.0

func (n *QueryFluxNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*QueryFluxNode) Bottom added in v1.6.0

func (n *QueryFluxNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*QueryFluxNode) ChainMethods added in v1.6.0

func (n *QueryFluxNode) ChainMethods() map[string]reflect.Value

func (*QueryFluxNode) ChangeDetect added in v1.6.0

func (n *QueryFluxNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*QueryFluxNode) Combine added in v1.6.0

func (n *QueryFluxNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*QueryFluxNode) Count added in v1.6.0

func (n *QueryFluxNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*QueryFluxNode) CumulativeSum added in v1.6.0

func (n *QueryFluxNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*QueryFluxNode) Default added in v1.6.0

func (n *QueryFluxNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*QueryFluxNode) Delete added in v1.6.0

func (n *QueryFluxNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*QueryFluxNode) Derivative added in v1.6.0

func (n *QueryFluxNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*QueryFluxNode) Difference added in v1.6.0

func (n *QueryFluxNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*QueryFluxNode) Distinct added in v1.6.0

func (n *QueryFluxNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*QueryFluxNode) Ec2Autoscale added in v1.6.0

func (n *QueryFluxNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*QueryFluxNode) Elapsed added in v1.6.0

func (n *QueryFluxNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*QueryFluxNode) Eval added in v1.6.0

func (n *QueryFluxNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*QueryFluxNode) First added in v1.6.0

func (n *QueryFluxNode) First(field string) *InfluxQLNode

Select the first point.

func (*QueryFluxNode) Flatten added in v1.6.0

func (n *QueryFluxNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*QueryFluxNode) GroupBy added in v1.6.0

func (n *QueryFluxNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*QueryFluxNode) HoltWinters added in v1.6.0

func (n *QueryFluxNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*QueryFluxNode) HoltWintersWithFit added in v1.6.0

func (n *QueryFluxNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*QueryFluxNode) HttpOut added in v1.6.0

func (n *QueryFluxNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*QueryFluxNode) HttpPost added in v1.6.0

func (n *QueryFluxNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*QueryFluxNode) InfluxDBOut added in v1.6.0

func (n *QueryFluxNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*QueryFluxNode) Join added in v1.6.0

func (n *QueryFluxNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*QueryFluxNode) K8sAutoscale added in v1.6.0

func (n *QueryFluxNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*QueryFluxNode) KapacitorLoopback added in v1.6.0

func (n *QueryFluxNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*QueryFluxNode) Last added in v1.6.0

func (n *QueryFluxNode) Last(field string) *InfluxQLNode

Select the last point.

func (*QueryFluxNode) Log added in v1.6.0

func (n *QueryFluxNode) Log() *LogNode

Create a node that logs all data it receives.

func (*QueryFluxNode) MarshalJSON added in v1.6.0

func (n *QueryFluxNode) MarshalJSON() ([]byte, error)

MarshalJSON converts QueryNode to JSON tick:ignore

func (*QueryFluxNode) Max added in v1.6.0

func (n *QueryFluxNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*QueryFluxNode) Mean added in v1.6.0

func (n *QueryFluxNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*QueryFluxNode) Median added in v1.6.0

func (n *QueryFluxNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*QueryFluxNode) Min added in v1.6.0

func (n *QueryFluxNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*QueryFluxNode) Mode added in v1.6.0

func (n *QueryFluxNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*QueryFluxNode) MovingAverage added in v1.6.0

func (n *QueryFluxNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*QueryFluxNode) Percentile added in v1.6.0

func (n *QueryFluxNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*QueryFluxNode) Sample added in v1.6.0

func (n *QueryFluxNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*QueryFluxNode) Shift added in v1.6.0

func (n *QueryFluxNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*QueryFluxNode) Sideload added in v1.6.0

func (n *QueryFluxNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*QueryFluxNode) Spread added in v1.6.0

func (n *QueryFluxNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*QueryFluxNode) StateCount added in v1.6.0

func (n *QueryFluxNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*QueryFluxNode) StateDuration added in v1.6.0

func (n *QueryFluxNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*QueryFluxNode) Stddev added in v1.6.0

func (n *QueryFluxNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*QueryFluxNode) Sum added in v1.6.0

func (n *QueryFluxNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*QueryFluxNode) SwarmAutoscale added in v1.6.0

func (n *QueryFluxNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*QueryFluxNode) Top added in v1.6.0

func (n *QueryFluxNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*QueryFluxNode) Trickle added in v1.6.0

func (n *QueryFluxNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*QueryFluxNode) Union added in v1.6.0

func (n *QueryFluxNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*QueryFluxNode) UnmarshalJSON added in v1.6.0

func (n *QueryFluxNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an QueryNode tick:ignore

func (*QueryFluxNode) Where added in v1.6.0

func (n *QueryFluxNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*QueryFluxNode) Window added in v1.6.0

func (n *QueryFluxNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type QueryNode added in v0.13.0

type QueryNode struct {

	// The query text
	//tick:ignore
	QueryStr string `json:"queryStr"`

	// The period or length of time that will be queried from InfluxDB
	Period time.Duration `json:"period"`

	// How often to query InfluxDB.
	//
	// The Every property is mutually exclusive with the Cron property.
	Every time.Duration `json:"every"`

	// Align start and end times with the Every value
	// Does not apply if Cron is used.
	// tick:ignore
	AlignFlag bool `tick:"Align" json:"align"`

	// Define a schedule using a cron syntax.
	//
	// The specific cron implementation is documented here:
	// https://github.com/gorhill/cronexpr#implementation
	//
	// The Cron property is mutually exclusive with the Every property.
	Cron string `json:"cron"`

	// How far back in time to query from the current time
	//
	// For example an Offest of 2 hours and an Every of 5m,
	// Kapacitor will query InfluxDB every 5 minutes for the window of data 2 hours ago.
	//
	// This applies to Cron schedules as well. If the cron specifies to run every Sunday at
	// 1 AM and the Offset is 1 hour. Then at 1 AM on Sunday the data from 12 AM will be queried.
	Offset time.Duration `json:"offset"`

	// Align the group by time intervals with the start time of the query
	// tick:ignore
	AlignGroupFlag bool `tick:"AlignGroup" json:"alignGroup"`

	// The list of dimensions for the group-by clause.
	//tick:ignore
	Dimensions []interface{} `tick:"GroupBy" json:"groupBy"`

	// Whether to include the measurement in the group ID.
	// tick:ignore
	GroupByMeasurementFlag bool `tick:"GroupByMeasurement" json:"groupByMeasurement"`

	// Fill the data.
	// Options are:
	//
	//   - Any numerical value
	//   - null - exhibits the same behavior as the default
	//   - previous - reports the value of the previous window
	//   - none - suppresses timestamps and values where the value is null
	//   - linear - reports the results of linear interpolation
	Fill interface{} `json:"fill"`

	// The name of a configured InfluxDB cluster.
	// If empty the default cluster will be used.
	Cluster string `json:"cluster"`
	// contains filtered or unexported fields
}

A QueryNode defines a source and a schedule for processing batch data. The data is queried from an InfluxDB database and then passed into the data pipeline.

Example: batch

|query('''
    SELECT mean("value")
    FROM "telegraf"."default".cpu_usage_idle
    WHERE "host" = 'serverA'
''')
    .period(1m)
    .every(20s)
    .groupBy(time(10s), 'cpu')
...

In the above example InfluxDB is queried every 20 seconds; the window of time returned spans 1 minute and is grouped into 10 second buckets.

func (*QueryNode) Alert added in v0.13.0

func (n *QueryNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*QueryNode) Align added in v0.13.0

func (b *QueryNode) Align() *QueryNode

Align start and stop times for queries with even boundaries of the QueryNode.Every property. Does not apply if using the QueryNode.Cron property. tick:property

func (*QueryNode) AlignGroup added in v1.2.0

func (b *QueryNode) AlignGroup() *QueryNode

Align the group by time intervals with the start time of the query tick:property

func (*QueryNode) Barrier added in v1.4.0

func (n *QueryNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*QueryNode) Bottom added in v0.13.0

func (n *QueryNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*QueryNode) ChainMethods added in v0.13.0

func (n *QueryNode) ChainMethods() map[string]reflect.Value

func (*QueryNode) ChangeDetect added in v1.5.0

func (n *QueryNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*QueryNode) Combine added in v1.0.0

func (n *QueryNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*QueryNode) Count added in v0.13.0

func (n *QueryNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*QueryNode) CumulativeSum added in v1.1.0

func (n *QueryNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*QueryNode) Default added in v0.13.0

func (n *QueryNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*QueryNode) Delete added in v1.0.0

func (n *QueryNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*QueryNode) Derivative added in v0.13.0

func (n *QueryNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*QueryNode) Difference added in v1.0.0

func (n *QueryNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*QueryNode) Distinct added in v0.13.0

func (n *QueryNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*QueryNode) Ec2Autoscale added in v1.4.0

func (n *QueryNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*QueryNode) Elapsed added in v0.13.0

func (n *QueryNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*QueryNode) Eval added in v0.13.0

func (n *QueryNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*QueryNode) First added in v0.13.0

func (n *QueryNode) First(field string) *InfluxQLNode

Select the first point.

func (*QueryNode) Flatten added in v1.0.0

func (n *QueryNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*QueryNode) GroupBy added in v0.13.0

func (b *QueryNode) GroupBy(d ...interface{}) *QueryNode

Group the data by a set of dimensions. Can specify one time dimension.

This property adds a `GROUP BY` clause to the query so all the normal behaviors when quering InfluxDB with a `GROUP BY` apply.

Use group by time when your period is longer than your group by time interval.

Example:

batch
    |query(...)
        .period(1m)
        .every(1m)
        .groupBy(time(10s), 'tag1', 'tag2'))
        .align()

A group by time offset is also possible.

Example:

batch
    |query(...)
        .period(1m)
        .every(1m)
        .groupBy(time(10s, -5s), 'tag1', 'tag2'))
        .align()
        .offset(5s)

It is recommended to use QueryNode.Align and QueryNode.Offset in conjunction with group by time dimensions so that the time bounds match up with the group by intervals. To automatically align the group by intervals to the start of the query time, use QueryNode.AlignGroup. This is useful in more complex situations, such as when the groupBy time period is longer than the query frequency.

Example:

batch
    |query(...)
        .period(5m)
        .every(30s)
        .groupBy(time(1m), 'tag1', 'tag2')
        .align()
        .alignGroup()

For the above example, without QueryNode.AlignGroup, every other query issued by Kapacitor (at :30 past the minute) will align to :00 seconds instead of the desired :30 seconds, which would create 6 group by intervals instead of 5, the first and last of which would only have 30 seconds of data instead of a full minute. If the group by time offset (i.e. time(t, offset)) is used in conjunction with QueryNode.AlignGroup, the alignment will occur first, and will be offset the specified amount after.

NOTE: Since QueryNode.Offset is inherently a negative property the second "offset" argument to the "time" function is negative to match.

tick:property

func (*QueryNode) GroupByMeasurement added in v1.0.0

func (n *QueryNode) GroupByMeasurement() *QueryNode

If set will include the measurement name in the group ID. Along with any other group by dimensions.

Example: batch

|query('SELECT sum("value") FROM "telegraf"."autogen"./process_.*/')
    .groupByMeasurement()
    .groupBy('host')

The above example selects data from several measurements matching `/process_.*/ and then each point is grouped by the host tag and measurement name. Thus keeping measurements in their own groups. tick:property

func (*QueryNode) HoltWinters added in v1.0.0

func (n *QueryNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*QueryNode) HoltWintersWithFit added in v1.0.0

func (n *QueryNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*QueryNode) HttpOut added in v0.13.0

func (n *QueryNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*QueryNode) HttpPost added in v1.3.0

func (n *QueryNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*QueryNode) InfluxDBOut added in v0.13.0

func (n *QueryNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*QueryNode) Join added in v0.13.0

func (n *QueryNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*QueryNode) K8sAutoscale added in v1.1.0

func (n *QueryNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*QueryNode) KapacitorLoopback added in v1.3.0

func (n *QueryNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*QueryNode) Last added in v0.13.0

func (n *QueryNode) Last(field string) *InfluxQLNode

Select the last point.

func (*QueryNode) Log added in v0.13.0

func (n *QueryNode) Log() *LogNode

Create a node that logs all data it receives.

func (*QueryNode) MarshalJSON added in v1.4.0

func (n *QueryNode) MarshalJSON() ([]byte, error)

MarshalJSON converts QueryNode to JSON tick:ignore

func (*QueryNode) Max added in v0.13.0

func (n *QueryNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*QueryNode) Mean added in v0.13.0

func (n *QueryNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*QueryNode) Median added in v0.13.0

func (n *QueryNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*QueryNode) Min added in v0.13.0

func (n *QueryNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*QueryNode) Mode added in v1.0.0

func (n *QueryNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*QueryNode) MovingAverage added in v1.0.0

func (n *QueryNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*QueryNode) Percentile added in v0.13.0

func (n *QueryNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*QueryNode) Sample added in v0.13.0

func (n *QueryNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*QueryNode) Shift added in v0.13.0

func (n *QueryNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*QueryNode) Sideload added in v1.4.0

func (n *QueryNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*QueryNode) Spread added in v0.13.0

func (n *QueryNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*QueryNode) StateCount added in v1.3.0

func (n *QueryNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*QueryNode) StateDuration added in v1.3.0

func (n *QueryNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*QueryNode) Stddev added in v0.13.0

func (n *QueryNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*QueryNode) Sum added in v0.13.0

func (n *QueryNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*QueryNode) SwarmAutoscale added in v1.4.0

func (n *QueryNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*QueryNode) Top added in v0.13.0

func (n *QueryNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*QueryNode) Trickle added in v1.6.0

func (n *QueryNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*QueryNode) Union added in v0.13.0

func (n *QueryNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*QueryNode) UnmarshalJSON added in v1.4.0

func (n *QueryNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an QueryNode tick:ignore

func (*QueryNode) Where added in v0.13.0

func (n *QueryNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*QueryNode) Window added in v0.13.0

func (n *QueryNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type ReduceCreater added in v0.11.0

type ReduceCreater struct {
	CreateFloatReducer func() (query.FloatPointAggregator, query.FloatPointEmitter)

	CreateFloatIntegerReducer func() (query.FloatPointAggregator, query.IntegerPointEmitter)

	CreateFloatStringReducer func() (query.FloatPointAggregator, query.StringPointEmitter)

	CreateFloatBooleanReducer func() (query.FloatPointAggregator, query.BooleanPointEmitter)

	CreateIntegerFloatReducer func() (query.IntegerPointAggregator, query.FloatPointEmitter)

	CreateIntegerReducer func() (query.IntegerPointAggregator, query.IntegerPointEmitter)

	CreateIntegerStringReducer func() (query.IntegerPointAggregator, query.StringPointEmitter)

	CreateIntegerBooleanReducer func() (query.IntegerPointAggregator, query.BooleanPointEmitter)

	CreateStringFloatReducer func() (query.StringPointAggregator, query.FloatPointEmitter)

	CreateStringIntegerReducer func() (query.StringPointAggregator, query.IntegerPointEmitter)

	CreateStringReducer func() (query.StringPointAggregator, query.StringPointEmitter)

	CreateStringBooleanReducer func() (query.StringPointAggregator, query.BooleanPointEmitter)

	CreateBooleanFloatReducer func() (query.BooleanPointAggregator, query.FloatPointEmitter)

	CreateBooleanIntegerReducer func() (query.BooleanPointAggregator, query.IntegerPointEmitter)

	CreateBooleanStringReducer func() (query.BooleanPointAggregator, query.StringPointEmitter)

	CreateBooleanReducer func() (query.BooleanPointAggregator, query.BooleanPointEmitter)

	TopBottomCallInfo      *TopBottomCallInfo
	IsSimpleSelector       bool
	IsStreamTransformation bool
	IsEmptyOK              bool
}

type SNMPData added in v1.2.0

type SNMPData struct {
	Oid   string `json:"oid"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

tick:ignore

type SNMPTrapHandler added in v1.2.0

type SNMPTrapHandler struct {
	*AlertNodeData `json:"-"`

	// TrapOid
	// tick:ignore
	TrapOid string `json:"trapOid"`

	// List of trap data.
	// tick:ignore
	DataList []SNMPData `tick:"Data" json:"data"`
}

SNMPTrap AlertHandler tick:embedded:AlertNode.SnmpTrap

func (SNMPTrapHandler) Alert added in v1.2.0

func (n SNMPTrapHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (SNMPTrapHandler) Barrier added in v1.4.0

func (n SNMPTrapHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (SNMPTrapHandler) Bottom added in v1.2.0

func (n SNMPTrapHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (SNMPTrapHandler) ChangeDetect added in v1.5.0

func (n SNMPTrapHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (SNMPTrapHandler) Combine added in v1.2.0

func (n SNMPTrapHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (SNMPTrapHandler) Count added in v1.2.0

func (n SNMPTrapHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (SNMPTrapHandler) CumulativeSum added in v1.2.0

func (n SNMPTrapHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*SNMPTrapHandler) Data added in v1.2.0

func (h *SNMPTrapHandler) Data(oid, typ, value string) *SNMPTrapHandler

Define Data for SNMP Trap alert. Multiple calls append to the existing list of data.

Available types:

| Abbreviation | Datatype | | ------------ | -------- | | c | Counter | | i | Integer | | n | Null | | s | String | | t | Time ticks |

Example:

|alert()
   .message('{{ .ID }}:{{ .Level }}')
   .snmpTrap('1.3.6.1.4.1.1')
      .data('1.3.6.1.4.1.1.5', 's', '{{ .Level }}' )
      .data('1.3.6.1.4.1.1.6', 'i', '50' )
      .data('1.3.6.1.4.1.1.7', 'c', '{{ index .Fields "num_requests" }}' )
      .data('1.3.6.1.4.1.1.8', 's', '{{ .Message }}' )

tick:property

func (SNMPTrapHandler) Default added in v1.2.0

func (n SNMPTrapHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (SNMPTrapHandler) Delete added in v1.2.0

func (n SNMPTrapHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (SNMPTrapHandler) Derivative added in v1.2.0

func (n SNMPTrapHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (SNMPTrapHandler) Difference added in v1.2.0

func (n SNMPTrapHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (SNMPTrapHandler) Distinct added in v1.2.0

func (n SNMPTrapHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (SNMPTrapHandler) Ec2Autoscale added in v1.4.0

func (n SNMPTrapHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (SNMPTrapHandler) Elapsed added in v1.2.0

func (n SNMPTrapHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (SNMPTrapHandler) Eval added in v1.2.0

func (n SNMPTrapHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (SNMPTrapHandler) First added in v1.2.0

func (n SNMPTrapHandler) First(field string) *InfluxQLNode

Select the first point.

func (SNMPTrapHandler) Flatten added in v1.2.0

func (n SNMPTrapHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (SNMPTrapHandler) GroupBy added in v1.2.0

func (n SNMPTrapHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (SNMPTrapHandler) HoltWinters added in v1.2.0

func (n SNMPTrapHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (SNMPTrapHandler) HoltWintersWithFit added in v1.2.0

func (n SNMPTrapHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (SNMPTrapHandler) HttpOut added in v1.2.0

func (n SNMPTrapHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (SNMPTrapHandler) HttpPost added in v1.3.0

func (n SNMPTrapHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (SNMPTrapHandler) InfluxDBOut added in v1.2.0

func (n SNMPTrapHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (SNMPTrapHandler) Join added in v1.2.0

func (n SNMPTrapHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (SNMPTrapHandler) K8sAutoscale added in v1.2.0

func (n SNMPTrapHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (SNMPTrapHandler) KapacitorLoopback added in v1.3.0

func (n SNMPTrapHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (SNMPTrapHandler) Last added in v1.2.0

func (n SNMPTrapHandler) Last(field string) *InfluxQLNode

Select the last point.

func (SNMPTrapHandler) Max added in v1.2.0

func (n SNMPTrapHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (SNMPTrapHandler) Mean added in v1.2.0

func (n SNMPTrapHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (SNMPTrapHandler) Median added in v1.2.0

func (n SNMPTrapHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (SNMPTrapHandler) Min added in v1.2.0

func (n SNMPTrapHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (SNMPTrapHandler) Mode added in v1.2.0

func (n SNMPTrapHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (SNMPTrapHandler) MovingAverage added in v1.2.0

func (n SNMPTrapHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (SNMPTrapHandler) Percentile added in v1.2.0

func (n SNMPTrapHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (SNMPTrapHandler) Sample added in v1.2.0

func (n SNMPTrapHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (SNMPTrapHandler) Shift added in v1.2.0

func (n SNMPTrapHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (SNMPTrapHandler) Sideload added in v1.4.0

func (n SNMPTrapHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (SNMPTrapHandler) Spread added in v1.2.0

func (n SNMPTrapHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (SNMPTrapHandler) StateCount added in v1.3.0

func (n SNMPTrapHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (SNMPTrapHandler) StateDuration added in v1.3.0

func (n SNMPTrapHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (SNMPTrapHandler) Stddev added in v1.2.0

func (n SNMPTrapHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (SNMPTrapHandler) Sum added in v1.2.0

func (n SNMPTrapHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (SNMPTrapHandler) SwarmAutoscale added in v1.4.0

func (n SNMPTrapHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (SNMPTrapHandler) Top added in v1.2.0

func (n SNMPTrapHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (SNMPTrapHandler) Trickle added in v1.6.0

func (n SNMPTrapHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (SNMPTrapHandler) Union added in v1.2.0

func (n SNMPTrapHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (SNMPTrapHandler) Where added in v1.2.0

func (n SNMPTrapHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (SNMPTrapHandler) Window added in v1.2.0

func (n SNMPTrapHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type SampleNode

type SampleNode struct {

	// Keep every N point or batch
	// tick:ignore
	N int64 `json:"n"`

	// Keep one point or batch every Duration
	// tick:ignore
	Duration time.Duration `json:"duration"`
	// contains filtered or unexported fields
}

Sample points or batches. One point will be emitted every count or duration specified.

Example:

stream
    |sample(3)

Keep every third data point or batch.

Example:

stream
    |sample(10s)

Keep only samples that land on the 10s boundary. See FromNode.Truncate, QueryNode.GroupBy time or WindowNode.Align for ensuring data is aligned with a boundary.

func (*SampleNode) Alert

func (n *SampleNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*SampleNode) Barrier added in v1.4.0

func (n *SampleNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*SampleNode) Bottom added in v0.11.0

func (n *SampleNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*SampleNode) ChangeDetect added in v1.5.0

func (n *SampleNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*SampleNode) Combine added in v1.0.0

func (n *SampleNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*SampleNode) Count

func (n *SampleNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*SampleNode) CumulativeSum added in v1.1.0

func (n *SampleNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*SampleNode) Default added in v0.13.0

func (n *SampleNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*SampleNode) Delete added in v1.0.0

func (n *SampleNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*SampleNode) Derivative

func (n *SampleNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*SampleNode) Difference added in v1.0.0

func (n *SampleNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*SampleNode) Distinct added in v0.11.0

func (n *SampleNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*SampleNode) Ec2Autoscale added in v1.4.0

func (n *SampleNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*SampleNode) Elapsed added in v0.13.0

func (n *SampleNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*SampleNode) Eval

func (n *SampleNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*SampleNode) First added in v0.11.0

func (n *SampleNode) First(field string) *InfluxQLNode

Select the first point.

func (*SampleNode) Flatten added in v1.0.0

func (n *SampleNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*SampleNode) GroupBy

func (n *SampleNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*SampleNode) HoltWinters added in v1.0.0

func (n *SampleNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*SampleNode) HoltWintersWithFit added in v1.0.0

func (n *SampleNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*SampleNode) HttpOut

func (n *SampleNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*SampleNode) HttpPost added in v1.3.0

func (n *SampleNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*SampleNode) InfluxDBOut

func (n *SampleNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*SampleNode) Join

func (n *SampleNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*SampleNode) K8sAutoscale added in v1.1.0

func (n *SampleNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*SampleNode) KapacitorLoopback added in v1.3.0

func (n *SampleNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*SampleNode) Last added in v0.11.0

func (n *SampleNode) Last(field string) *InfluxQLNode

Select the last point.

func (*SampleNode) Log added in v0.11.0

func (n *SampleNode) Log() *LogNode

Create a node that logs all data it receives.

func (*SampleNode) MarshalJSON added in v1.4.0

func (n *SampleNode) MarshalJSON() ([]byte, error)

MarshalJSON converts SampleNode to JSON tick:ignore

func (*SampleNode) Max added in v0.11.0

func (n *SampleNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*SampleNode) Mean added in v0.11.0

func (n *SampleNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*SampleNode) Median added in v0.11.0

func (n *SampleNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*SampleNode) Min added in v0.11.0

func (n *SampleNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*SampleNode) Mode added in v1.0.0

func (n *SampleNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*SampleNode) MovingAverage added in v1.0.0

func (n *SampleNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*SampleNode) Percentile added in v0.11.0

func (n *SampleNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*SampleNode) Sample

func (n *SampleNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*SampleNode) Shift added in v0.11.0

func (n *SampleNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*SampleNode) Sideload added in v1.4.0

func (n *SampleNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*SampleNode) Spread added in v0.11.0

func (n *SampleNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*SampleNode) StateCount added in v1.3.0

func (n *SampleNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*SampleNode) StateDuration added in v1.3.0

func (n *SampleNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*SampleNode) Stddev added in v0.11.0

func (n *SampleNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*SampleNode) Sum added in v0.11.0

func (n *SampleNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*SampleNode) SwarmAutoscale added in v1.4.0

func (n *SampleNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*SampleNode) Top added in v0.11.0

func (n *SampleNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*SampleNode) Trickle added in v1.6.0

func (n *SampleNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*SampleNode) Union

func (n *SampleNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*SampleNode) UnmarshalJSON added in v1.4.0

func (n *SampleNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an SampleNode tick:ignore

func (*SampleNode) Where

func (n *SampleNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*SampleNode) Window

func (n *SampleNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type SensuHandler added in v0.10.0

type SensuHandler struct {
	*AlertNodeData `json:"-"`

	// Sensu source in which to post messages.
	// If empty uses the Source from the configuration.
	Source string `json:"source"`

	// Sensu handler list
	// If empty uses the handler list from the configuration
	// tick:ignore
	HandlersList []string `tick:"Handlers" json:"handlers"`

	// MetadataMap is a map of arbitrary metadata
	// tick:ignore
	MetadataMap map[string]interface{} `tick:"Metadata" json:"metadata"`
}

tick:embedded:AlertNode.Sensu

func (SensuHandler) Alert added in v0.13.0

func (n SensuHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (SensuHandler) Barrier added in v1.4.0

func (n SensuHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (SensuHandler) Bottom added in v0.13.0

func (n SensuHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (SensuHandler) ChangeDetect added in v1.5.0

func (n SensuHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (SensuHandler) Combine added in v1.0.0

func (n SensuHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (SensuHandler) Count added in v0.13.0

func (n SensuHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (SensuHandler) CumulativeSum added in v1.1.0

func (n SensuHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (SensuHandler) Default added in v0.13.0

func (n SensuHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (SensuHandler) Delete added in v1.0.0

func (n SensuHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (SensuHandler) Derivative added in v0.13.0

func (n SensuHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (SensuHandler) Difference added in v1.0.0

func (n SensuHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (SensuHandler) Distinct added in v0.13.0

func (n SensuHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (SensuHandler) Ec2Autoscale added in v1.4.0

func (n SensuHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (SensuHandler) Elapsed added in v0.13.0

func (n SensuHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (SensuHandler) Eval added in v0.13.0

func (n SensuHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (SensuHandler) First added in v0.13.0

func (n SensuHandler) First(field string) *InfluxQLNode

Select the first point.

func (SensuHandler) Flatten added in v1.0.0

func (n SensuHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (SensuHandler) GroupBy added in v0.13.0

func (n SensuHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*SensuHandler) Handlers added in v1.3.0

func (s *SensuHandler) Handlers(handlers ...string) *SensuHandler

List of effected services. If not specified defaults to the Name of the stream. tick:property

func (SensuHandler) HoltWinters added in v1.0.0

func (n SensuHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (SensuHandler) HoltWintersWithFit added in v1.0.0

func (n SensuHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (SensuHandler) HttpOut added in v0.13.0

func (n SensuHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (SensuHandler) HttpPost added in v1.3.0

func (n SensuHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (SensuHandler) InfluxDBOut added in v0.13.0

func (n SensuHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (SensuHandler) Join added in v0.13.0

func (n SensuHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (SensuHandler) K8sAutoscale added in v1.1.0

func (n SensuHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (SensuHandler) KapacitorLoopback added in v1.3.0

func (n SensuHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (SensuHandler) Last added in v0.13.0

func (n SensuHandler) Last(field string) *InfluxQLNode

Select the last point.

func (SensuHandler) Max added in v0.13.0

func (n SensuHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (SensuHandler) Mean added in v0.13.0

func (n SensuHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (SensuHandler) Median added in v0.13.0

func (n SensuHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*SensuHandler) Metadata added in v1.5.2

func (s *SensuHandler) Metadata(key string, value interface{}) *SensuHandler

Metadata adds key values pairs to the sensu request. The keys are added at the root level on the sensu JSON object. Metadata for standard Sensu keys will be ignored. tick:property

func (SensuHandler) Min added in v0.13.0

func (n SensuHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (SensuHandler) Mode added in v1.0.0

func (n SensuHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (SensuHandler) MovingAverage added in v1.0.0

func (n SensuHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (SensuHandler) Percentile added in v0.13.0

func (n SensuHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (SensuHandler) Sample added in v0.13.0

func (n SensuHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (SensuHandler) Shift added in v0.13.0

func (n SensuHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (SensuHandler) Sideload added in v1.4.0

func (n SensuHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (SensuHandler) Spread added in v0.13.0

func (n SensuHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (SensuHandler) StateCount added in v1.3.0

func (n SensuHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (SensuHandler) StateDuration added in v1.3.0

func (n SensuHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (SensuHandler) Stddev added in v0.13.0

func (n SensuHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (SensuHandler) Sum added in v0.13.0

func (n SensuHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (SensuHandler) SwarmAutoscale added in v1.4.0

func (n SensuHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (SensuHandler) Top added in v0.13.0

func (n SensuHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (SensuHandler) Trickle added in v1.6.0

func (n SensuHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (SensuHandler) Union added in v0.13.0

func (n SensuHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (SensuHandler) Where added in v0.13.0

func (n SensuHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (SensuHandler) Window added in v0.13.0

func (n SensuHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type ServiceNowHandler added in v1.5.7

type ServiceNowHandler struct {
	*AlertNodeData `json:"-"`

	// ServiceNow API URL to post alerts.
	// If empty uses the URL from the configuration.
	URL string `json:"url"`

	// Username for BASIC authentication.
	// If empty uses username from the configuration.
	Username string `json:"username"`

	// Password for BASIC authentication.
	// If empty uses password from the configuration.
	Password string `json:"password"`

	// Event source identification (event monitoring software).
	// If empty uses the URL from the configuration.
	Source string `json:"source"`

	// Node name.
	Node string `json:"node"`

	// Metric type.
	Type string `json:"type"`

	// Node resource relevant to the event.
	Resource string `json:"resource"`

	// Metric name for which event has been created..
	MetricName string `json:"metric_name"`

	// Message key.
	MessageKey string `json:"message_key"`

	// Addition info.
	// tick:ignore
	AdditionalInfoMap map[string]interface{} `tick:"AdditionalInfo" json:"additional_info"`
}

tick:embedded:AlertNode.ServiceNow

func (*ServiceNowHandler) AdditionalInfo added in v1.5.8

func (s *ServiceNowHandler) AdditionalInfo(key string, value interface{}) *ServiceNowHandler

AdditionalInfo adds key values pairs to the request. tick:property

func (ServiceNowHandler) Alert added in v1.5.7

func (n ServiceNowHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (ServiceNowHandler) Barrier added in v1.5.7

func (n ServiceNowHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (ServiceNowHandler) Bottom added in v1.5.7

func (n ServiceNowHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (ServiceNowHandler) ChangeDetect added in v1.5.7

func (n ServiceNowHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (ServiceNowHandler) Combine added in v1.5.7

func (n ServiceNowHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (ServiceNowHandler) Count added in v1.5.7

func (n ServiceNowHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (ServiceNowHandler) CumulativeSum added in v1.5.7

func (n ServiceNowHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (ServiceNowHandler) Default added in v1.5.7

func (n ServiceNowHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (ServiceNowHandler) Delete added in v1.5.7

func (n ServiceNowHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (ServiceNowHandler) Derivative added in v1.5.7

func (n ServiceNowHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (ServiceNowHandler) Difference added in v1.5.7

func (n ServiceNowHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (ServiceNowHandler) Distinct added in v1.5.7

func (n ServiceNowHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (ServiceNowHandler) Ec2Autoscale added in v1.5.7

func (n ServiceNowHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (ServiceNowHandler) Elapsed added in v1.5.7

func (n ServiceNowHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (ServiceNowHandler) Eval added in v1.5.7

func (n ServiceNowHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (ServiceNowHandler) First added in v1.5.7

func (n ServiceNowHandler) First(field string) *InfluxQLNode

Select the first point.

func (ServiceNowHandler) Flatten added in v1.5.7

func (n ServiceNowHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (ServiceNowHandler) GroupBy added in v1.5.7

func (n ServiceNowHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (ServiceNowHandler) HoltWinters added in v1.5.7

func (n ServiceNowHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (ServiceNowHandler) HoltWintersWithFit added in v1.5.7

func (n ServiceNowHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (ServiceNowHandler) HttpOut added in v1.5.7

func (n ServiceNowHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (ServiceNowHandler) HttpPost added in v1.5.7

func (n ServiceNowHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (ServiceNowHandler) InfluxDBOut added in v1.5.7

func (n ServiceNowHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (ServiceNowHandler) Join added in v1.5.7

func (n ServiceNowHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (ServiceNowHandler) K8sAutoscale added in v1.5.7

func (n ServiceNowHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (ServiceNowHandler) KapacitorLoopback added in v1.5.7

func (n ServiceNowHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (ServiceNowHandler) Last added in v1.5.7

func (n ServiceNowHandler) Last(field string) *InfluxQLNode

Select the last point.

func (ServiceNowHandler) Max added in v1.5.7

func (n ServiceNowHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (ServiceNowHandler) Mean added in v1.5.7

func (n ServiceNowHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (ServiceNowHandler) Median added in v1.5.7

func (n ServiceNowHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (ServiceNowHandler) Min added in v1.5.7

func (n ServiceNowHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (ServiceNowHandler) Mode added in v1.5.7

func (n ServiceNowHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (ServiceNowHandler) MovingAverage added in v1.5.7

func (n ServiceNowHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (ServiceNowHandler) Percentile added in v1.5.7

func (n ServiceNowHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (ServiceNowHandler) Sample added in v1.5.7

func (n ServiceNowHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (ServiceNowHandler) Shift added in v1.5.7

func (n ServiceNowHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (ServiceNowHandler) Sideload added in v1.5.7

func (n ServiceNowHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (ServiceNowHandler) Spread added in v1.5.7

func (n ServiceNowHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (ServiceNowHandler) StateCount added in v1.5.7

func (n ServiceNowHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (ServiceNowHandler) StateDuration added in v1.5.7

func (n ServiceNowHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (ServiceNowHandler) Stddev added in v1.5.7

func (n ServiceNowHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (ServiceNowHandler) Sum added in v1.5.7

func (n ServiceNowHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (ServiceNowHandler) SwarmAutoscale added in v1.5.7

func (n ServiceNowHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (ServiceNowHandler) Top added in v1.5.7

func (n ServiceNowHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (ServiceNowHandler) Trickle added in v1.6.0

func (n ServiceNowHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (ServiceNowHandler) Union added in v1.5.7

func (n ServiceNowHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (ServiceNowHandler) Where added in v1.5.7

func (n ServiceNowHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (ServiceNowHandler) Window added in v1.5.7

func (n ServiceNowHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type ShiftNode added in v0.11.0

type ShiftNode struct {

	// Keep one point or batch every Duration
	// tick:ignore
	Shift time.Duration `json:"shift"`
	// contains filtered or unexported fields
}

Shift points and batches in time, this is useful for comparing batches or points from different times.

Example:

stream
    |shift(5m)

Shift all data points 5m forward in time.

Example:

stream
    |shift(-10s)

Shift all data points 10s backward in time.

func (*ShiftNode) Alert added in v0.11.0

func (n *ShiftNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*ShiftNode) Barrier added in v1.4.0

func (n *ShiftNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*ShiftNode) Bottom added in v0.11.0

func (n *ShiftNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*ShiftNode) ChangeDetect added in v1.5.0

func (n *ShiftNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*ShiftNode) Combine added in v1.0.0

func (n *ShiftNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*ShiftNode) Count added in v0.11.0

func (n *ShiftNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*ShiftNode) CumulativeSum added in v1.1.0

func (n *ShiftNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*ShiftNode) Default added in v0.13.0

func (n *ShiftNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*ShiftNode) Delete added in v1.0.0

func (n *ShiftNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*ShiftNode) Derivative added in v0.11.0

func (n *ShiftNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*ShiftNode) Difference added in v1.0.0

func (n *ShiftNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*ShiftNode) Distinct added in v0.11.0

func (n *ShiftNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*ShiftNode) Ec2Autoscale added in v1.4.0

func (n *ShiftNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*ShiftNode) Elapsed added in v0.13.0

func (n *ShiftNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*ShiftNode) Eval added in v0.11.0

func (n *ShiftNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*ShiftNode) First added in v0.11.0

func (n *ShiftNode) First(field string) *InfluxQLNode

Select the first point.

func (*ShiftNode) Flatten added in v1.0.0

func (n *ShiftNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*ShiftNode) GroupBy added in v0.11.0

func (n *ShiftNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*ShiftNode) HoltWinters added in v1.0.0

func (n *ShiftNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*ShiftNode) HoltWintersWithFit added in v1.0.0

func (n *ShiftNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*ShiftNode) HttpOut added in v0.11.0

func (n *ShiftNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*ShiftNode) HttpPost added in v1.3.0

func (n *ShiftNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*ShiftNode) InfluxDBOut added in v0.11.0

func (n *ShiftNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*ShiftNode) Join added in v0.11.0

func (n *ShiftNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*ShiftNode) K8sAutoscale added in v1.1.0

func (n *ShiftNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*ShiftNode) KapacitorLoopback added in v1.3.0

func (n *ShiftNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*ShiftNode) Last added in v0.11.0

func (n *ShiftNode) Last(field string) *InfluxQLNode

Select the last point.

func (*ShiftNode) Log added in v0.11.0

func (n *ShiftNode) Log() *LogNode

Create a node that logs all data it receives.

func (*ShiftNode) MarshalJSON added in v1.4.0

func (n *ShiftNode) MarshalJSON() ([]byte, error)

MarshalJSON converts ShiftNode to JSON tick:ignore

func (*ShiftNode) Max added in v0.11.0

func (n *ShiftNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*ShiftNode) Mean added in v0.11.0

func (n *ShiftNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*ShiftNode) Median added in v0.11.0

func (n *ShiftNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*ShiftNode) Min added in v0.11.0

func (n *ShiftNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*ShiftNode) Mode added in v1.0.0

func (n *ShiftNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*ShiftNode) MovingAverage added in v1.0.0

func (n *ShiftNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*ShiftNode) Percentile added in v0.11.0

func (n *ShiftNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*ShiftNode) Sample added in v0.11.0

func (n *ShiftNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*ShiftNode) Shift added in v0.11.0

func (n *ShiftNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*ShiftNode) Sideload added in v1.4.0

func (n *ShiftNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*ShiftNode) Spread added in v0.11.0

func (n *ShiftNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*ShiftNode) StateCount added in v1.3.0

func (n *ShiftNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*ShiftNode) StateDuration added in v1.3.0

func (n *ShiftNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*ShiftNode) Stddev added in v0.11.0

func (n *ShiftNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*ShiftNode) Sum added in v0.11.0

func (n *ShiftNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*ShiftNode) SwarmAutoscale added in v1.4.0

func (n *ShiftNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*ShiftNode) Top added in v0.11.0

func (n *ShiftNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*ShiftNode) Trickle added in v1.6.0

func (n *ShiftNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*ShiftNode) Union added in v0.11.0

func (n *ShiftNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*ShiftNode) UnmarshalJSON added in v1.4.0

func (n *ShiftNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an ShiftNode tick:ignore

func (*ShiftNode) Where added in v0.11.0

func (n *ShiftNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*ShiftNode) Window added in v0.11.0

func (n *ShiftNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type SideloadNode added in v1.4.0

type SideloadNode struct {

	// Source for the data, currently only `file://` based sources are supported
	Source string `json:"source"`

	// Order is a list of paths that indicate the hierarchical order.
	// The paths are relative to the source and can have `{}` that will be replaced with the tag value from the point.
	// This allows for values to be overridden based on a hierarchy of tags.
	// tick:ignore
	OrderList []string `tick:"Order" json:"order"`

	// Fields is a list of fields to load.
	// tick:ignore
	Fields map[string]interface{} `tick:"Field" json:"fields"`
	// Tags is a list of tags to load.
	// tick:ignore
	Tags map[string]string `tick:"Tag" json:"tags"`
	// contains filtered or unexported fields
}

Sideload adds fields and tags to points based on hierarchical data from various sources.

Example:

|sideload()
     .source('file:///path/to/dir')
     .order('host/{{.host}}.yml', 'hostgroup/{{.hostgroup}}.yml')
     .field('cpu_threshold', 0.0)
     .tag('foo', 'unknown')

Add a field `cpu_threshold` and a tag `foo` to each point based on the value loaded from the hierarchical source. The list of templates in the `.order()` property are evaluated using the points tags. .source may be one of: a file URI, a URL, or an endpoint name as configured in the Kapacitor configuration file as an httppost object.

If source is defined as a plain string and not a URI (file://,http://), the source wil interpreted as an endpoint defined in an [[httpost]] section in the Kapacitor configuration.

A source defined as an HTTP URL or [[httppost]] endpoint will be loaded as an HTTP GET and loaded only once when a task is enabled, and then on subsequent calls to the /sideload/reload endpoint. An HTTP source endpoint should return a JSON document where each property is a key name specified in the order statement and a its value is an object with a set of key/value pairs. HTTP Source example:

{
	"host1" : {
	"cpu_threshold":98,
	"some_tag": "value",
	"disable": "False"
	},
	"some_tag_value": {
		"cpu_threshold": 97
		"another_tag": "value"
	}
}

The files paths are checked then checked in order for the specified keys and the first value that is found is used. HTTP endpoints are checked in the same manner.

func (*SideloadNode) Alert added in v1.4.0

func (n *SideloadNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*SideloadNode) Barrier added in v1.4.0

func (n *SideloadNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*SideloadNode) Bottom added in v1.4.0

func (n *SideloadNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*SideloadNode) ChangeDetect added in v1.5.0

func (n *SideloadNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*SideloadNode) Combine added in v1.4.0

func (n *SideloadNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*SideloadNode) Count added in v1.4.0

func (n *SideloadNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*SideloadNode) CumulativeSum added in v1.4.0

func (n *SideloadNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*SideloadNode) Default added in v1.4.0

func (n *SideloadNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*SideloadNode) Delete added in v1.4.0

func (n *SideloadNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*SideloadNode) Derivative added in v1.4.0

func (n *SideloadNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*SideloadNode) Difference added in v1.4.0

func (n *SideloadNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*SideloadNode) Distinct added in v1.4.0

func (n *SideloadNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*SideloadNode) Ec2Autoscale added in v1.4.0

func (n *SideloadNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*SideloadNode) Elapsed added in v1.4.0

func (n *SideloadNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*SideloadNode) Eval added in v1.4.0

func (n *SideloadNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*SideloadNode) Field added in v1.4.0

func (n *SideloadNode) Field(f string, v interface{}) *SideloadNode

Field is the name of a field to load from the source and its default value. The type loaded must match the type of the default value. Otherwise an error is recorded and the default value is used. tick:property

func (*SideloadNode) First added in v1.4.0

func (n *SideloadNode) First(field string) *InfluxQLNode

Select the first point.

func (*SideloadNode) Flatten added in v1.4.0

func (n *SideloadNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*SideloadNode) GroupBy added in v1.4.0

func (n *SideloadNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*SideloadNode) HoltWinters added in v1.4.0

func (n *SideloadNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*SideloadNode) HoltWintersWithFit added in v1.4.0

func (n *SideloadNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*SideloadNode) HttpOut added in v1.4.0

func (n *SideloadNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*SideloadNode) HttpPost added in v1.4.0

func (n *SideloadNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*SideloadNode) InfluxDBOut added in v1.4.0

func (n *SideloadNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*SideloadNode) Join added in v1.4.0

func (n *SideloadNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*SideloadNode) K8sAutoscale added in v1.4.0

func (n *SideloadNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*SideloadNode) KapacitorLoopback added in v1.4.0

func (n *SideloadNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*SideloadNode) Last added in v1.4.0

func (n *SideloadNode) Last(field string) *InfluxQLNode

Select the last point.

func (*SideloadNode) Log added in v1.4.0

func (n *SideloadNode) Log() *LogNode

Create a node that logs all data it receives.

func (*SideloadNode) MarshalJSON added in v1.4.0

func (n *SideloadNode) MarshalJSON() ([]byte, error)

MarshalJSON converts SideloadNode to JSON tick:ignore

func (*SideloadNode) Max added in v1.4.0

func (n *SideloadNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*SideloadNode) Mean added in v1.4.0

func (n *SideloadNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*SideloadNode) Median added in v1.4.0

func (n *SideloadNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*SideloadNode) Min added in v1.4.0

func (n *SideloadNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*SideloadNode) Mode added in v1.4.0

func (n *SideloadNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*SideloadNode) MovingAverage added in v1.4.0

func (n *SideloadNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*SideloadNode) Order added in v1.4.0

func (n *SideloadNode) Order(order ...string) *SideloadNode

Order is a list of paths that indicate the hierarchical order. The paths are relative to the source and can have template markers like `{{.tagname}}` that will be replaced with the tag value of the point. The paths are then searched in order for the keys and the first value that is found is used. This allows for values to be overridden based on a hierarchy of tags. tick:property

func (*SideloadNode) Percentile added in v1.4.0

func (n *SideloadNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*SideloadNode) Sample added in v1.4.0

func (n *SideloadNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*SideloadNode) Shift added in v1.4.0

func (n *SideloadNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*SideloadNode) Sideload added in v1.4.0

func (n *SideloadNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*SideloadNode) Spread added in v1.4.0

func (n *SideloadNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*SideloadNode) StateCount added in v1.4.0

func (n *SideloadNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*SideloadNode) StateDuration added in v1.4.0

func (n *SideloadNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*SideloadNode) Stddev added in v1.4.0

func (n *SideloadNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*SideloadNode) Sum added in v1.4.0

func (n *SideloadNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*SideloadNode) SwarmAutoscale added in v1.4.0

func (n *SideloadNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*SideloadNode) Tag added in v1.4.0

func (n *SideloadNode) Tag(t string, v string) *SideloadNode

Tag is the name of a tag to load from the source and its default value. The loaded values must be strings, otherwise an error is recorded and the default value is used. tick:property

func (*SideloadNode) Top added in v1.4.0

func (n *SideloadNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*SideloadNode) Trickle added in v1.6.0

func (n *SideloadNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*SideloadNode) Union added in v1.4.0

func (n *SideloadNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*SideloadNode) UnmarshalJSON added in v1.4.0

func (n *SideloadNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an SideloadNode tick:ignore

func (*SideloadNode) Where added in v1.4.0

func (n *SideloadNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*SideloadNode) Window added in v1.4.0

func (n *SideloadNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type SlackHandler added in v0.2.4

type SlackHandler struct {
	*AlertNodeData `json:"-"`

	// The workspace to publish the alert to.  If empty defaults to the configured
	// default broker.
	Workspace string `json:"workspace"`

	// Slack channel in which to post messages.
	// If empty uses the channel from the configuration.
	Channel string `json:"channel"`

	// Username of the Slack bot.
	// If empty uses the username from the configuration.
	Username string `json:"username"`

	// IconEmoji is an emoji name surrounded in ':' characters.
	// The emoji image will replace the normal user icon for the slack bot.
	IconEmoji string `json:"iconEmoji"`
}

tick:embedded:AlertNode.Slack

func (SlackHandler) Alert added in v0.13.0

func (n SlackHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (SlackHandler) Barrier added in v1.4.0

func (n SlackHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (SlackHandler) Bottom added in v0.13.0

func (n SlackHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (SlackHandler) ChangeDetect added in v1.5.0

func (n SlackHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (SlackHandler) Combine added in v1.0.0

func (n SlackHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (SlackHandler) Count added in v0.13.0

func (n SlackHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (SlackHandler) CumulativeSum added in v1.1.0

func (n SlackHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (SlackHandler) Default added in v0.13.0

func (n SlackHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (SlackHandler) Delete added in v1.0.0

func (n SlackHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (SlackHandler) Derivative added in v0.13.0

func (n SlackHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (SlackHandler) Difference added in v1.0.0

func (n SlackHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (SlackHandler) Distinct added in v0.13.0

func (n SlackHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (SlackHandler) Ec2Autoscale added in v1.4.0

func (n SlackHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (SlackHandler) Elapsed added in v0.13.0

func (n SlackHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (SlackHandler) Eval added in v0.13.0

func (n SlackHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (SlackHandler) First added in v0.13.0

func (n SlackHandler) First(field string) *InfluxQLNode

Select the first point.

func (SlackHandler) Flatten added in v1.0.0

func (n SlackHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (SlackHandler) GroupBy added in v0.13.0

func (n SlackHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (SlackHandler) HoltWinters added in v1.0.0

func (n SlackHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (SlackHandler) HoltWintersWithFit added in v1.0.0

func (n SlackHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (SlackHandler) HttpOut added in v0.13.0

func (n SlackHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (SlackHandler) HttpPost added in v1.3.0

func (n SlackHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (SlackHandler) InfluxDBOut added in v0.13.0

func (n SlackHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (SlackHandler) Join added in v0.13.0

func (n SlackHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (SlackHandler) K8sAutoscale added in v1.1.0

func (n SlackHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (SlackHandler) KapacitorLoopback added in v1.3.0

func (n SlackHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (SlackHandler) Last added in v0.13.0

func (n SlackHandler) Last(field string) *InfluxQLNode

Select the last point.

func (SlackHandler) Max added in v0.13.0

func (n SlackHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (SlackHandler) Mean added in v0.13.0

func (n SlackHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (SlackHandler) Median added in v0.13.0

func (n SlackHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (SlackHandler) Min added in v0.13.0

func (n SlackHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (SlackHandler) Mode added in v1.0.0

func (n SlackHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (SlackHandler) MovingAverage added in v1.0.0

func (n SlackHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (SlackHandler) Percentile added in v0.13.0

func (n SlackHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (SlackHandler) Sample added in v0.13.0

func (n SlackHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (SlackHandler) Shift added in v0.13.0

func (n SlackHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (SlackHandler) Sideload added in v1.4.0

func (n SlackHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (SlackHandler) Spread added in v0.13.0

func (n SlackHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (SlackHandler) StateCount added in v1.3.0

func (n SlackHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (SlackHandler) StateDuration added in v1.3.0

func (n SlackHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (SlackHandler) Stddev added in v0.13.0

func (n SlackHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (SlackHandler) Sum added in v0.13.0

func (n SlackHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (SlackHandler) SwarmAutoscale added in v1.4.0

func (n SlackHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (SlackHandler) Top added in v0.13.0

func (n SlackHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (SlackHandler) Trickle added in v1.6.0

func (n SlackHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (SlackHandler) Union added in v0.13.0

func (n SlackHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (SlackHandler) Where added in v0.13.0

func (n SlackHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (SlackHandler) Window added in v0.13.0

func (n SlackHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type StateCountNode added in v1.3.0

type StateCountNode struct {

	// Expression to determine whether state is active.
	// tick:ignore
	Lambda *ast.LambdaNode `json:"lambda"`

	// The new name of the resulting duration field.
	// Default: 'state_count'
	As string `json:"as"`
	// contains filtered or unexported fields
}

Compute the number of consecutive points in a given state. The state is defined via a lambda expression. For each consecutive point for which the expression evaluates as true, the state count will be incremented When a point evaluates as false, the state count is reset.

The state count will be added as an additional field to each point. If the expression evaluates as false, the value will be -1. If the expression generates an error during evaluation, the point is discarded, and does not affect the state count.

Example:

stream
    |from()
        .measurement('cpu')
    |where(lambda: "cpu" == 'cpu-total')
    |groupBy('host')
    |stateCount(lambda: "usage_idle" <= 10)
    |alert()
        // Warn after 1 point
        .warn(lambda: "state_count" >= 1)
        // Critical after 5 points
        .crit(lambda: "state_count" >= 5)

func (*StateCountNode) Alert added in v1.3.0

func (n *StateCountNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*StateCountNode) Barrier added in v1.4.0

func (n *StateCountNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*StateCountNode) Bottom added in v1.3.0

func (n *StateCountNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*StateCountNode) ChangeDetect added in v1.5.0

func (n *StateCountNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*StateCountNode) Combine added in v1.3.0

func (n *StateCountNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*StateCountNode) Count added in v1.3.0

func (n *StateCountNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*StateCountNode) CumulativeSum added in v1.3.0

func (n *StateCountNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*StateCountNode) Default added in v1.3.0

func (n *StateCountNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*StateCountNode) Delete added in v1.3.0

func (n *StateCountNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*StateCountNode) Derivative added in v1.3.0

func (n *StateCountNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*StateCountNode) Difference added in v1.3.0

func (n *StateCountNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*StateCountNode) Distinct added in v1.3.0

func (n *StateCountNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*StateCountNode) Ec2Autoscale added in v1.4.0

func (n *StateCountNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*StateCountNode) Elapsed added in v1.3.0

func (n *StateCountNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*StateCountNode) Eval added in v1.3.0

func (n *StateCountNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*StateCountNode) First added in v1.3.0

func (n *StateCountNode) First(field string) *InfluxQLNode

Select the first point.

func (*StateCountNode) Flatten added in v1.3.0

func (n *StateCountNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*StateCountNode) GroupBy added in v1.3.0

func (n *StateCountNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*StateCountNode) HoltWinters added in v1.3.0

func (n *StateCountNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*StateCountNode) HoltWintersWithFit added in v1.3.0

func (n *StateCountNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*StateCountNode) HttpOut added in v1.3.0

func (n *StateCountNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*StateCountNode) HttpPost added in v1.3.0

func (n *StateCountNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*StateCountNode) InfluxDBOut added in v1.3.0

func (n *StateCountNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*StateCountNode) Join added in v1.3.0

func (n *StateCountNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*StateCountNode) K8sAutoscale added in v1.3.0

func (n *StateCountNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*StateCountNode) KapacitorLoopback added in v1.3.0

func (n *StateCountNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*StateCountNode) Last added in v1.3.0

func (n *StateCountNode) Last(field string) *InfluxQLNode

Select the last point.

func (*StateCountNode) Log added in v1.3.0

func (n *StateCountNode) Log() *LogNode

Create a node that logs all data it receives.

func (*StateCountNode) MarshalJSON added in v1.4.0

func (n *StateCountNode) MarshalJSON() ([]byte, error)

MarshalJSON converts StateCountNode to JSON tick:ignore

func (*StateCountNode) Max added in v1.3.0

func (n *StateCountNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*StateCountNode) Mean added in v1.3.0

func (n *StateCountNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*StateCountNode) Median added in v1.3.0

func (n *StateCountNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*StateCountNode) Min added in v1.3.0

func (n *StateCountNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*StateCountNode) Mode added in v1.3.0

func (n *StateCountNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*StateCountNode) MovingAverage added in v1.3.0

func (n *StateCountNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*StateCountNode) Percentile added in v1.3.0

func (n *StateCountNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*StateCountNode) Sample added in v1.3.0

func (n *StateCountNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*StateCountNode) Shift added in v1.3.0

func (n *StateCountNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*StateCountNode) Sideload added in v1.4.0

func (n *StateCountNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*StateCountNode) Spread added in v1.3.0

func (n *StateCountNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*StateCountNode) StateCount added in v1.3.0

func (n *StateCountNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*StateCountNode) StateDuration added in v1.3.0

func (n *StateCountNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*StateCountNode) Stddev added in v1.3.0

func (n *StateCountNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*StateCountNode) Sum added in v1.3.0

func (n *StateCountNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*StateCountNode) SwarmAutoscale added in v1.4.0

func (n *StateCountNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*StateCountNode) Top added in v1.3.0

func (n *StateCountNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*StateCountNode) Trickle added in v1.6.0

func (n *StateCountNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*StateCountNode) Union added in v1.3.0

func (n *StateCountNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*StateCountNode) UnmarshalJSON added in v1.4.0

func (n *StateCountNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an StateCountNode tick:ignore

func (*StateCountNode) Where added in v1.3.0

func (n *StateCountNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*StateCountNode) Window added in v1.3.0

func (n *StateCountNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type StateDurationNode added in v1.3.0

type StateDurationNode struct {

	// Expression to determine whether state is active.
	// tick:ignore
	Lambda *ast.LambdaNode `json:"lambda"`

	// The new name of the resulting duration field.
	// Default: 'state_duration'
	As string `json:"as"`

	// The time unit of the resulting duration value.
	// Default: 1s.
	Unit time.Duration `json:"unit"`
	// contains filtered or unexported fields
}

Compute the duration of a given state. The state is defined via a lambda expression. For each consecutive point for which the expression evaluates as true, the state duration will be incremented by the duration between points. When a point evaluates as false, the state duration is reset.

The state duration will be added as an additional field to each point. If the expression evaluates as false, the value will be -1. If the expression generates an error during evaluation, the point is discarded, and does not affect the state duration.

Example:

stream
    |from()
        .measurement('cpu')
    |where(lambda: "cpu" == 'cpu-total')
    |groupBy('host')
    |stateDuration(lambda: "usage_idle" <= 10)
        .unit(1m)
    |alert()
        // Warn after 1 minute
        .warn(lambda: "state_duration" >= 1)
        // Critical after 5 minutes
        .crit(lambda: "state_duration" >= 5)

Note that as the first point in the given state has no previous point, its state duration will be 0.

func (*StateDurationNode) Alert added in v1.3.0

func (n *StateDurationNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*StateDurationNode) Barrier added in v1.4.0

func (n *StateDurationNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*StateDurationNode) Bottom added in v1.3.0

func (n *StateDurationNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*StateDurationNode) ChangeDetect added in v1.5.0

func (n *StateDurationNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*StateDurationNode) Combine added in v1.3.0

func (n *StateDurationNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*StateDurationNode) Count added in v1.3.0

func (n *StateDurationNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*StateDurationNode) CumulativeSum added in v1.3.0

func (n *StateDurationNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*StateDurationNode) Default added in v1.3.0

func (n *StateDurationNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*StateDurationNode) Delete added in v1.3.0

func (n *StateDurationNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*StateDurationNode) Derivative added in v1.3.0

func (n *StateDurationNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*StateDurationNode) Difference added in v1.3.0

func (n *StateDurationNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*StateDurationNode) Distinct added in v1.3.0

func (n *StateDurationNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*StateDurationNode) Ec2Autoscale added in v1.4.0

func (n *StateDurationNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*StateDurationNode) Elapsed added in v1.3.0

func (n *StateDurationNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*StateDurationNode) Eval added in v1.3.0

func (n *StateDurationNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*StateDurationNode) First added in v1.3.0

func (n *StateDurationNode) First(field string) *InfluxQLNode

Select the first point.

func (*StateDurationNode) Flatten added in v1.3.0

func (n *StateDurationNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*StateDurationNode) GroupBy added in v1.3.0

func (n *StateDurationNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*StateDurationNode) HoltWinters added in v1.3.0

func (n *StateDurationNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*StateDurationNode) HoltWintersWithFit added in v1.3.0

func (n *StateDurationNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*StateDurationNode) HttpOut added in v1.3.0

func (n *StateDurationNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*StateDurationNode) HttpPost added in v1.3.0

func (n *StateDurationNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*StateDurationNode) InfluxDBOut added in v1.3.0

func (n *StateDurationNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*StateDurationNode) Join added in v1.3.0

func (n *StateDurationNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*StateDurationNode) K8sAutoscale added in v1.3.0

func (n *StateDurationNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*StateDurationNode) KapacitorLoopback added in v1.3.0

func (n *StateDurationNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*StateDurationNode) Last added in v1.3.0

func (n *StateDurationNode) Last(field string) *InfluxQLNode

Select the last point.

func (*StateDurationNode) Log added in v1.3.0

func (n *StateDurationNode) Log() *LogNode

Create a node that logs all data it receives.

func (*StateDurationNode) MarshalJSON added in v1.4.0

func (n *StateDurationNode) MarshalJSON() ([]byte, error)

MarshalJSON converts StateDurationNode to JSON tick:ignore

func (*StateDurationNode) Max added in v1.3.0

func (n *StateDurationNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*StateDurationNode) Mean added in v1.3.0

func (n *StateDurationNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*StateDurationNode) Median added in v1.3.0

func (n *StateDurationNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*StateDurationNode) Min added in v1.3.0

func (n *StateDurationNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*StateDurationNode) Mode added in v1.3.0

func (n *StateDurationNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*StateDurationNode) MovingAverage added in v1.3.0

func (n *StateDurationNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*StateDurationNode) Percentile added in v1.3.0

func (n *StateDurationNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*StateDurationNode) Sample added in v1.3.0

func (n *StateDurationNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*StateDurationNode) Shift added in v1.3.0

func (n *StateDurationNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*StateDurationNode) Sideload added in v1.4.0

func (n *StateDurationNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*StateDurationNode) Spread added in v1.3.0

func (n *StateDurationNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*StateDurationNode) StateCount added in v1.3.0

func (n *StateDurationNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*StateDurationNode) StateDuration added in v1.3.0

func (n *StateDurationNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*StateDurationNode) Stddev added in v1.3.0

func (n *StateDurationNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*StateDurationNode) Sum added in v1.3.0

func (n *StateDurationNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*StateDurationNode) SwarmAutoscale added in v1.4.0

func (n *StateDurationNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*StateDurationNode) Top added in v1.3.0

func (n *StateDurationNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*StateDurationNode) Trickle added in v1.6.0

func (n *StateDurationNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*StateDurationNode) Union added in v1.3.0

func (n *StateDurationNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*StateDurationNode) UnmarshalJSON added in v1.4.0

func (n *StateDurationNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an StateDurationNode tick:ignore

func (*StateDurationNode) Where added in v1.3.0

func (n *StateDurationNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*StateDurationNode) Window added in v1.3.0

func (n *StateDurationNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type StatsNode added in v0.10.0

type StatsNode struct {

	// tick:ignore
	SourceNode Node `json:"-"`
	// tick:ignore
	Interval time.Duration `json:"interval"`

	// tick:ignore
	AlignFlag bool `tick:"Align" json:"align"`
	// contains filtered or unexported fields
}

A StatsNode emits internal statistics about the another node at a given interval.

The interval represents how often to emit the statistics based on real time. This means the interval time is independent of the times of the data points the other node is receiving. As a result the StatsNode is a root node in the task pipeline.

The currently available internal statistics:

  • emitted -- the number of points or batches this node has sent to its children.

Each stat is available as a field in the data stream.

The stats are in groups according to the original data. Meaning that if the source node is grouped by the tag 'host' as an example, then the counts are output per host with the appropriate 'host' tag. Since its possible for groups to change when crossing a node only the emitted groups are considered.

Example:

var data = stream
    |from()...
// Emit statistics every 1 minute and cache them via the HTTP API.
data
    |stats(1m)
    |httpOut('stats')
// Continue normal processing of the data stream
data...

WARNING: It is not recommended to join the stats stream with the original data stream. Since they operate on different clocks you could potentially create a deadlock. This is a limitation of the current implementation and may be removed in the future.

func (*StatsNode) Alert added in v0.10.0

func (n *StatsNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*StatsNode) Align added in v1.0.0

func (n *StatsNode) Align() *StatsNode

Round times to the StatsNode.Interval value. tick:property

func (*StatsNode) Barrier added in v1.4.0

func (n *StatsNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*StatsNode) Bottom added in v0.11.0

func (n *StatsNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*StatsNode) ChangeDetect added in v1.5.0

func (n *StatsNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*StatsNode) Combine added in v1.0.0

func (n *StatsNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*StatsNode) Count added in v0.11.0

func (n *StatsNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*StatsNode) CumulativeSum added in v1.1.0

func (n *StatsNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*StatsNode) Default added in v0.13.0

func (n *StatsNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*StatsNode) Delete added in v1.0.0

func (n *StatsNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*StatsNode) Derivative added in v0.10.0

func (n *StatsNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*StatsNode) Difference added in v1.0.0

func (n *StatsNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*StatsNode) Distinct added in v0.11.0

func (n *StatsNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*StatsNode) Ec2Autoscale added in v1.4.0

func (n *StatsNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*StatsNode) Elapsed added in v0.13.0

func (n *StatsNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*StatsNode) Eval added in v0.10.0

func (n *StatsNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*StatsNode) First added in v0.11.0

func (n *StatsNode) First(field string) *InfluxQLNode

Select the first point.

func (*StatsNode) Flatten added in v1.0.0

func (n *StatsNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*StatsNode) GroupBy added in v0.10.0

func (n *StatsNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*StatsNode) HoltWinters added in v1.0.0

func (n *StatsNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*StatsNode) HoltWintersWithFit added in v1.0.0

func (n *StatsNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*StatsNode) HttpOut added in v0.10.0

func (n *StatsNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*StatsNode) HttpPost added in v1.3.0

func (n *StatsNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*StatsNode) InfluxDBOut added in v0.10.0

func (n *StatsNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*StatsNode) Join added in v0.10.0

func (n *StatsNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*StatsNode) K8sAutoscale added in v1.1.0

func (n *StatsNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*StatsNode) KapacitorLoopback added in v1.3.0

func (n *StatsNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*StatsNode) Last added in v0.11.0

func (n *StatsNode) Last(field string) *InfluxQLNode

Select the last point.

func (*StatsNode) Log added in v0.11.0

func (n *StatsNode) Log() *LogNode

Create a node that logs all data it receives.

func (*StatsNode) MarshalJSON added in v1.4.0

func (n *StatsNode) MarshalJSON() ([]byte, error)

MarshalJSON converts StatsNode to JSON tick:ignore

func (*StatsNode) Max added in v0.11.0

func (n *StatsNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*StatsNode) Mean added in v0.11.0

func (n *StatsNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*StatsNode) Median added in v0.11.0

func (n *StatsNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*StatsNode) Min added in v0.11.0

func (n *StatsNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*StatsNode) Mode added in v1.0.0

func (n *StatsNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*StatsNode) MovingAverage added in v1.0.0

func (n *StatsNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*StatsNode) Percentile added in v0.11.0

func (n *StatsNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*StatsNode) Sample added in v0.10.0

func (n *StatsNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*StatsNode) Shift added in v0.11.0

func (n *StatsNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*StatsNode) Sideload added in v1.4.0

func (n *StatsNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*StatsNode) Spread added in v0.11.0

func (n *StatsNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*StatsNode) StateCount added in v1.3.0

func (n *StatsNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*StatsNode) StateDuration added in v1.3.0

func (n *StatsNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*StatsNode) Stddev added in v0.11.0

func (n *StatsNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*StatsNode) Sum added in v0.11.0

func (n *StatsNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*StatsNode) SwarmAutoscale added in v1.4.0

func (n *StatsNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*StatsNode) Top added in v0.11.0

func (n *StatsNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*StatsNode) Trickle added in v1.6.0

func (n *StatsNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*StatsNode) Union added in v0.10.0

func (n *StatsNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*StatsNode) UnmarshalJSON added in v1.4.0

func (n *StatsNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an StatsNode tick:ignore

func (*StatsNode) Where added in v0.10.0

func (n *StatsNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*StatsNode) Window added in v0.10.0

func (n *StatsNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type StreamNode

type StreamNode struct {
	// contains filtered or unexported fields
}

A StreamNode represents the source of data being streamed to Kapacitor via any of its inputs. The `stream` variable in stream tasks is an instance of a StreamNode. StreamNode.From is the method/property of this node.

func (*StreamNode) Children added in v0.13.0

func (n *StreamNode) Children() []Node

tick:ignore

func (*StreamNode) Deadman added in v0.13.0

func (n *StreamNode) Deadman(threshold float64, interval time.Duration, expr ...*ast.LambdaNode) *AlertNode

Helper function for creating an alert on low throughput, a.k.a. deadman's switch.

- Threshold -- trigger alert if throughput drops below threshold in points/interval. - Interval -- how often to check the throughput. - Expressions -- optional list of expressions to also evaluate. Useful for time of day alerting.

Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
//Do normal processing of data
data...

The above is equivalent to this Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |stats(10s)
        .align()
    |derivative('emitted')
        .unit(10s)
        .nonNegative()
    |alert()
        .id('node \'stream0\' in task \'{{ .TaskName }}\'')
        .message('{{ .ID }} is {{ if eq .Level "OK" }}alive{{ else }}dead{{ end }}: {{ index .Fields "emitted" | printf "%0.3f" }} points/10s.')
        .crit(lambda: "emitted" <= 100.0)
//Do normal processing of data
data...

The `id` and `message` alert properties can be configured globally via the 'deadman' configuration section.

Since the AlertNode is the last piece it can be further modified as usual. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
data
    |deadman(100.0, 10s)
        .slack()
        .channel('#dead_tasks')
//Do normal processing of data
data...

You can specify additional lambda expressions to further constrain when the deadman's switch is triggered. Example:

var data = stream
    |from()...
// Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
// Only trigger the alert if the time of day is between 8am-5pm.
data
    |deadman(100.0, 10s, lambda: hour("time") >= 8 AND hour("time") <= 17)
//Do normal processing of data
data...

func (*StreamNode) Desc added in v0.13.0

func (n *StreamNode) Desc() string

tick:ignore

func (*StreamNode) From

func (s *StreamNode) From() *FromNode

Creates a new FromNode that can be further filtered using the Database, RetentionPolicy, Measurement and Where properties. From can be called multiple times to create multiple independent forks of the data stream.

Example:

// Select the 'cpu' measurement from just the database 'mydb'
// and retention policy 'myrp'.
var cpu = stream
    |from()
        .database('mydb')
        .retentionPolicy('myrp')
        .measurement('cpu')
// Select the 'load' measurement from any database and retention policy.
var load = stream
    |from()
        .measurement('load')
// Join cpu and load streams and do further processing.
cpu
    |join(load)
        .as('cpu', 'load')
    ...

func (*StreamNode) ID added in v0.13.0

func (n *StreamNode) ID() ID

tick:ignore

func (*StreamNode) IsQuiet added in v1.5.0

func (n *StreamNode) IsQuiet() bool

tick:ignore

func (*StreamNode) MarshalJSON added in v1.4.0

func (n *StreamNode) MarshalJSON() ([]byte, error)

MarshalJSON converts StreamNode to JSON tick:ignore

func (*StreamNode) Name added in v0.13.0

func (n *StreamNode) Name() string

tick:ignore

func (*StreamNode) Parents added in v0.13.0

func (n *StreamNode) Parents() []Node

tick:ignore

func (*StreamNode) Provides added in v0.13.0

func (n *StreamNode) Provides() EdgeType

tick:ignore

func (*StreamNode) Quiet added in v1.5.0

func (n *StreamNode) Quiet()

Quiet suppresses all error logging events from this node. tick:property

func (*StreamNode) SetName added in v0.13.0

func (n *StreamNode) SetName(name string)

tick:ignore

func (*StreamNode) Stats added in v0.13.0

func (n *StreamNode) Stats(interval time.Duration) *StatsNode

Create a new stream of data that contains the internal statistics of the node. The interval represents how often to emit the statistics based on real time. This means the interval time is independent of the times of the data points the source node is receiving.

func (*StreamNode) UnmarshalJSON added in v1.4.0

func (n *StreamNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an StreamNode tick:ignore

func (*StreamNode) Wants added in v0.13.0

func (n *StreamNode) Wants() EdgeType

tick:ignore

type SwarmAutoscaleNode added in v1.4.0

type SwarmAutoscaleNode struct {

	// Cluster is the ID docker swarm cluster to use.
	// The ID of the cluster is specified in the kapacitor configuration.
	Cluster string `json:"cluster"`

	// ServiceName is the name of the docker swarm service to autoscale.
	ServiceName string `json:"serviceName"`
	// ServiceName is the name of a tag which contains the name of the docker swarm service to autoscale.
	ServiceNameTag string `json:"serviceNameTag"`
	// OutputServiceName is the name of a tag into which the service name will be written for output autoscale events.
	// Defaults to the value of ServiceNameTag if its not empty.
	OutputServiceNameTag string `json:"outputServiceNameTag"`

	// CurrentField is the name of a field into which the current replica count will be set as an int.
	// If empty no field will be set.
	// Useful for computing deltas on the current state.
	//
	// Example:
	//    |swarmAutoscale()
	//        .currentField('replicas')
	//        // Increase the replicas by 1 if the qps is over the threshold
	//        .replicas(lambda: if("qps" > threshold, "replicas" + 1, "replicas"))
	//
	CurrentField string `json:"currentField"`

	// The maximum scale factor to set.
	// If 0 then there is no upper limit.
	// Default: 0, a.k.a no limit.
	Max int64 `json:"max"`

	// The minimum scale factor to set.
	// Default: 1
	Min int64 `json:"min"`

	// Replicas is a lambda expression that should evaluate to the desired number of replicas for the resource.
	Replicas *ast.LambdaNode `json:"replicas"`

	// Only one increase event can be triggered per resource every IncreaseCooldown interval.
	IncreaseCooldown time.Duration `json:"increaseCooldown"`
	// Only one decrease event can be triggered per resource every DecreaseCooldown interval.
	DecreaseCooldown time.Duration `json:"decreaseCooldown"`
	// contains filtered or unexported fields
}

SwarmAutoscaleNode triggers autoscale events for a service on a Docker Swarm mode cluster. The node also outputs points for the triggered events.

Example:

// Target 80% cpu per container
var target = 80.0
var min = 1
var max = 10
var period = 5m
var every = period
stream
    |from()
        .measurement('docker_container_cpu')
        .groupBy('container_name','com.docker.swarm.service.name')
        .where(lambda: "cpu" == 'cpu-total')
    |window()
        .period(period)
        .every(every)
    |mean('usage_percent')
        .as('mean_cpu')
    |groupBy('com.docker.swarm.service.name')
    |sum('mean_cpu')
        .as('total_cpu')
    |swarmAutoscale()
        // Get the name of the service from "com.docker.swarm.service.name" tag.
        .serviceNameTag('com.docker.swarm.service.name')
        .min(min)
        .max(max)
        // Set the desired number of replicas based on target.
        .replicas(lambda: int(ceil("total_cpu" / target)))
    |influxDBOut()
        .database('deployments')
        .measurement('scale_events')
        .precision('s')

The above example computes the mean of cpu usage_percent by container name and service name. Then sum of mean cpu_usage is calculated as total_cpu. Using the total_cpu over the last time period a desired number of replicas is computed based on the target percentage usage of cpu.

If the desired number of replicas has changed, Kapacitor makes the appropriate API call to Docker Swarm to update the replicas spec.

Any time the SwarmAutoscale node changes a replica count, it emits a point. The point is tagged with the service name, using the serviceName respectively In addition the group by tags will be preserved on the emitted point. The point contains two fields: `old`, and `new` representing change in the replicas.

Available Statistics:

  • increase_events -- number of times the replica count was increased.
  • decrease_events -- number of times the replica count was decreased.
  • cooldown_drops -- number of times an event was dropped because of a cooldown timer.
  • errors -- number of errors encountered, typically related to communicating with the Swarm manager API.

func (*SwarmAutoscaleNode) Alert added in v1.4.0

func (n *SwarmAutoscaleNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*SwarmAutoscaleNode) Barrier added in v1.4.0

func (n *SwarmAutoscaleNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*SwarmAutoscaleNode) Bottom added in v1.4.0

func (n *SwarmAutoscaleNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*SwarmAutoscaleNode) ChangeDetect added in v1.5.0

func (n *SwarmAutoscaleNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*SwarmAutoscaleNode) Combine added in v1.4.0

func (n *SwarmAutoscaleNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*SwarmAutoscaleNode) Count added in v1.4.0

func (n *SwarmAutoscaleNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*SwarmAutoscaleNode) CumulativeSum added in v1.4.0

func (n *SwarmAutoscaleNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*SwarmAutoscaleNode) Default added in v1.4.0

func (n *SwarmAutoscaleNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*SwarmAutoscaleNode) Delete added in v1.4.0

func (n *SwarmAutoscaleNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*SwarmAutoscaleNode) Derivative added in v1.4.0

func (n *SwarmAutoscaleNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*SwarmAutoscaleNode) Difference added in v1.4.0

func (n *SwarmAutoscaleNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*SwarmAutoscaleNode) Distinct added in v1.4.0

func (n *SwarmAutoscaleNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*SwarmAutoscaleNode) Ec2Autoscale added in v1.4.0

func (n *SwarmAutoscaleNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*SwarmAutoscaleNode) Elapsed added in v1.4.0

func (n *SwarmAutoscaleNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*SwarmAutoscaleNode) Eval added in v1.4.0

func (n *SwarmAutoscaleNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*SwarmAutoscaleNode) First added in v1.4.0

func (n *SwarmAutoscaleNode) First(field string) *InfluxQLNode

Select the first point.

func (*SwarmAutoscaleNode) Flatten added in v1.4.0

func (n *SwarmAutoscaleNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*SwarmAutoscaleNode) GroupBy added in v1.4.0

func (n *SwarmAutoscaleNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*SwarmAutoscaleNode) HoltWinters added in v1.4.0

func (n *SwarmAutoscaleNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*SwarmAutoscaleNode) HoltWintersWithFit added in v1.4.0

func (n *SwarmAutoscaleNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*SwarmAutoscaleNode) HttpOut added in v1.4.0

func (n *SwarmAutoscaleNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*SwarmAutoscaleNode) HttpPost added in v1.4.0

func (n *SwarmAutoscaleNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*SwarmAutoscaleNode) InfluxDBOut added in v1.4.0

func (n *SwarmAutoscaleNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*SwarmAutoscaleNode) Join added in v1.4.0

func (n *SwarmAutoscaleNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*SwarmAutoscaleNode) K8sAutoscale added in v1.4.0

func (n *SwarmAutoscaleNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*SwarmAutoscaleNode) KapacitorLoopback added in v1.4.0

func (n *SwarmAutoscaleNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*SwarmAutoscaleNode) Last added in v1.4.0

func (n *SwarmAutoscaleNode) Last(field string) *InfluxQLNode

Select the last point.

func (*SwarmAutoscaleNode) Log added in v1.4.0

func (n *SwarmAutoscaleNode) Log() *LogNode

Create a node that logs all data it receives.

func (*SwarmAutoscaleNode) MarshalJSON added in v1.4.0

func (n *SwarmAutoscaleNode) MarshalJSON() ([]byte, error)

MarshalJSON converts SwarmAutoscaleNode to JSON tick:ignore

func (*SwarmAutoscaleNode) Max added in v1.4.0

func (n *SwarmAutoscaleNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*SwarmAutoscaleNode) Mean added in v1.4.0

func (n *SwarmAutoscaleNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*SwarmAutoscaleNode) Median added in v1.4.0

func (n *SwarmAutoscaleNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*SwarmAutoscaleNode) Min added in v1.4.0

func (n *SwarmAutoscaleNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*SwarmAutoscaleNode) Mode added in v1.4.0

func (n *SwarmAutoscaleNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*SwarmAutoscaleNode) MovingAverage added in v1.4.0

func (n *SwarmAutoscaleNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*SwarmAutoscaleNode) Percentile added in v1.4.0

func (n *SwarmAutoscaleNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*SwarmAutoscaleNode) Sample added in v1.4.0

func (n *SwarmAutoscaleNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*SwarmAutoscaleNode) Shift added in v1.4.0

func (n *SwarmAutoscaleNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*SwarmAutoscaleNode) Sideload added in v1.4.0

func (n *SwarmAutoscaleNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*SwarmAutoscaleNode) Spread added in v1.4.0

func (n *SwarmAutoscaleNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*SwarmAutoscaleNode) StateCount added in v1.4.0

func (n *SwarmAutoscaleNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*SwarmAutoscaleNode) StateDuration added in v1.4.0

func (n *SwarmAutoscaleNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*SwarmAutoscaleNode) Stddev added in v1.4.0

func (n *SwarmAutoscaleNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*SwarmAutoscaleNode) Sum added in v1.4.0

func (n *SwarmAutoscaleNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*SwarmAutoscaleNode) SwarmAutoscale added in v1.4.0

func (n *SwarmAutoscaleNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*SwarmAutoscaleNode) Top added in v1.4.0

func (n *SwarmAutoscaleNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*SwarmAutoscaleNode) Trickle added in v1.6.0

func (n *SwarmAutoscaleNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*SwarmAutoscaleNode) Union added in v1.4.0

func (n *SwarmAutoscaleNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*SwarmAutoscaleNode) UnmarshalJSON added in v1.4.0

func (n *SwarmAutoscaleNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an SwarmAutoscaleNode tick:ignore

func (*SwarmAutoscaleNode) Where added in v1.4.0

func (n *SwarmAutoscaleNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*SwarmAutoscaleNode) Window added in v1.4.0

func (n *SwarmAutoscaleNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type TalkHandler added in v0.10.1

type TalkHandler struct {
	*AlertNodeData `json:"-"`
}

tick:embedded:AlertNode.Talk

func (TalkHandler) Alert added in v0.13.0

func (n TalkHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (TalkHandler) Barrier added in v1.4.0

func (n TalkHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (TalkHandler) Bottom added in v0.13.0

func (n TalkHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (TalkHandler) ChangeDetect added in v1.5.0

func (n TalkHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (TalkHandler) Combine added in v1.0.0

func (n TalkHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (TalkHandler) Count added in v0.13.0

func (n TalkHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (TalkHandler) CumulativeSum added in v1.1.0

func (n TalkHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (TalkHandler) Default added in v0.13.0

func (n TalkHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (TalkHandler) Delete added in v1.0.0

func (n TalkHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (TalkHandler) Derivative added in v0.13.0

func (n TalkHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (TalkHandler) Difference added in v1.0.0

func (n TalkHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (TalkHandler) Distinct added in v0.13.0

func (n TalkHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (TalkHandler) Ec2Autoscale added in v1.4.0

func (n TalkHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (TalkHandler) Elapsed added in v0.13.0

func (n TalkHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (TalkHandler) Eval added in v0.13.0

func (n TalkHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (TalkHandler) First added in v0.13.0

func (n TalkHandler) First(field string) *InfluxQLNode

Select the first point.

func (TalkHandler) Flatten added in v1.0.0

func (n TalkHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (TalkHandler) GroupBy added in v0.13.0

func (n TalkHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (TalkHandler) HoltWinters added in v1.0.0

func (n TalkHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (TalkHandler) HoltWintersWithFit added in v1.0.0

func (n TalkHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (TalkHandler) HttpOut added in v0.13.0

func (n TalkHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (TalkHandler) HttpPost added in v1.3.0

func (n TalkHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (TalkHandler) InfluxDBOut added in v0.13.0

func (n TalkHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (TalkHandler) Join added in v0.13.0

func (n TalkHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (TalkHandler) K8sAutoscale added in v1.1.0

func (n TalkHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (TalkHandler) KapacitorLoopback added in v1.3.0

func (n TalkHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (TalkHandler) Last added in v0.13.0

func (n TalkHandler) Last(field string) *InfluxQLNode

Select the last point.

func (TalkHandler) Max added in v0.13.0

func (n TalkHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (TalkHandler) Mean added in v0.13.0

func (n TalkHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (TalkHandler) Median added in v0.13.0

func (n TalkHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (TalkHandler) Min added in v0.13.0

func (n TalkHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (TalkHandler) Mode added in v1.0.0

func (n TalkHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (TalkHandler) MovingAverage added in v1.0.0

func (n TalkHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (TalkHandler) Percentile added in v0.13.0

func (n TalkHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (TalkHandler) Sample added in v0.13.0

func (n TalkHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (TalkHandler) Shift added in v0.13.0

func (n TalkHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (TalkHandler) Sideload added in v1.4.0

func (n TalkHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (TalkHandler) Spread added in v0.13.0

func (n TalkHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (TalkHandler) StateCount added in v1.3.0

func (n TalkHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (TalkHandler) StateDuration added in v1.3.0

func (n TalkHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (TalkHandler) Stddev added in v0.13.0

func (n TalkHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (TalkHandler) Sum added in v0.13.0

func (n TalkHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (TalkHandler) SwarmAutoscale added in v1.4.0

func (n TalkHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (TalkHandler) Top added in v0.13.0

func (n TalkHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (TalkHandler) Trickle added in v1.6.0

func (n TalkHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (TalkHandler) Union added in v0.13.0

func (n TalkHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (TalkHandler) Where added in v0.13.0

func (n TalkHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (TalkHandler) Window added in v0.13.0

func (n TalkHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type TcpHandler added in v1.0.1

type TcpHandler struct {
	*AlertNodeData `json:"-"`

	// The endpoint address.
	Address string `json:"address"`
}

tick:embedded:AlertNode.Tcp

func (TcpHandler) Alert added in v1.0.1

func (n TcpHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (TcpHandler) Barrier added in v1.4.0

func (n TcpHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (TcpHandler) Bottom added in v1.0.1

func (n TcpHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (TcpHandler) ChangeDetect added in v1.5.0

func (n TcpHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (TcpHandler) Combine added in v1.0.1

func (n TcpHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (TcpHandler) Count added in v1.0.1

func (n TcpHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (TcpHandler) CumulativeSum added in v1.1.0

func (n TcpHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (TcpHandler) Default added in v1.0.1

func (n TcpHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (TcpHandler) Delete added in v1.0.1

func (n TcpHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (TcpHandler) Derivative added in v1.0.1

func (n TcpHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (TcpHandler) Difference added in v1.0.1

func (n TcpHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (TcpHandler) Distinct added in v1.0.1

func (n TcpHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (TcpHandler) Ec2Autoscale added in v1.4.0

func (n TcpHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (TcpHandler) Elapsed added in v1.0.1

func (n TcpHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (TcpHandler) Eval added in v1.0.1

func (n TcpHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (TcpHandler) First added in v1.0.1

func (n TcpHandler) First(field string) *InfluxQLNode

Select the first point.

func (TcpHandler) Flatten added in v1.0.1

func (n TcpHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (TcpHandler) GroupBy added in v1.0.1

func (n TcpHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (TcpHandler) HoltWinters added in v1.0.1

func (n TcpHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (TcpHandler) HoltWintersWithFit added in v1.0.1

func (n TcpHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (TcpHandler) HttpOut added in v1.0.1

func (n TcpHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (TcpHandler) HttpPost added in v1.3.0

func (n TcpHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (TcpHandler) InfluxDBOut added in v1.0.1

func (n TcpHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (TcpHandler) Join added in v1.0.1

func (n TcpHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (TcpHandler) K8sAutoscale added in v1.1.0

func (n TcpHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (TcpHandler) KapacitorLoopback added in v1.3.0

func (n TcpHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (TcpHandler) Last added in v1.0.1

func (n TcpHandler) Last(field string) *InfluxQLNode

Select the last point.

func (TcpHandler) Max added in v1.0.1

func (n TcpHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (TcpHandler) Mean added in v1.0.1

func (n TcpHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (TcpHandler) Median added in v1.0.1

func (n TcpHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (TcpHandler) Min added in v1.0.1

func (n TcpHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (TcpHandler) Mode added in v1.0.1

func (n TcpHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (TcpHandler) MovingAverage added in v1.0.1

func (n TcpHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (TcpHandler) Percentile added in v1.0.1

func (n TcpHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (TcpHandler) Sample added in v1.0.1

func (n TcpHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (TcpHandler) Shift added in v1.0.1

func (n TcpHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (TcpHandler) Sideload added in v1.4.0

func (n TcpHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (TcpHandler) Spread added in v1.0.1

func (n TcpHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (TcpHandler) StateCount added in v1.3.0

func (n TcpHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (TcpHandler) StateDuration added in v1.3.0

func (n TcpHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (TcpHandler) Stddev added in v1.0.1

func (n TcpHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (TcpHandler) Sum added in v1.0.1

func (n TcpHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (TcpHandler) SwarmAutoscale added in v1.4.0

func (n TcpHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (TcpHandler) Top added in v1.0.1

func (n TcpHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (TcpHandler) Trickle added in v1.6.0

func (n TcpHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (TcpHandler) Union added in v1.0.1

func (n TcpHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (TcpHandler) Where added in v1.0.1

func (n TcpHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (TcpHandler) Window added in v1.0.1

func (n TcpHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type TeamsHandler added in v1.5.6

type TeamsHandler struct {
	*AlertNodeData `json:"-"`

	// Teams channel webhook URL to post messages.
	// If empty uses the URL from the configuration.
	ChannelURL string `json:"channel_url"`
}

tick:embedded:AlertNode.Teams

func (TeamsHandler) Alert added in v1.5.6

func (n TeamsHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (TeamsHandler) Barrier added in v1.5.6

func (n TeamsHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (TeamsHandler) Bottom added in v1.5.6

func (n TeamsHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (TeamsHandler) ChangeDetect added in v1.5.6

func (n TeamsHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (TeamsHandler) Combine added in v1.5.6

func (n TeamsHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (TeamsHandler) Count added in v1.5.6

func (n TeamsHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (TeamsHandler) CumulativeSum added in v1.5.6

func (n TeamsHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (TeamsHandler) Default added in v1.5.6

func (n TeamsHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (TeamsHandler) Delete added in v1.5.6

func (n TeamsHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (TeamsHandler) Derivative added in v1.5.6

func (n TeamsHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (TeamsHandler) Difference added in v1.5.6

func (n TeamsHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (TeamsHandler) Distinct added in v1.5.6

func (n TeamsHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (TeamsHandler) Ec2Autoscale added in v1.5.6

func (n TeamsHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (TeamsHandler) Elapsed added in v1.5.6

func (n TeamsHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (TeamsHandler) Eval added in v1.5.6

func (n TeamsHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (TeamsHandler) First added in v1.5.6

func (n TeamsHandler) First(field string) *InfluxQLNode

Select the first point.

func (TeamsHandler) Flatten added in v1.5.6

func (n TeamsHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (TeamsHandler) GroupBy added in v1.5.6

func (n TeamsHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (TeamsHandler) HoltWinters added in v1.5.6

func (n TeamsHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (TeamsHandler) HoltWintersWithFit added in v1.5.6

func (n TeamsHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (TeamsHandler) HttpOut added in v1.5.6

func (n TeamsHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (TeamsHandler) HttpPost added in v1.5.6

func (n TeamsHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (TeamsHandler) InfluxDBOut added in v1.5.6

func (n TeamsHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (TeamsHandler) Join added in v1.5.6

func (n TeamsHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (TeamsHandler) K8sAutoscale added in v1.5.6

func (n TeamsHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (TeamsHandler) KapacitorLoopback added in v1.5.6

func (n TeamsHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (TeamsHandler) Last added in v1.5.6

func (n TeamsHandler) Last(field string) *InfluxQLNode

Select the last point.

func (TeamsHandler) Max added in v1.5.6

func (n TeamsHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (TeamsHandler) Mean added in v1.5.6

func (n TeamsHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (TeamsHandler) Median added in v1.5.6

func (n TeamsHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (TeamsHandler) Min added in v1.5.6

func (n TeamsHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (TeamsHandler) Mode added in v1.5.6

func (n TeamsHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (TeamsHandler) MovingAverage added in v1.5.6

func (n TeamsHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (TeamsHandler) Percentile added in v1.5.6

func (n TeamsHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (TeamsHandler) Sample added in v1.5.6

func (n TeamsHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (TeamsHandler) Shift added in v1.5.6

func (n TeamsHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (TeamsHandler) Sideload added in v1.5.6

func (n TeamsHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (TeamsHandler) Spread added in v1.5.6

func (n TeamsHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (TeamsHandler) StateCount added in v1.5.6

func (n TeamsHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (TeamsHandler) StateDuration added in v1.5.6

func (n TeamsHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (TeamsHandler) Stddev added in v1.5.6

func (n TeamsHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (TeamsHandler) Sum added in v1.5.6

func (n TeamsHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (TeamsHandler) SwarmAutoscale added in v1.5.6

func (n TeamsHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (TeamsHandler) Top added in v1.5.6

func (n TeamsHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (TeamsHandler) Trickle added in v1.6.0

func (n TeamsHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (TeamsHandler) Union added in v1.5.6

func (n TeamsHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (TeamsHandler) Where added in v1.5.6

func (n TeamsHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (TeamsHandler) Window added in v1.5.6

func (n TeamsHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type TelegramHandler added in v1.0.0

type TelegramHandler struct {
	*AlertNodeData `json:"-"`

	// Telegram user/group ID to post messages to.
	// If empty uses the chati-d from the configuration.
	ChatId string `json:"chatId"`
	// Parse node, defaults to Mardown
	// If empty uses the parse-mode from the configuration.
	ParseMode string `json:"parseMode"`
	// Web Page preview
	// If empty uses the disable-web-page-preview from the configuration.
	// tick:ignore
	IsDisableWebPagePreview bool `tick:"DisableWebPagePreview" json:"disableWebPagePreview"`
	// Disables Notification
	// If empty uses the disable-notification from the configuration.
	// tick:ignore
	IsDisableNotification bool `tick:"DisableNotification" json:"disableNotification"`
}

tick:embedded:AlertNode.Telegram

func (TelegramHandler) Alert added in v1.0.0

func (n TelegramHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (TelegramHandler) Barrier added in v1.4.0

func (n TelegramHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (TelegramHandler) Bottom added in v1.0.0

func (n TelegramHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (TelegramHandler) ChangeDetect added in v1.5.0

func (n TelegramHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (TelegramHandler) Combine added in v1.0.0

func (n TelegramHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (TelegramHandler) Count added in v1.0.0

func (n TelegramHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (TelegramHandler) CumulativeSum added in v1.1.0

func (n TelegramHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (TelegramHandler) Default added in v1.0.0

func (n TelegramHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (TelegramHandler) Delete added in v1.0.0

func (n TelegramHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (TelegramHandler) Derivative added in v1.0.0

func (n TelegramHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (TelegramHandler) Difference added in v1.0.0

func (n TelegramHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*TelegramHandler) DisableNotification added in v1.0.0

func (tel *TelegramHandler) DisableNotification() *TelegramHandler

Disables the Notification. If empty defaults to the configuration. tick:property

func (*TelegramHandler) DisableWebPagePreview added in v1.0.0

func (tel *TelegramHandler) DisableWebPagePreview() *TelegramHandler

Disables the WebPagePreview. If empty defaults to the configuration. tick:property

func (TelegramHandler) Distinct added in v1.0.0

func (n TelegramHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (TelegramHandler) Ec2Autoscale added in v1.4.0

func (n TelegramHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (TelegramHandler) Elapsed added in v1.0.0

func (n TelegramHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (TelegramHandler) Eval added in v1.0.0

func (n TelegramHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (TelegramHandler) First added in v1.0.0

func (n TelegramHandler) First(field string) *InfluxQLNode

Select the first point.

func (TelegramHandler) Flatten added in v1.0.0

func (n TelegramHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (TelegramHandler) GroupBy added in v1.0.0

func (n TelegramHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (TelegramHandler) HoltWinters added in v1.0.0

func (n TelegramHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (TelegramHandler) HoltWintersWithFit added in v1.0.0

func (n TelegramHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (TelegramHandler) HttpOut added in v1.0.0

func (n TelegramHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (TelegramHandler) HttpPost added in v1.3.0

func (n TelegramHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (TelegramHandler) InfluxDBOut added in v1.0.0

func (n TelegramHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (TelegramHandler) Join added in v1.0.0

func (n TelegramHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (TelegramHandler) K8sAutoscale added in v1.1.0

func (n TelegramHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (TelegramHandler) KapacitorLoopback added in v1.3.0

func (n TelegramHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (TelegramHandler) Last added in v1.0.0

func (n TelegramHandler) Last(field string) *InfluxQLNode

Select the last point.

func (TelegramHandler) Max added in v1.0.0

func (n TelegramHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (TelegramHandler) Mean added in v1.0.0

func (n TelegramHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (TelegramHandler) Median added in v1.0.0

func (n TelegramHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (TelegramHandler) Min added in v1.0.0

func (n TelegramHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (TelegramHandler) Mode added in v1.0.0

func (n TelegramHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (TelegramHandler) MovingAverage added in v1.0.0

func (n TelegramHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (TelegramHandler) Percentile added in v1.0.0

func (n TelegramHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (TelegramHandler) Sample added in v1.0.0

func (n TelegramHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (TelegramHandler) Shift added in v1.0.0

func (n TelegramHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (TelegramHandler) Sideload added in v1.4.0

func (n TelegramHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (TelegramHandler) Spread added in v1.0.0

func (n TelegramHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (TelegramHandler) StateCount added in v1.3.0

func (n TelegramHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (TelegramHandler) StateDuration added in v1.3.0

func (n TelegramHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (TelegramHandler) Stddev added in v1.0.0

func (n TelegramHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (TelegramHandler) Sum added in v1.0.0

func (n TelegramHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (TelegramHandler) SwarmAutoscale added in v1.4.0

func (n TelegramHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (TelegramHandler) Top added in v1.0.0

func (n TelegramHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (TelegramHandler) Trickle added in v1.6.0

func (n TelegramHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (TelegramHandler) Union added in v1.0.0

func (n TelegramHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (TelegramHandler) Where added in v1.0.0

func (n TelegramHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (TelegramHandler) Window added in v1.0.0

func (n TelegramHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type TemplatePipeline added in v1.0.0

type TemplatePipeline struct {
	// contains filtered or unexported fields
}

func CreateTemplatePipeline added in v1.0.0

func CreateTemplatePipeline(
	script string,
	sourceEdge EdgeType,
	scope *stateful.Scope,
	deadman DeadmanService,
) (*TemplatePipeline, error)

Create a template pipeline tick:ignore

func (*TemplatePipeline) Dot added in v1.0.0

func (t *TemplatePipeline) Dot(name string) []byte

Return a graphviz .dot formatted byte array. tick:ignore

func (*TemplatePipeline) Vars added in v1.0.0

func (t *TemplatePipeline) Vars() map[string]tick.Var

Return the set of vars defined by the TICKscript with their defaults tick:ignore

type TopBottomCallInfo added in v0.11.0

type TopBottomCallInfo struct {
	FieldsAndTags []string
}

type TrickleNode added in v1.6.0

type TrickleNode struct {
	// contains filtered or unexported fields
}

A node that converts from batchedges to streamedges. Example:

var errors = stream
                 |from()
                 |trickle()

Children of trickle will be treated as if they are in a stream.

func (*TrickleNode) Alert added in v1.6.0

func (n *TrickleNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*TrickleNode) Barrier added in v1.6.0

func (n *TrickleNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*TrickleNode) Bottom added in v1.6.0

func (n *TrickleNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*TrickleNode) ChangeDetect added in v1.6.0

func (n *TrickleNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*TrickleNode) Combine added in v1.6.0

func (n *TrickleNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*TrickleNode) Count added in v1.6.0

func (n *TrickleNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*TrickleNode) CumulativeSum added in v1.6.0

func (n *TrickleNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*TrickleNode) Default added in v1.6.0

func (n *TrickleNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*TrickleNode) Delete added in v1.6.0

func (n *TrickleNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*TrickleNode) Derivative added in v1.6.0

func (n *TrickleNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*TrickleNode) Difference added in v1.6.0

func (n *TrickleNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*TrickleNode) Distinct added in v1.6.0

func (n *TrickleNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*TrickleNode) Ec2Autoscale added in v1.6.0

func (n *TrickleNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*TrickleNode) Elapsed added in v1.6.0

func (n *TrickleNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*TrickleNode) Eval added in v1.6.0

func (n *TrickleNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*TrickleNode) First added in v1.6.0

func (n *TrickleNode) First(field string) *InfluxQLNode

Select the first point.

func (*TrickleNode) Flatten added in v1.6.0

func (n *TrickleNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*TrickleNode) GroupBy added in v1.6.0

func (n *TrickleNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*TrickleNode) HoltWinters added in v1.6.0

func (n *TrickleNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*TrickleNode) HoltWintersWithFit added in v1.6.0

func (n *TrickleNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*TrickleNode) HttpOut added in v1.6.0

func (n *TrickleNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*TrickleNode) HttpPost added in v1.6.0

func (n *TrickleNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*TrickleNode) InfluxDBOut added in v1.6.0

func (n *TrickleNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*TrickleNode) Join added in v1.6.0

func (n *TrickleNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*TrickleNode) K8sAutoscale added in v1.6.0

func (n *TrickleNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*TrickleNode) KapacitorLoopback added in v1.6.0

func (n *TrickleNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*TrickleNode) Last added in v1.6.0

func (n *TrickleNode) Last(field string) *InfluxQLNode

Select the last point.

func (*TrickleNode) Log added in v1.6.0

func (n *TrickleNode) Log() *LogNode

Create a node that logs all data it receives.

func (*TrickleNode) MarshalJSON added in v1.6.0

func (n *TrickleNode) MarshalJSON() ([]byte, error)

MarshalJSON converts TrickleNode to JSON tick:ignore

func (*TrickleNode) Max added in v1.6.0

func (n *TrickleNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*TrickleNode) Mean added in v1.6.0

func (n *TrickleNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*TrickleNode) Median added in v1.6.0

func (n *TrickleNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*TrickleNode) Min added in v1.6.0

func (n *TrickleNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*TrickleNode) Mode added in v1.6.0

func (n *TrickleNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*TrickleNode) MovingAverage added in v1.6.0

func (n *TrickleNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*TrickleNode) Percentile added in v1.6.0

func (n *TrickleNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*TrickleNode) Sample added in v1.6.0

func (n *TrickleNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*TrickleNode) Shift added in v1.6.0

func (n *TrickleNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*TrickleNode) Sideload added in v1.6.0

func (n *TrickleNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*TrickleNode) Spread added in v1.6.0

func (n *TrickleNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*TrickleNode) StateCount added in v1.6.0

func (n *TrickleNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*TrickleNode) StateDuration added in v1.6.0

func (n *TrickleNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*TrickleNode) Stddev added in v1.6.0

func (n *TrickleNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*TrickleNode) Sum added in v1.6.0

func (n *TrickleNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*TrickleNode) SwarmAutoscale added in v1.6.0

func (n *TrickleNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*TrickleNode) Top added in v1.6.0

func (n *TrickleNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*TrickleNode) Trickle added in v1.6.0

func (n *TrickleNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*TrickleNode) Union added in v1.6.0

func (n *TrickleNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*TrickleNode) UnmarshalJSON added in v1.6.0

func (n *TrickleNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an TrickleNode tick:ignore

func (*TrickleNode) Where added in v1.6.0

func (n *TrickleNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*TrickleNode) Window added in v1.6.0

func (n *TrickleNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type TypeOf added in v1.4.0

type TypeOf struct {
	Type string `json:"typeOf"`
	ID   ID     `json:"id,string"`
}

TypeOf is a helper struct to add type information for each pipeline node tick:ignore

type UDFNode added in v0.10.0

type UDFNode struct {
	UDFName string

	// Options that were set on the node
	// tick:ignore
	Options []*agent.Option
	// contains filtered or unexported fields
}

A UDFNode is a node that can run a User Defined Function (UDF) in a separate process.

A UDF is a custom script or binary that can communicate via Kapacitor's UDF RPC protocol. The path and arguments to the UDF program are specified in Kapacitor's configuration. Using TICKscripts you can invoke and configure your UDF for each task.

See the [README.md](https://github.com/influxdata/kapacitor/tree/master/udf/agent/) for details on how to write your own UDF.

UDFs are configured via Kapacitor's main configuration file.

Example:

[udf]
[udf.functions]
    # Example moving average UDF.
    [udf.functions.movingAverage]
        prog = "/path/to/executable/moving_avg"
        args = []
        timeout = "10s"

UDFs are first class objects in TICKscripts and are referenced via their configuration name.

Example:

// Given you have a UDF that computes a moving average
// The UDF can define what its options are and then can be
// invoked via a TICKscript like so:
stream
    |from()...
    @movingAverage()
        .field('value')
        .size(100)
        .as('mavg')
    |httpOut('movingaverage')

NOTE: The UDF process runs as the same user as the Kapacitor daemon. As a result, make sure the user is properly secured, as well as the configuration file.

func NewUDF added in v0.10.0

func NewUDF(
	parent Node,
	name string,
	wants,
	provides agent.EdgeType,
	options map[string]*agent.OptionInfo,
) *UDFNode

func (*UDFNode) Alert added in v0.10.0

func (n *UDFNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*UDFNode) Barrier added in v1.4.0

func (n *UDFNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*UDFNode) Bottom added in v0.11.0

func (n *UDFNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*UDFNode) CallChainMethod added in v0.12.0

func (u *UDFNode) CallChainMethod(name string, args ...interface{}) (interface{}, error)

tick:ignore

func (*UDFNode) ChangeDetect added in v1.5.0

func (n *UDFNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*UDFNode) Combine added in v1.0.0

func (n *UDFNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*UDFNode) Count added in v0.11.0

func (n *UDFNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*UDFNode) CumulativeSum added in v1.1.0

func (n *UDFNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*UDFNode) Default added in v0.13.0

func (n *UDFNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*UDFNode) Delete added in v1.0.0

func (n *UDFNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*UDFNode) Derivative added in v0.10.0

func (n *UDFNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*UDFNode) Desc added in v0.10.0

func (u *UDFNode) Desc() string

tick:ignore

func (*UDFNode) Difference added in v1.0.0

func (n *UDFNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*UDFNode) Distinct added in v0.11.0

func (n *UDFNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*UDFNode) Ec2Autoscale added in v1.4.0

func (n *UDFNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*UDFNode) Elapsed added in v0.13.0

func (n *UDFNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*UDFNode) Eval added in v0.10.0

func (n *UDFNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*UDFNode) First added in v0.11.0

func (n *UDFNode) First(field string) *InfluxQLNode

Select the first point.

func (*UDFNode) Flatten added in v1.0.0

func (n *UDFNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*UDFNode) GroupBy added in v0.10.0

func (n *UDFNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*UDFNode) HasChainMethod added in v0.12.0

func (u *UDFNode) HasChainMethod(name string) bool

tick:ignore

func (*UDFNode) HasProperty added in v0.10.0

func (u *UDFNode) HasProperty(name string) bool

tick:ignore

func (*UDFNode) HoltWinters added in v1.0.0

func (n *UDFNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*UDFNode) HoltWintersWithFit added in v1.0.0

func (n *UDFNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*UDFNode) HttpOut added in v0.10.0

func (n *UDFNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*UDFNode) HttpPost added in v1.3.0

func (n *UDFNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*UDFNode) InfluxDBOut added in v0.10.0

func (n *UDFNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*UDFNode) Join added in v0.10.0

func (n *UDFNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*UDFNode) K8sAutoscale added in v1.1.0

func (n *UDFNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*UDFNode) KapacitorLoopback added in v1.3.0

func (n *UDFNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*UDFNode) Last added in v0.11.0

func (n *UDFNode) Last(field string) *InfluxQLNode

Select the last point.

func (*UDFNode) Log added in v0.11.0

func (n *UDFNode) Log() *LogNode

Create a node that logs all data it receives.

func (*UDFNode) MarshalJSON added in v1.4.0

func (u *UDFNode) MarshalJSON() ([]byte, error)

MarshalJSON converts UDFNode to JSON tick:ignore

func (*UDFNode) Max added in v0.11.0

func (n *UDFNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*UDFNode) Mean added in v0.11.0

func (n *UDFNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*UDFNode) Median added in v0.11.0

func (n *UDFNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*UDFNode) Min added in v0.11.0

func (n *UDFNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*UDFNode) Mode added in v1.0.0

func (n *UDFNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*UDFNode) MovingAverage added in v1.0.0

func (n *UDFNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*UDFNode) Percentile added in v0.11.0

func (n *UDFNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*UDFNode) Property added in v0.10.0

func (u *UDFNode) Property(name string) interface{}

tick:ignore

func (*UDFNode) Sample added in v0.10.0

func (n *UDFNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*UDFNode) SetProperty added in v0.10.0

func (u *UDFNode) SetProperty(name string, args ...interface{}) (interface{}, error)

tick:ignore

func (*UDFNode) Shift added in v0.11.0

func (n *UDFNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*UDFNode) Sideload added in v1.4.0

func (n *UDFNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*UDFNode) Spread added in v0.11.0

func (n *UDFNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*UDFNode) StateCount added in v1.3.0

func (n *UDFNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*UDFNode) StateDuration added in v1.3.0

func (n *UDFNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*UDFNode) Stddev added in v0.11.0

func (n *UDFNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*UDFNode) Sum added in v0.11.0

func (n *UDFNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*UDFNode) SwarmAutoscale added in v1.4.0

func (n *UDFNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*UDFNode) Top added in v0.11.0

func (n *UDFNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*UDFNode) Trickle added in v1.6.0

func (n *UDFNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*UDFNode) Union added in v0.10.0

func (n *UDFNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*UDFNode) UnmarshalJSON added in v1.4.0

func (u *UDFNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to UDFNode tick:ignore

func (*UDFNode) Where added in v0.10.0

func (n *UDFNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*UDFNode) Window added in v0.10.0

func (n *UDFNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type UnionNode

type UnionNode struct {

	// The new name of the stream.
	// If empty the name of the left node
	// (i.e. `leftNode.union(otherNode1, otherNode2)`) is used.
	Rename string `json:"rename"`
	// contains filtered or unexported fields
}

Takes the union of all of its parents. The union is just a simple pass through. Each data points received from each parent is passed onto children nodes without modification.

Example:

var logins = stream
    |from()
        .measurement('logins')
var logouts = stream
    |from()
        .measurement('logouts')
var frontpage = stream
    |from()
        .measurement('frontpage')
// Union all user actions into a single stream
logins
    |union(logouts, frontpage)
        .rename('user_actions')
    ...

func (*UnionNode) Alert

func (n *UnionNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*UnionNode) Barrier added in v1.4.0

func (n *UnionNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*UnionNode) Bottom added in v0.11.0

func (n *UnionNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*UnionNode) ChangeDetect added in v1.5.0

func (n *UnionNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*UnionNode) Combine added in v1.0.0

func (n *UnionNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*UnionNode) Count added in v0.11.0

func (n *UnionNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*UnionNode) CumulativeSum added in v1.1.0

func (n *UnionNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*UnionNode) Default added in v0.13.0

func (n *UnionNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*UnionNode) Delete added in v1.0.0

func (n *UnionNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*UnionNode) Derivative

func (n *UnionNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*UnionNode) Difference added in v1.0.0

func (n *UnionNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*UnionNode) Distinct added in v0.11.0

func (n *UnionNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*UnionNode) Ec2Autoscale added in v1.4.0

func (n *UnionNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*UnionNode) Elapsed added in v0.13.0

func (n *UnionNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*UnionNode) Eval

func (n *UnionNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*UnionNode) First added in v0.11.0

func (n *UnionNode) First(field string) *InfluxQLNode

Select the first point.

func (*UnionNode) Flatten added in v1.0.0

func (n *UnionNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*UnionNode) GroupBy

func (n *UnionNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*UnionNode) HoltWinters added in v1.0.0

func (n *UnionNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*UnionNode) HoltWintersWithFit added in v1.0.0

func (n *UnionNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*UnionNode) HttpOut

func (n *UnionNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*UnionNode) HttpPost added in v1.3.0

func (n *UnionNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*UnionNode) InfluxDBOut

func (n *UnionNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*UnionNode) Join

func (n *UnionNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*UnionNode) K8sAutoscale added in v1.1.0

func (n *UnionNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*UnionNode) KapacitorLoopback added in v1.3.0

func (n *UnionNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*UnionNode) Last added in v0.11.0

func (n *UnionNode) Last(field string) *InfluxQLNode

Select the last point.

func (*UnionNode) Log added in v0.11.0

func (n *UnionNode) Log() *LogNode

Create a node that logs all data it receives.

func (*UnionNode) MarshalJSON added in v1.4.0

func (n *UnionNode) MarshalJSON() ([]byte, error)

MarshalJSON converts UnionNode to JSON tick:ignore

func (*UnionNode) Max added in v0.11.0

func (n *UnionNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*UnionNode) Mean added in v0.11.0

func (n *UnionNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*UnionNode) Median added in v0.11.0

func (n *UnionNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*UnionNode) Min added in v0.11.0

func (n *UnionNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*UnionNode) Mode added in v1.0.0

func (n *UnionNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*UnionNode) MovingAverage added in v1.0.0

func (n *UnionNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*UnionNode) Percentile added in v0.11.0

func (n *UnionNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*UnionNode) Sample

func (n *UnionNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*UnionNode) Shift added in v0.11.0

func (n *UnionNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*UnionNode) Sideload added in v1.4.0

func (n *UnionNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*UnionNode) Spread added in v0.11.0

func (n *UnionNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*UnionNode) StateCount added in v1.3.0

func (n *UnionNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*UnionNode) StateDuration added in v1.3.0

func (n *UnionNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*UnionNode) Stddev added in v0.11.0

func (n *UnionNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*UnionNode) Sum added in v0.11.0

func (n *UnionNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*UnionNode) SwarmAutoscale added in v1.4.0

func (n *UnionNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*UnionNode) Top added in v0.11.0

func (n *UnionNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*UnionNode) Trickle added in v1.6.0

func (n *UnionNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*UnionNode) Union

func (n *UnionNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*UnionNode) UnmarshalJSON added in v1.4.0

func (n *UnionNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an UnionNode tick:ignore

func (*UnionNode) Where

func (n *UnionNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*UnionNode) Window

func (n *UnionNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type VictorOpsHandler added in v0.2.4

type VictorOpsHandler struct {
	*AlertNodeData `json:"-"`

	// The routing key to use for the alert.
	// Defaults to the value in the configuration if empty.
	RoutingKey string `json:"routingKey"`
}

tick:embedded:AlertNode.VictorOps

func (VictorOpsHandler) Alert added in v0.13.0

func (n VictorOpsHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (VictorOpsHandler) Barrier added in v1.4.0

func (n VictorOpsHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (VictorOpsHandler) Bottom added in v0.13.0

func (n VictorOpsHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (VictorOpsHandler) ChangeDetect added in v1.5.0

func (n VictorOpsHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (VictorOpsHandler) Combine added in v1.0.0

func (n VictorOpsHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (VictorOpsHandler) Count added in v0.13.0

func (n VictorOpsHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (VictorOpsHandler) CumulativeSum added in v1.1.0

func (n VictorOpsHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (VictorOpsHandler) Default added in v0.13.0

func (n VictorOpsHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (VictorOpsHandler) Delete added in v1.0.0

func (n VictorOpsHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (VictorOpsHandler) Derivative added in v0.13.0

func (n VictorOpsHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (VictorOpsHandler) Difference added in v1.0.0

func (n VictorOpsHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (VictorOpsHandler) Distinct added in v0.13.0

func (n VictorOpsHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (VictorOpsHandler) Ec2Autoscale added in v1.4.0

func (n VictorOpsHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (VictorOpsHandler) Elapsed added in v0.13.0

func (n VictorOpsHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (VictorOpsHandler) Eval added in v0.13.0

func (n VictorOpsHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (VictorOpsHandler) First added in v0.13.0

func (n VictorOpsHandler) First(field string) *InfluxQLNode

Select the first point.

func (VictorOpsHandler) Flatten added in v1.0.0

func (n VictorOpsHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (VictorOpsHandler) GroupBy added in v0.13.0

func (n VictorOpsHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (VictorOpsHandler) HoltWinters added in v1.0.0

func (n VictorOpsHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (VictorOpsHandler) HoltWintersWithFit added in v1.0.0

func (n VictorOpsHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (VictorOpsHandler) HttpOut added in v0.13.0

func (n VictorOpsHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (VictorOpsHandler) HttpPost added in v1.3.0

func (n VictorOpsHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (VictorOpsHandler) InfluxDBOut added in v0.13.0

func (n VictorOpsHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (VictorOpsHandler) Join added in v0.13.0

func (n VictorOpsHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (VictorOpsHandler) K8sAutoscale added in v1.1.0

func (n VictorOpsHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (VictorOpsHandler) KapacitorLoopback added in v1.3.0

func (n VictorOpsHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (VictorOpsHandler) Last added in v0.13.0

func (n VictorOpsHandler) Last(field string) *InfluxQLNode

Select the last point.

func (VictorOpsHandler) Max added in v0.13.0

func (n VictorOpsHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (VictorOpsHandler) Mean added in v0.13.0

func (n VictorOpsHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (VictorOpsHandler) Median added in v0.13.0

func (n VictorOpsHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (VictorOpsHandler) Min added in v0.13.0

func (n VictorOpsHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (VictorOpsHandler) Mode added in v1.0.0

func (n VictorOpsHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (VictorOpsHandler) MovingAverage added in v1.0.0

func (n VictorOpsHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (VictorOpsHandler) Percentile added in v0.13.0

func (n VictorOpsHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (VictorOpsHandler) Sample added in v0.13.0

func (n VictorOpsHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (VictorOpsHandler) Shift added in v0.13.0

func (n VictorOpsHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (VictorOpsHandler) Sideload added in v1.4.0

func (n VictorOpsHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (VictorOpsHandler) Spread added in v0.13.0

func (n VictorOpsHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (VictorOpsHandler) StateCount added in v1.3.0

func (n VictorOpsHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (VictorOpsHandler) StateDuration added in v1.3.0

func (n VictorOpsHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (VictorOpsHandler) Stddev added in v0.13.0

func (n VictorOpsHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (VictorOpsHandler) Sum added in v0.13.0

func (n VictorOpsHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (VictorOpsHandler) SwarmAutoscale added in v1.4.0

func (n VictorOpsHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (VictorOpsHandler) Top added in v0.13.0

func (n VictorOpsHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (VictorOpsHandler) Trickle added in v1.6.0

func (n VictorOpsHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (VictorOpsHandler) Union added in v0.13.0

func (n VictorOpsHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (VictorOpsHandler) Where added in v0.13.0

func (n VictorOpsHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (VictorOpsHandler) Window added in v0.13.0

func (n VictorOpsHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type WhereNode

type WhereNode struct {

	// The expression predicate.
	// tick:ignore
	Lambda *ast.LambdaNode `json:"lambda"`
	// contains filtered or unexported fields
}

The WhereNode filters the data stream by a given expression.

Example: var sums = stream

|from()
    .groupBy('service', 'host')
|sum('value')

//Watch particular host for issues. sums

|where(lambda: "host" == 'h001.example.com')
|alert()
    .crit(lambda: TRUE)
    .email().to('user@example.com')

func (*WhereNode) Alert

func (n *WhereNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*WhereNode) Barrier added in v1.4.0

func (n *WhereNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*WhereNode) Bottom added in v0.11.0

func (n *WhereNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*WhereNode) ChangeDetect added in v1.5.0

func (n *WhereNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*WhereNode) Combine added in v1.0.0

func (n *WhereNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*WhereNode) Count added in v0.11.0

func (n *WhereNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*WhereNode) CumulativeSum added in v1.1.0

func (n *WhereNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*WhereNode) Default added in v0.13.0

func (n *WhereNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*WhereNode) Delete added in v1.0.0

func (n *WhereNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*WhereNode) Derivative

func (n *WhereNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*WhereNode) Difference added in v1.0.0

func (n *WhereNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*WhereNode) Distinct added in v0.11.0

func (n *WhereNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*WhereNode) Ec2Autoscale added in v1.4.0

func (n *WhereNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*WhereNode) Elapsed added in v0.13.0

func (n *WhereNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*WhereNode) Eval

func (n *WhereNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*WhereNode) First added in v0.11.0

func (n *WhereNode) First(field string) *InfluxQLNode

Select the first point.

func (*WhereNode) Flatten added in v1.0.0

func (n *WhereNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*WhereNode) GroupBy

func (n *WhereNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*WhereNode) HoltWinters added in v1.0.0

func (n *WhereNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*WhereNode) HoltWintersWithFit added in v1.0.0

func (n *WhereNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*WhereNode) HttpOut

func (n *WhereNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*WhereNode) HttpPost added in v1.3.0

func (n *WhereNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*WhereNode) InfluxDBOut

func (n *WhereNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*WhereNode) Join

func (n *WhereNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*WhereNode) K8sAutoscale added in v1.1.0

func (n *WhereNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*WhereNode) KapacitorLoopback added in v1.3.0

func (n *WhereNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*WhereNode) Last added in v0.11.0

func (n *WhereNode) Last(field string) *InfluxQLNode

Select the last point.

func (*WhereNode) Log added in v0.11.0

func (n *WhereNode) Log() *LogNode

Create a node that logs all data it receives.

func (*WhereNode) MarshalJSON added in v1.4.0

func (n *WhereNode) MarshalJSON() ([]byte, error)

MarshalJSON converts WhereNode to JSON tick:ignore

func (*WhereNode) Max added in v0.11.0

func (n *WhereNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*WhereNode) Mean added in v0.11.0

func (n *WhereNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*WhereNode) Median added in v0.11.0

func (n *WhereNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*WhereNode) Min added in v0.11.0

func (n *WhereNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*WhereNode) Mode added in v1.0.0

func (n *WhereNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*WhereNode) MovingAverage added in v1.0.0

func (n *WhereNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*WhereNode) Percentile added in v0.11.0

func (n *WhereNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*WhereNode) Sample

func (n *WhereNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*WhereNode) Shift added in v0.11.0

func (n *WhereNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*WhereNode) Sideload added in v1.4.0

func (n *WhereNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*WhereNode) Spread added in v0.11.0

func (n *WhereNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*WhereNode) StateCount added in v1.3.0

func (n *WhereNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*WhereNode) StateDuration added in v1.3.0

func (n *WhereNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*WhereNode) Stddev added in v0.11.0

func (n *WhereNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*WhereNode) Sum added in v0.11.0

func (n *WhereNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*WhereNode) SwarmAutoscale added in v1.4.0

func (n *WhereNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*WhereNode) Top added in v0.11.0

func (n *WhereNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*WhereNode) Trickle added in v1.6.0

func (n *WhereNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*WhereNode) Union

func (n *WhereNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*WhereNode) UnmarshalJSON added in v1.4.0

func (n *WhereNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an WhereNode tick:ignore

func (*WhereNode) Where

func (n *WhereNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*WhereNode) Window

func (n *WhereNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type WindowNode

type WindowNode struct {

	// The period, or length in time, of the window.
	Period time.Duration `json:"period"`
	// How often the current window is emitted into the pipeline.
	// If equal to zero, then every new point will emit the current window.
	Every time.Duration `json:"every"`
	// Whether to align the window edges with the zero time
	// tick:ignore
	AlignFlag bool `json:"align" tick:"Align"`
	// Whether to wait till the period is full before the first emit.
	// tick:ignore
	FillPeriodFlag bool `json:"fillPeriod" tick:"FillPeriod"`

	// PeriodCount is the number of points per window.
	PeriodCount int64 `json:"periodCount"`
	// EveryCount determines how often the window is emitted based on the count of points.
	// A value of 1 means that every new point will emit the window.
	EveryCount int64 `json:"everyCount"`
	// contains filtered or unexported fields
}

A `window` node caches data within a moving time range. The `period` property of `window` defines the time range covered by `window`.

The `every` property of `window` defines the frequency at which the window is emitted to the next node in the pipeline.

The `align` property of `window` defines how to align the window edges. (By default, the edges are defined relative to the first data point the `window` node receives.)

Example:

stream
    |window()
        .period(10m)
        .every(5m)
    |httpOut('recent')

This example emits the last `10 minute` period every `5 minutes` to the pipeline's `httpOut` node. Because `every` is less than `period`, each time the window is emitted it contains `5 minutes` of new data and `5 minutes` of the previous period's data.

NOTE: Because no `align` property is defined, the `window` edge is defined relative to the first data point.

func (*WindowNode) Alert

func (n *WindowNode) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (*WindowNode) Align

func (w *WindowNode) Align() *WindowNode

If the `align` property is not used to modify the `window` node, then the window alignment is assumed to start at the time of the first data point it receives. If `align` property is set, the window time edges will be truncated to the `every` property (For example, if a data point's time is 12:06 and the `every` property is `5m` then the data point's window will range from 12:05 to 12:10). tick:property

func (*WindowNode) Barrier added in v1.4.0

func (n *WindowNode) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (*WindowNode) Bottom added in v0.11.0

func (n *WindowNode) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (*WindowNode) ChangeDetect added in v1.5.0

func (n *WindowNode) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (*WindowNode) Combine added in v1.0.0

func (n *WindowNode) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (*WindowNode) Count added in v0.11.0

func (n *WindowNode) Count(field string) *InfluxQLNode

Count the number of points.

func (*WindowNode) CumulativeSum added in v1.1.0

func (n *WindowNode) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*WindowNode) Default added in v0.13.0

func (n *WindowNode) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (*WindowNode) Delete added in v1.0.0

func (n *WindowNode) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (*WindowNode) Derivative

func (n *WindowNode) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (*WindowNode) Difference added in v1.0.0

func (n *WindowNode) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (*WindowNode) Distinct added in v0.11.0

func (n *WindowNode) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (*WindowNode) Ec2Autoscale added in v1.4.0

func (n *WindowNode) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (*WindowNode) Elapsed added in v0.13.0

func (n *WindowNode) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (*WindowNode) Eval

func (n *WindowNode) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (*WindowNode) FillPeriod added in v1.2.0

func (w *WindowNode) FillPeriod() *WindowNode

FillPeriod instructs the WindowNode to wait till the period has elapsed before emitting the first batch. This only applies if the period is greater than the every value. tick:property

func (*WindowNode) First added in v0.11.0

func (n *WindowNode) First(field string) *InfluxQLNode

Select the first point.

func (*WindowNode) Flatten added in v1.0.0

func (n *WindowNode) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (*WindowNode) GroupBy

func (n *WindowNode) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (*WindowNode) HoltWinters added in v1.0.0

func (n *WindowNode) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (*WindowNode) HoltWintersWithFit added in v1.0.0

func (n *WindowNode) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (*WindowNode) HttpOut

func (n *WindowNode) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (*WindowNode) HttpPost added in v1.3.0

func (n *WindowNode) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (*WindowNode) InfluxDBOut

func (n *WindowNode) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (*WindowNode) Join

func (n *WindowNode) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (*WindowNode) K8sAutoscale added in v1.1.0

func (n *WindowNode) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (*WindowNode) KapacitorLoopback added in v1.3.0

func (n *WindowNode) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (*WindowNode) Last added in v0.11.0

func (n *WindowNode) Last(field string) *InfluxQLNode

Select the last point.

func (*WindowNode) Log added in v0.11.0

func (n *WindowNode) Log() *LogNode

Create a node that logs all data it receives.

func (*WindowNode) MarshalJSON added in v1.4.0

func (n *WindowNode) MarshalJSON() ([]byte, error)

MarshalJSON converts WindowNode to JSON tick:ignore

func (*WindowNode) Max added in v0.11.0

func (n *WindowNode) Max(field string) *InfluxQLNode

Select the maximum point.

func (*WindowNode) Mean added in v0.11.0

func (n *WindowNode) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (*WindowNode) Median added in v0.11.0

func (n *WindowNode) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (*WindowNode) Min added in v0.11.0

func (n *WindowNode) Min(field string) *InfluxQLNode

Select the minimum point.

func (*WindowNode) Mode added in v1.0.0

func (n *WindowNode) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (*WindowNode) MovingAverage added in v1.0.0

func (n *WindowNode) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (*WindowNode) Percentile added in v0.11.0

func (n *WindowNode) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (*WindowNode) Sample

func (n *WindowNode) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (*WindowNode) Shift added in v0.11.0

func (n *WindowNode) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (*WindowNode) Sideload added in v1.4.0

func (n *WindowNode) Sideload() *SideloadNode

Create a node that can load data from external sources

func (*WindowNode) Spread added in v0.11.0

func (n *WindowNode) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (*WindowNode) StateCount added in v1.3.0

func (n *WindowNode) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (*WindowNode) StateDuration added in v1.3.0

func (n *WindowNode) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (*WindowNode) Stddev added in v0.11.0

func (n *WindowNode) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (*WindowNode) Sum added in v0.11.0

func (n *WindowNode) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (*WindowNode) SwarmAutoscale added in v1.4.0

func (n *WindowNode) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (*WindowNode) Top added in v0.11.0

func (n *WindowNode) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (*WindowNode) Trickle added in v1.6.0

func (n *WindowNode) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (*WindowNode) Union

func (n *WindowNode) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (*WindowNode) UnmarshalJSON added in v1.4.0

func (n *WindowNode) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to an WindowNode tick:ignore

func (*WindowNode) Where

func (n *WindowNode) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (*WindowNode) Window

func (n *WindowNode) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

type ZenossHandler added in v1.6.0

type ZenossHandler struct {
	*AlertNodeData `json:"-"`

	// Zenoss API URL to post alerts.
	// If empty uses the URL from the configuration.
	URL string `json:"url"`

	// Username for BASIC authentication.
	// If empty uses username from the configuration.
	Username string `json:"username"`

	// Password for BASIC authentication.
	// If empty uses password from the configuration.
	Password string `json:"password"`

	// Action (router name).
	// If empty uses value from the configuration.
	Action string `json:"action"`

	// Router method.
	// If empty uses value from the configuration.
	Method string `json:"method"`

	// Event type.
	// If empty uses value from the configuration.
	Type string `json:"type"`

	// Temporary transaction ID.
	// If empty uses value from the configuration.
	Tid int64 `json:"tid"`

	// Collector name.
	// If empty uses value from the configuration.
	Collector string `json:"collector"`

	// Summary of the event.
	Summary string `json:"summary"`

	// Device (typically IP or hostname).
	Device string `json:"device"`

	// Component related to the event.
	Component string `json:"component"`

	// Event class key.
	EventClassKey string `json:"evclasskey"`

	// Event class.
	EventClass string `json:"evclass"`

	// Message related to the event.
	Message string `json:"message"`

	// Custom fields.
	// tick:ignore
	CustomFieldsMap map[string]interface{} `tick:"CustomField" json:"customField"`
}

tick:embedded:AlertNode.Zenoss

func (ZenossHandler) Alert added in v1.6.0

func (n ZenossHandler) Alert() *AlertNode

Create an alert node, which can trigger alerts.

func (ZenossHandler) Barrier added in v1.6.0

func (n ZenossHandler) Barrier() *BarrierNode

Create a new Barrier node that emits a BarrierMessage periodically

One BarrierMessage will be emitted every period duration

func (ZenossHandler) Bottom added in v1.6.0

func (n ZenossHandler) Bottom(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the bottom `num` points for `field` and sort by any extra tags or fields.

func (ZenossHandler) ChangeDetect added in v1.6.0

func (n ZenossHandler) ChangeDetect(fields ...string) *ChangeDetectNode

Create a new node that only emits new points if different from the previous point

func (ZenossHandler) Combine added in v1.6.0

func (n ZenossHandler) Combine(expressions ...*ast.LambdaNode) *CombineNode

Combine this node with itself. The data are combined on timestamp.

func (ZenossHandler) Count added in v1.6.0

func (n ZenossHandler) Count(field string) *InfluxQLNode

Count the number of points.

func (ZenossHandler) CumulativeSum added in v1.6.0

func (n ZenossHandler) CumulativeSum(field string) *InfluxQLNode

Compute a cumulative sum of each point that is received. A point is emitted for every point collected.

func (*ZenossHandler) CustomField added in v1.6.0

func (s *ZenossHandler) CustomField(key string, value interface{}) *ZenossHandler

CustomField adds a field to event data. tick:property

func (ZenossHandler) Default added in v1.6.0

func (n ZenossHandler) Default() *DefaultNode

Create a node that can set defaults for missing tags or fields.

func (ZenossHandler) Delete added in v1.6.0

func (n ZenossHandler) Delete() *DeleteNode

Create a node that can delete tags or fields.

func (ZenossHandler) Derivative added in v1.6.0

func (n ZenossHandler) Derivative(field string) *DerivativeNode

Create a new node that computes the derivative of adjacent points.

func (ZenossHandler) Difference added in v1.6.0

func (n ZenossHandler) Difference(field string) *InfluxQLNode

Compute the difference between points independent of elapsed time.

func (ZenossHandler) Distinct added in v1.6.0

func (n ZenossHandler) Distinct(field string) *InfluxQLNode

Produce batch of only the distinct points.

func (ZenossHandler) Ec2Autoscale added in v1.6.0

func (n ZenossHandler) Ec2Autoscale() *Ec2AutoscaleNode

Create a node that can trigger autoscale events for a ec2 autoscalegroup.

func (ZenossHandler) Elapsed added in v1.6.0

func (n ZenossHandler) Elapsed(field string, unit time.Duration) *InfluxQLNode

Compute the elapsed time between points

func (ZenossHandler) Eval added in v1.6.0

func (n ZenossHandler) Eval(expressions ...*ast.LambdaNode) *EvalNode

Create an eval node that will evaluate the given transformation function to each data point. A list of expressions may be provided and will be evaluated in the order they are given. The results are available to later expressions.

func (ZenossHandler) First added in v1.6.0

func (n ZenossHandler) First(field string) *InfluxQLNode

Select the first point.

func (ZenossHandler) Flatten added in v1.6.0

func (n ZenossHandler) Flatten() *FlattenNode

Flatten points with similar times into a single point.

func (ZenossHandler) GroupBy added in v1.6.0

func (n ZenossHandler) GroupBy(tag ...interface{}) *GroupByNode

Group the data by a set of tags.

Can pass literal * to group by all dimensions. Example:

|groupBy(*)

func (ZenossHandler) HoltWinters added in v1.6.0

func (n ZenossHandler) HoltWinters(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set.

func (ZenossHandler) HoltWintersWithFit added in v1.6.0

func (n ZenossHandler) HoltWintersWithFit(field string, h, m int64, interval time.Duration) *InfluxQLNode

Compute the holt-winters (https://docs.influxdata.com/influxdb/latest/query_language/functions/#holt-winters) forecast of a data set. This method also outputs all the points used to fit the data in addition to the forecasted data.

func (ZenossHandler) HttpOut added in v1.6.0

func (n ZenossHandler) HttpOut(endpoint string) *HTTPOutNode

Create an HTTP output node that caches the most recent data it has received. The cached data are available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at `/kapacitor/v1/tasks/<task_id>` and endpoint is `top10`, then the data can be requested from `/kapacitor/v1/tasks/<task_id>/top10`.

func (ZenossHandler) HttpPost added in v1.6.0

func (n ZenossHandler) HttpPost(url ...string) *HTTPPostNode

Creates an HTTP Post node that POSTS received data to the provided HTTP endpoint. HttpPost expects 0 or 1 arguments. If 0 arguments are provided, you must specify an endpoint property method.

func (ZenossHandler) InfluxDBOut added in v1.6.0

func (n ZenossHandler) InfluxDBOut() *InfluxDBOutNode

Create an influxdb output node that will store the incoming data into InfluxDB.

func (ZenossHandler) Join added in v1.6.0

func (n ZenossHandler) Join(others ...Node) *JoinNode

Join this node with other nodes. The data are joined on timestamp.

func (ZenossHandler) K8sAutoscale added in v1.6.0

func (n ZenossHandler) K8sAutoscale() *K8sAutoscaleNode

Create a node that can trigger autoscale events for a kubernetes cluster.

func (ZenossHandler) KapacitorLoopback added in v1.6.0

func (n ZenossHandler) KapacitorLoopback() *KapacitorLoopbackNode

Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

func (ZenossHandler) Last added in v1.6.0

func (n ZenossHandler) Last(field string) *InfluxQLNode

Select the last point.

func (ZenossHandler) Max added in v1.6.0

func (n ZenossHandler) Max(field string) *InfluxQLNode

Select the maximum point.

func (ZenossHandler) Mean added in v1.6.0

func (n ZenossHandler) Mean(field string) *InfluxQLNode

Compute the mean of the data.

func (ZenossHandler) Median added in v1.6.0

func (n ZenossHandler) Median(field string) *InfluxQLNode

Compute the median of the data. Note, this method is not a selector, if you want the median point use `.percentile(field, 50.0)`.

func (ZenossHandler) Min added in v1.6.0

func (n ZenossHandler) Min(field string) *InfluxQLNode

Select the minimum point.

func (ZenossHandler) Mode added in v1.6.0

func (n ZenossHandler) Mode(field string) *InfluxQLNode

Compute the mode of the data.

func (ZenossHandler) MovingAverage added in v1.6.0

func (n ZenossHandler) MovingAverage(field string, window int64) *InfluxQLNode

Compute a moving average of the last window points. No points are emitted until the window is full.

func (ZenossHandler) Percentile added in v1.6.0

func (n ZenossHandler) Percentile(field string, percentile float64) *InfluxQLNode

Select a point at the given percentile. This is a selector function, no interpolation between points is performed.

func (ZenossHandler) Sample added in v1.6.0

func (n ZenossHandler) Sample(rate interface{}) *SampleNode

Create a new node that samples the incoming points or batches.

One point will be emitted every count or duration specified.

func (ZenossHandler) Shift added in v1.6.0

func (n ZenossHandler) Shift(shift time.Duration) *ShiftNode

Create a new node that shifts the incoming points or batches in time.

func (ZenossHandler) Sideload added in v1.6.0

func (n ZenossHandler) Sideload() *SideloadNode

Create a node that can load data from external sources

func (ZenossHandler) Spread added in v1.6.0

func (n ZenossHandler) Spread(field string) *InfluxQLNode

Compute the difference between `min` and `max` points.

func (ZenossHandler) StateCount added in v1.6.0

func (n ZenossHandler) StateCount(expression *ast.LambdaNode) *StateCountNode

Create a node that tracks number of consecutive points in a given state.

func (ZenossHandler) StateDuration added in v1.6.0

func (n ZenossHandler) StateDuration(expression *ast.LambdaNode) *StateDurationNode

Create a node that tracks duration in a given state.

func (ZenossHandler) Stddev added in v1.6.0

func (n ZenossHandler) Stddev(field string) *InfluxQLNode

Compute the standard deviation.

func (ZenossHandler) Sum added in v1.6.0

func (n ZenossHandler) Sum(field string) *InfluxQLNode

Compute the sum of all values.

func (ZenossHandler) SwarmAutoscale added in v1.6.0

func (n ZenossHandler) SwarmAutoscale() *SwarmAutoscaleNode

Create a node that can trigger autoscale events for a docker swarm cluster.

func (ZenossHandler) Top added in v1.6.0

func (n ZenossHandler) Top(num int64, field string, fieldsAndTags ...string) *InfluxQLNode

Select the top `num` points for `field` and sort by any extra tags or fields.

func (ZenossHandler) Trickle added in v1.6.0

func (n ZenossHandler) Trickle() *TrickleNode

Create a node that converts batches (such as windowed data) into non-batches.

func (ZenossHandler) Union added in v1.6.0

func (n ZenossHandler) Union(node ...Node) *UnionNode

Perform the union of this node and all other given nodes.

func (ZenossHandler) Where added in v1.6.0

func (n ZenossHandler) Where(expression *ast.LambdaNode) *WhereNode

Create a new node that filters the data stream by a given expression.

func (ZenossHandler) Window added in v1.6.0

func (n ZenossHandler) Window() *WindowNode

Create a new node that windows the stream by time.

NOTE: Window can only be applied to stream edges.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL