2

I'm trying learn TICKscript, but official documentation is messy.

I understand part about variable declaration and expressions in it. But then there are 'nodes'. What's they are?

UPD: I even found their EBNF: https://docs.influxdata.com/kapacitor/v1.5/reference/spec/, and there is no node definition in it.

What is a node in TICKscript?

George Shuklin
  • 6,952
  • 10
  • 39
  • 80

2 Answers2

3

There is no description of node in syntax of TICKScript, because that is not syntactic concept, but semantic. Node is approximately Function { Chain } in EBNF.

Here is description of nodes from documentation: https://docs.influxdata.com/kapacitor/v1.5/nodes/

Nodes represent process invocation units that either take data as a batch or a point-by-point stream, and then alter the data, store the data, or trigger some other activity based on changes in the data (e.g., an alert).

You could see visualization of nodes, when you run kapacitor show <your_task_name>, and run DOT section of output through dot command. You will get something like:

Graph representation of TICKScript

On that picture nodes of graph will correspond to nodes of your TICKscript.

Bunyk
  • 7,635
  • 8
  • 47
  • 79
  • I tried to feed a simplest TICKscipt (which is `0`) to kapacitor, but it rejects it as `invalid task type: invalid`. What is a minimal requirements for tickscript to be accepted by kapacitor? (I want some kind of minimal 'hello world' example). – George Shuklin Jul 23 '18 at 11:34
  • @GeorgeShuklin I guess even minimal TICKscript requires some input and output. Valid task types are probably batch and stream. Here are some "hello world"-like examples: https://docs.influxdata.com/kapacitor/v1.5/tick/introduction/#basic-examples – Bunyk Jul 23 '18 at 11:43
  • Thank you, I'll play around this. (Keywords for me here are 'task types'). I want to construct something simpler than actual working kapacitor alert, just to learn TICKscript as a normal programming language. – George Shuklin Jul 23 '18 at 11:50
0

Big thanks to @Bunyk, I was able to construct a minimal TICKscript to be accepted by kapacitor.

dbrp "a"."b"
stream|from()
George Shuklin
  • 6,952
  • 10
  • 39
  • 80