This is archived documentation for InfluxData product versions that are no longer maintained. For newer documentation, see the latest InfluxData documentation.
Boolean literals are the keywords
They are case sensitive.
Numbers are typed and are either a
float64 or an
If the number contains a decimal it is considered to be a
float64 otherwise it is an
float64 numbers are considered to be in base 10.
If an integer is prefixed with a
0 then it is considered a base 8 (octal) number, otherwise it is considered base 10.
Valid number literals:
- 1 – int64
- 1.2 – float64
- 5 – int64
- 5.0 – float64
- 0.42 – float64
- 0400 – octal int64
There are two ways to write string literals:
Single quoted strings with backslash escaped single quotes.
'single \' quoted'becomes the literal
single ' quoted.
Triple single quoted strings with no escaping.
'''triple \' quoted'''becomes the literal
triple \' quoted.
TICKscript supports durations literals. They are of the form of InfluxQL duration literals. See https://docs.influxdata.com/influxdb/v1.2/query_language/spec/#literals
Duration literals specify a length of time. An integer literal followed immediately (with no spaces) by a duration unit listed below is interpreted as a duration literal.
Duration unit definitions
|u or µ||microseconds (1 millionth of a second)|
|ms||milliseconds (1 thousandth of a second)|
A statement begins with an identifier and any number of chaining function calls.
The result of a statement can be assigned to a variable using the
var keyword and assignment operator
var errors = stream |from() .measurement('errors') var requests = stream |from() .measurement('requests') // Join the errors and requests stream errors |join(requests) .as('errors', 'requests') |eval(lambda: "errors.value" / "requests.value")
Whitespace is ignored and can be used to format the code as you like.
Typically property methods are indented in from their calling node. This way methods along the left edge are chaining methods.
stream |eval(lambda: "views" + "errors") .as('total_views') // Increase indent for property method. |httpOut('example') // Decrease indent for chaining method.
// style single line comments are supported.