From 416c4ac76772908bc96db76ff46444baee5ea7b0 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 3 May 2023 14:49:22 -0400 Subject: [PATCH] [8.7] [Canvas] Update function reference docs (#156409) (#156609) # Backport This will backport the following commits from `main` to `8.7`: - [[Canvas] Update function reference docs (#156409)](https://github.com/elastic/kibana/pull/156409) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Catherine Liu --- .../canvas/canvas-function-reference.asciidoc | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/canvas/canvas-function-reference.asciidoc b/docs/canvas/canvas-function-reference.asciidoc index efc82bbe71f77..e62eada07172c 100644 --- a/docs/canvas/canvas-function-reference.asciidoc +++ b/docs/canvas/canvas-function-reference.asciidoc @@ -1018,6 +1018,8 @@ Aliases: `q`, `query` Default: `"-_index:.kibana"` |`index` + +Alias: `dataView` |`string` |An index or data view. For example, `"logstash-*"`. @@ -1087,6 +1089,8 @@ Default: `1000` |A comma-separated list of fields. For better performance, use fewer fields. |`index` + +Alias: `dataView` |`string` |An index or data view. For example, `"logstash-*"`. @@ -1128,7 +1132,7 @@ kibana ---- This retrieves the `Carrier`, `FlightDelayMin`, and `AvgTicketPrice` fields from the "kibana_sample_data_flights" index. -*Accepts:* `filter` +*Accepts:* `kibana_context`, `null` [cols="3*^<"] |=== @@ -1152,6 +1156,12 @@ Alias: `param` |`string`, `number`, `boolean` |A parameter to be passed to the SQL query. +|`timeField` + +Alias: `timeField` +|`string` +|The time field to use in the time range filter, which is set in the context. + |`timezone` Alias: `tz` @@ -1178,19 +1188,6 @@ exactly "age" value=50 filterGroup="group2" exactly column="project" value="beats" ---- -*Code example* -[source,text] ----- -kibana -| selectFilter -| exactly column=project value=elasticsearch -| demodata -| pointseries x=project y="mean(age)" -| plot defaultStyle={seriesStyle bars=1} -| render ----- -The `exactly` filter here is added to existing filters retrieved by the `filters` function and further filters down the data to only have `"elasticsearch"` data. The `exactly` filter only applies to this one specific element and will not affect other elements in the workpad. - *Accepts:* `filter` [cols="3*^<"] @@ -1270,7 +1267,7 @@ Aliases: `exp`, `expression`, `fn`, `function` [[filters_fn]] === `filters` -Aggregates element filters from the workpad for use elsewhere, usually a data source. +Aggregates element filters from the workpad for use elsewhere, usually a data source. <> is deprecated and will be removed in a future release. Use `kibana | selectFilter` instead. *Expression syntax* [source,js] @@ -1935,7 +1932,7 @@ Alias: `expression` [[mathColumn_fn]] === `mathColumn` -Adds a column by evaluating TinyMath on each row. This function is optimized for math, so it performs better than the mapColumn with a math +Adds a column by evaluating `TinyMath` on each row. This function is optimized for math and performs better than using a math expression in <>. *Accepts:* `datatable` @@ -1955,6 +1952,10 @@ Alias: `expression` |`string` |An evaluated `TinyMath` expression. See https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html. +|`castColumns` † +|`string` +|The column ids that are cast to numbers before the formula is applied. + |`copyMetaFrom` |`string`, `null` |If set, the meta object from the specified column id is copied over to the specified target column. If the column doesn't exist it silently fails.