Canvas server functions

edit

[beta] This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. These functions can only execute on the server. This may be for performance or security reasons, or because the function uses an API only available on the Kibana server. If the expression is executing in the browser, it will transfer to the server when it hits one of these functions.

A * denotes a required argument.

demodata

edit

A mock data set that includes project CI times with usernames, countries, and run phases.

Accepts: filter

Argument Type Description

Unnamed (Alias: type)

string

The name of the demo data set to use (default: ci)

Returns: datatable

esdocs

edit

Queries Elasticsearch and gets back raw documents. Specify the fields you want to receive, especially if you are asking for a lot of rows.

Accepts: filter

Argument Type Description

index

string

Specify an index pattern, for example, "logstash-*" (default is _all)

Unnamed (Aliases: query, q)

string

A Lucene query string (default: _index:.kibana)

sort

string

Sort directions as "field, direction", for example, "@timestamp, desc" or "bytes, asc"

fields

string

Comma separated list of fields. Fewer fields will perform better

metaFields

string

Comma separated list of meta fields, for example, "_index,_type"

count

number

The number of docs to pull back. Smaller numbers perform better (default: 100)

Returns: datatable

escount

edit

Queries Elasticsearch for a count of the number of hits matching a query.

Accepts: filter

Argument Type Description

index

string

Specify an index pattern, for example, "logstash-*" (default: all)

Unnamed (Alias: query, q)

string

A Lucene query string (default: "-_index:.kibana")

Returns: number

essql

edit

Specifies an Elasticsearch SQL.

Accepts: filter

Argument Type Description

Unnamed* (Alias: query, q)

string

An SQL query

count

number

The default is 1000

Returns: datatable

pointseries

edit

Turns a datatable into a point series model. Currently Canvas differentiates measure from dimensions by looking for a Tiny Math function. If you enter a TinyMath expression in your argument, Canvas treats that argument as a measure. Otherwise, it is a dimension. Dimensions are combined to create unique keys. Measures are then deduplicated by those keys using the specified TinyMath function.

Accepts: datatable

Argument Type Description

x

string

The values along the X-axis

y

string

The values along the Y-axis

color

string

An expression to use in determining the mark’s color

size

string

For elements that support it, the size of the marks

text

string

For use in charts that support it, the text to show in the mark

Returns: pointseries

server

edit

Forces the interpreter to return to the server.

Accepts: Anything or nothing

Returns: Depends on your input and arguments  

timelion

edit

Uses Timelion to extract one or more time series from many sources.

Accepts: filter

Argument Type Description

Unnamed (Aliases: query, q)

string

A Timelion query (default: ".es(*)")

interval

string

Bucket interval for the time series (default: auto)

from

any

Elasticsearch date math string for the start of the time range (default: now-1y)

to

any

Elasticsearch date math string for the end of the time range (default: now)

timezone

any

Time zone for the time range (default: UTC)

Returns: datatable