From ec7a4cad169781e9162de4d0cfaaa5f596967387 Mon Sep 17 00:00:00 2001 From: d2eight Date: Wed, 10 Dec 2025 18:38:34 +0200 Subject: [PATCH 1/5] calculated fields setup --- _data/calculated-fields.yml | 6 ++ _data/pages_info.yml | 24 +++++ _includes/calculated-fields-cards.liquid | 14 +++ _includes/calculated-fields-cards.sass | 40 ++++++++ .../index.md} | 96 +------------------ .../script-calculated-field.md | 69 +++++++++++++ .../simple-calculated-field.md | 25 +++++ css/docs.sass | 1 + .../index.md} | 28 +----- .../script-calculated-field.md | 27 ++++++ .../simple-calculated-field.md | 27 ++++++ .../index.md} | 28 +----- .../script-calculated-field.md | 26 +++++ .../simple-calculated-field.md | 27 ++++++ .../index.md} | 28 +----- .../script-calculated-field.md | 26 +++++ .../simple-calculated-field.md | 26 +++++ .../index.md} | 28 +----- .../script-calculated-field.md | 26 +++++ .../simple-calculated-field.md | 25 +++++ 20 files changed, 395 insertions(+), 202 deletions(-) create mode 100644 _data/calculated-fields.yml create mode 100644 _includes/calculated-fields-cards.liquid create mode 100644 _includes/calculated-fields-cards.sass rename _includes/docs/user-guide/{calculated-fields.md => calculated-fields/index.md} (82%) create mode 100644 _includes/docs/user-guide/calculated-fields/script-calculated-field.md create mode 100644 _includes/docs/user-guide/calculated-fields/simple-calculated-field.md rename docs/paas/eu/user-guide/{calculated-fields.md => calculated-fields/index.md} (89%) create mode 100644 docs/paas/eu/user-guide/calculated-fields/script-calculated-field.md create mode 100644 docs/paas/eu/user-guide/calculated-fields/simple-calculated-field.md rename docs/paas/user-guide/{calculated-fields.md => calculated-fields/index.md} (89%) create mode 100644 docs/paas/user-guide/calculated-fields/script-calculated-field.md create mode 100644 docs/paas/user-guide/calculated-fields/simple-calculated-field.md rename docs/pe/user-guide/{calculated-fields.md => calculated-fields/index.md} (89%) create mode 100644 docs/pe/user-guide/calculated-fields/script-calculated-field.md create mode 100644 docs/pe/user-guide/calculated-fields/simple-calculated-field.md rename docs/user-guide/{calculated-fields.md => calculated-fields/index.md} (87%) create mode 100644 docs/user-guide/calculated-fields/script-calculated-field.md create mode 100644 docs/user-guide/calculated-fields/simple-calculated-field.md diff --git a/_data/calculated-fields.yml b/_data/calculated-fields.yml new file mode 100644 index 0000000000..73fd054752 --- /dev/null +++ b/_data/calculated-fields.yml @@ -0,0 +1,6 @@ +simple-calculated-field: + title: Simple calculated field + description: Simple calculated fields use basic arithmetic operations (+, -, *, /) and standard functions such as sqrt (square root), pow (power), abs (absolute value), etc. +script-calculated-field: + title: Script calculated field + description: For complex calculations, TBEL is used. It enables advanced operations such as conditional statements, loops, and access to historical data. diff --git a/_data/pages_info.yml b/_data/pages_info.yml index d6e297652b..85bd5fbdf8 100644 --- a/_data/pages_info.yml +++ b/_data/pages_info.yml @@ -1979,6 +1979,12 @@ "/docs/paas/eu/user-guide/calculated-fields/": url: "/docs/paas/eu/user-guide/calculated-fields/" redirect_from: [] +"/docs/paas/eu/user-guide/calculated-fields/script-calculated-field/": + url: "/docs/paas/eu/user-guide/calculated-fields/script-calculated-field/" + redirect_from: [] +"/docs/paas/eu/user-guide/calculated-fields/simple-calculated-field/": + url: "/docs/paas/eu/user-guide/calculated-fields/simple-calculated-field/" + redirect_from: [] "/docs/paas/eu/user-guide/certificates/": url: "/docs/paas/eu/user-guide/certificates/" redirect_from: [] @@ -2522,6 +2528,12 @@ "/docs/paas/user-guide/calculated-fields/": url: "/docs/paas/user-guide/calculated-fields/" redirect_from: [] +"/docs/paas/user-guide/calculated-fields/script-calculated-field/": + url: "/docs/paas/user-guide/calculated-fields/script-calculated-field/" + redirect_from: [] +"/docs/paas/user-guide/calculated-fields/simple-calculated-field/": + url: "/docs/paas/user-guide/calculated-fields/simple-calculated-field/" + redirect_from: [] "/docs/paas/user-guide/certificates/": url: "/docs/paas/user-guide/certificates/" redirect_from: [] @@ -3737,6 +3749,12 @@ "/docs/pe/user-guide/calculated-fields/": url: "/docs/pe/user-guide/calculated-fields/" redirect_from: [] +"/docs/pe/user-guide/calculated-fields/script-calculated-field/": + url: "/docs/pe/user-guide/calculated-fields/script-calculated-field/" + redirect_from: [] +"/docs/pe/user-guide/calculated-fields/simple-calculated-field/": + url: "/docs/pe/user-guide/calculated-fields/simple-calculated-field/" + redirect_from: [] "/docs/pe/user-guide/certificates/": url: "/docs/pe/user-guide/certificates/" redirect_from: [] @@ -4839,6 +4857,12 @@ "/docs/user-guide/calculated-fields/": url: "/docs/user-guide/calculated-fields/" redirect_from: [] +"/docs/user-guide/calculated-fields/script-calculated-field/": + url: "/docs/user-guide/calculated-fields/script-calculated-field/" + redirect_from: [] +"/docs/user-guide/calculated-fields/simple-calculated-field/": + url: "/docs/user-guide/calculated-fields/simple-calculated-field/" + redirect_from: [] "/docs/user-guide/certificates/": url: "/docs/user-guide/certificates/" redirect_from: [] diff --git a/_includes/calculated-fields-cards.liquid b/_includes/calculated-fields-cards.liquid new file mode 100644 index 0000000000..2c9b553f6a --- /dev/null +++ b/_includes/calculated-fields-cards.liquid @@ -0,0 +1,14 @@ +{% assign calculatedFields = site.data.calculated-fields %} + + diff --git a/_includes/calculated-fields-cards.sass b/_includes/calculated-fields-cards.sass new file mode 100644 index 0000000000..1ef346af80 --- /dev/null +++ b/_includes/calculated-fields-cards.sass @@ -0,0 +1,40 @@ +#docsContent + .calculated-fields + max-width: 1300px + display: flex + flex-wrap: wrap + justify-content: center + gap: 20px + margin: 40px 0 + padding-left: 0 + .field + width: 258px + list-style: none + background: #FFF + border-radius: 16px + border: 1px solid rgba(0, 0, 0, 0.08) + transition: ease-in-out 0.3s + &:hover + background: #F4F8FE + box-shadow: -4px 15px 50px -20px rgba(0, 0, 0, 0.15), 0 0 8px 0 rgba(0, 0, 0, 0.08) + .field-link + display: flex + flex-direction: column + gap: 20px + padding: 24px + &:hover + text-decoration: none + .field-text + display: flex + flex-direction: column + gap: 8px + span + font-size: 16px + font-weight: 500 + line-height: 28px + color: rgba(0, 0, 0, 0.87) + p + font-size: 14px + font-weight: 400 + line-height: 24px + color: rgba(0, 0, 0, 0.76) diff --git a/_includes/docs/user-guide/calculated-fields.md b/_includes/docs/user-guide/calculated-fields/index.md similarity index 82% rename from _includes/docs/user-guide/calculated-fields.md rename to _includes/docs/user-guide/calculated-fields/index.md index 94517dfddc..00fc8129b9 100644 --- a/_includes/docs/user-guide/calculated-fields.md +++ b/_includes/docs/user-guide/calculated-fields/index.md @@ -105,101 +105,9 @@ Time series rollingonly for Script type%,%timeSeriesRolling%,%tem {% include content-toggle.liquid content-toggle-id="calculatedfieldsargumenttype" toggle-spec=calculatedfieldsargumenttype %} -### Simple calculated field +### Calculated fields -Simple calculated fields use basic arithmetic operations (+, -, *, /) and standard functions such as `sqrt` (square root), `pow` (power), `abs` (absolute value), etc. - -#### Expression - -In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the ["Arguments"](#arguments) section. - -{% include images-gallery.html imageCollection="expression-simple-calculated-fields-1" %} - -#### Output - -The result of the calculation can be saved either as a [time series](/docs/{{docsPrefix}}user-guide/telemetry/){:target="_blank"} or as an [attribute](/docs/{{docsPrefix}}user-guide/attributes/){:target="_blank"}. -> See [how calculated field output is processed](#calculated-field-output-processing) for details on rule engine behavior and data persistence. - -In the "Output" section: -- Specify the variable type: **Time series** or **Attribute**, along with the **attribute scope**. -- Assign a name to the variable that will store the calculation result. -- Optionally, set **Decimals by default** to define how many decimal places the result should be rounded to. If not specified, the result will not be rounded. -- To finish adding the calculated field, click "Add". - -> **[Only for Time series]**
-"**Use latest timestamp**" option — when enabled, the calculated value will be stored using the most recent timestamp from the arguments telemetry instead of the server time. - -{% include images-gallery.html imageCollection="output-simple-1" %} - -### Script calculated field - -For complex calculations, [TBEL](/docs/{{docsPrefix}}user-guide/tbel/){:target="_blank"} is used. -It enables advanced operations such as conditional statements, loops, and access to historical data. - -#### Script - -Define a function that will perform calculations using the variables defined in the ["Arguments"](#arguments) section. - -> The variable name that will store the calculation result is defined within the function itself. - -
- -Example: the function below uses the `temperature` and `humidity` arguments to calculate the dew point value. -The calculation result will be stored in the variable `dewPoint`, rounding the value to one decimal places. - -```js -// Constants for Magnus formula -var a = 17.625; -var b = 243.04; - -var alpha = ((a * temperature) / (b + temperature)) + Math.log(humidity / 100.0); -var dewPoint = toFixed((b * alpha) / (a - alpha), 1); - -return {"dewPoint": dewPoint}; -``` -{: .copy-code} - -{% include images-gallery.html imageCollection="expression-script-calculated-fields-1" %} - -Script calculated fields require the definition of a `calculate(ctx, ...)` function. This function receives the `ctx` object and arguments declared in the configuration. - -```javascript -function calculate(ctx, arg1, arg2, ...): object | object[] -``` - -- `ctx`: context object that stores `latestTs` and provides access to all configured arguments. - - Context structure: - - `ctx.latestTs`: the most recent timestamp (in milliseconds) from the arguments telemetry. Useful for aligning the result with the incoming data time instead of the server time. - - `ctx.args`: an object that contains all declared arguments, where each argument can be accessed using `.` notation: - - **single value arguments** (attribute or latest telemetry): - - `ctx.args..ts`: timestamp of the argument. - - `ctx.args..value`: actual value of the argument. - - **time series rolling arguments**: - - `ctx.args..timeWindow`: object with `startTs` and `endTs` timestamps. - - `ctx.args..values`: array of `{ ts, value }` records representing timestamped telemetry. - - `ctx.args..`: call built-in aggregation methods such as `mean()`, `sum()`, `min()`, `max()`, `first()`, `last()`, `merge(...)`, and others. - > For more details, refer to the [time series rolling argument](#arguments). -- `arg1, arg2, ...`: direct access to arguments by name as function parameters. This can be useful for cleaner or more concise expressions. These arguments may be: - - single value arguments (attribute or latest telemetry arguments): telemetry value may be of type boolean, int64 (long), double, string, or JSON. - - time series rolling arguments: objects that contain time series data within a defined time window. - -Use either `ctx.args.` or direct parameter access depending on preference and context clarity. - -#### Output - -> See [how calculated field output is processed](#calculated-field-output-processing) for details on rule engine behavior and data persistence. - -The calculated values are returned as a JSON object containing **keys** that represent the computed results, which are then used to store those values in the system. - -- Specify the **Output type** for storing the calculation result: - - [Time series](/docs/{{docsPrefix}}user-guide/telemetry/){:target="_blank"}: function must return a JSON object or array with or without a timestamp containing the computed value. - - [Attribute](/docs/{{docsPrefix}}user-guide/attributes/){:target="_blank"}: function must return a JSON object **without timestamp** information containing the computed value. - - Choose the **attribute scope**: **Server attributes**, **Client attributes**, or **Shared attributes**. -- To align the result with the latest timestamp of the input arguments telemetry, use `ctx.latestTs` and assign it explicitly to the `ts` field in the returned object. -- To finish adding the calculated field, click "Add". - -{% include images-gallery.html imageCollection="output-script-1" %} +{% include calculated-fields-cards.liquid %} ### Result diff --git a/_includes/docs/user-guide/calculated-fields/script-calculated-field.md b/_includes/docs/user-guide/calculated-fields/script-calculated-field.md new file mode 100644 index 0000000000..894d58627c --- /dev/null +++ b/_includes/docs/user-guide/calculated-fields/script-calculated-field.md @@ -0,0 +1,69 @@ +### Script calculated field + +For complex calculations, [TBEL](/docs/{{docsPrefix}}user-guide/tbel/){:target="_blank"} is used. +It enables advanced operations such as conditional statements, loops, and access to historical data. + +#### Script + +Define a function that will perform calculations using the variables defined in the ["Arguments"](#arguments) section. + +> The variable name that will store the calculation result is defined within the function itself. + +
+ +Example: the function below uses the `temperature` and `humidity` arguments to calculate the dew point value. +The calculation result will be stored in the variable `dewPoint`, rounding the value to one decimal places. + +```js +// Constants for Magnus formula +var a = 17.625; +var b = 243.04; + +var alpha = ((a * temperature) / (b + temperature)) + Math.log(humidity / 100.0); +var dewPoint = toFixed((b * alpha) / (a - alpha), 1); + +return {"dewPoint": dewPoint}; +``` +{: .copy-code} + +{% include images-gallery.html imageCollection="expression-script-calculated-fields-1" %} + +Script calculated fields require the definition of a `calculate(ctx, ...)` function. This function receives the `ctx` object and arguments declared in the configuration. + +```javascript +function calculate(ctx, arg1, arg2, ...): object | object[] +``` + +- `ctx`: context object that stores `latestTs` and provides access to all configured arguments. + + Context structure: + - `ctx.latestTs`: the most recent timestamp (in milliseconds) from the arguments telemetry. Useful for aligning the result with the incoming data time instead of the server time. + - `ctx.args`: an object that contains all declared arguments, where each argument can be accessed using `.` notation: + - **single value arguments** (attribute or latest telemetry): + - `ctx.args..ts`: timestamp of the argument. + - `ctx.args..value`: actual value of the argument. + - **time series rolling arguments**: + - `ctx.args..timeWindow`: object with `startTs` and `endTs` timestamps. + - `ctx.args..values`: array of `{ ts, value }` records representing timestamped telemetry. + - `ctx.args..`: call built-in aggregation methods such as `mean()`, `sum()`, `min()`, `max()`, `first()`, `last()`, `merge(...)`, and others. + > For more details, refer to the [time series rolling argument](#arguments). +- `arg1, arg2, ...`: direct access to arguments by name as function parameters. This can be useful for cleaner or more concise expressions. These arguments may be: + - single value arguments (attribute or latest telemetry arguments): telemetry value may be of type boolean, int64 (long), double, string, or JSON. + - time series rolling arguments: objects that contain time series data within a defined time window. + +Use either `ctx.args.` or direct parameter access depending on preference and context clarity. + +#### Output + +> See [how calculated field output is processed](#calculated-field-output-processing) for details on rule engine behavior and data persistence. + +The calculated values are returned as a JSON object containing **keys** that represent the computed results, which are then used to store those values in the system. + +- Specify the **Output type** for storing the calculation result: + - [Time series](/docs/{{docsPrefix}}user-guide/telemetry/){:target="_blank"}: function must return a JSON object or array with or without a timestamp containing the computed value. + - [Attribute](/docs/{{docsPrefix}}user-guide/attributes/){:target="_blank"}: function must return a JSON object **without timestamp** information containing the computed value. + - Choose the **attribute scope**: **Server attributes**, **Client attributes**, or **Shared attributes**. +- To align the result with the latest timestamp of the input arguments telemetry, use `ctx.latestTs` and assign it explicitly to the `ts` field in the returned object. +- To finish adding the calculated field, click "Add". + +{% include images-gallery.html imageCollection="output-script-1" %} \ No newline at end of file diff --git a/_includes/docs/user-guide/calculated-fields/simple-calculated-field.md b/_includes/docs/user-guide/calculated-fields/simple-calculated-field.md new file mode 100644 index 0000000000..5fcbd0ff52 --- /dev/null +++ b/_includes/docs/user-guide/calculated-fields/simple-calculated-field.md @@ -0,0 +1,25 @@ +### Simple calculated field + +Simple calculated fields use basic arithmetic operations (+, -, *, /) and standard functions such as `sqrt` (square root), `pow` (power), `abs` (absolute value), etc. + +#### Expression + +In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the ["Arguments"](#arguments) section. + +{% include images-gallery.html imageCollection="expression-simple-calculated-fields-1" %} + +#### Output + +The result of the calculation can be saved either as a [time series](/docs/{{docsPrefix}}user-guide/telemetry/){:target="_blank"} or as an [attribute](/docs/{{docsPrefix}}user-guide/attributes/){:target="_blank"}. +> See [how calculated field output is processed](#calculated-field-output-processing) for details on rule engine behavior and data persistence. + +In the "Output" section: +- Specify the variable type: **Time series** or **Attribute**, along with the **attribute scope**. +- Assign a name to the variable that will store the calculation result. +- Optionally, set **Decimals by default** to define how many decimal places the result should be rounded to. If not specified, the result will not be rounded. +- To finish adding the calculated field, click "Add". + +> **[Only for Time series]**
+"**Use latest timestamp**" option — when enabled, the calculated value will be stored using the most recent timestamp from the arguments telemetry instead of the server time. + +{% include images-gallery.html imageCollection="output-simple-1" %} \ No newline at end of file diff --git a/css/docs.sass b/css/docs.sass index 6d62de8d11..6691527ea2 100644 --- a/css/docs.sass +++ b/css/docs.sass @@ -25,6 +25,7 @@ @import "../_includes/content-toggle-liquid" @import "../_includes/images-gallery" @import "../_includes/rule-node-cards" +@import "../_includes/calculated-fields-cards" @import "../_includes/manual-breadcrumbs" @import "../_includes/usecase-nav" @import "../_includes/trendz-wizard" diff --git a/docs/paas/eu/user-guide/calculated-fields.md b/docs/paas/eu/user-guide/calculated-fields/index.md similarity index 89% rename from docs/paas/eu/user-guide/calculated-fields.md rename to docs/paas/eu/user-guide/calculated-fields/index.md index 7601c35c61..4204b505f8 100644 --- a/docs/paas/eu/user-guide/calculated-fields.md +++ b/docs/paas/eu/user-guide/calculated-fields/index.md @@ -47,32 +47,6 @@ time-series-rolling-argument-type: image: /images/user-guide/calculated-fields/time-series-rolling-argument-type-2-pe.png title: 'A new argument has been added.' -expression-simple-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-pe.png - title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' - -output-simple-1: - 0: - image: /images/user-guide/calculated-fields/output-simple-1-pe.png - title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' - 1: - image: /images/user-guide/calculated-fields/output-simple-2-pe.png - title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' - -expression-script-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-pe.png - title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' - -output-script-1: - 0: - image: /images/user-guide/calculated-fields/output-script-1-pe.png - title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' - 1: - image: /images/user-guide/calculated-fields/output-script-2-pe.png - title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' - calculated-field-result: 0: image: /images/user-guide/calculated-fields/calculated-field-result-1-pe.png @@ -238,4 +212,4 @@ example-script-calculated-fields-3: {% assign docsPrefix = "paas/eu/" %} {% include get-hosts-name.html docsPrefix=docsPrefix %} -{% include docs/user-guide/calculated-fields.md %} \ No newline at end of file +{% include docs/user-guide/calculated-fields/index.md %} \ No newline at end of file diff --git a/docs/paas/eu/user-guide/calculated-fields/script-calculated-field.md b/docs/paas/eu/user-guide/calculated-fields/script-calculated-field.md new file mode 100644 index 0000000000..01c586cbc0 --- /dev/null +++ b/docs/paas/eu/user-guide/calculated-fields/script-calculated-field.md @@ -0,0 +1,27 @@ +--- +layout: docwithnav-paas-eu +title: Script calculated field +description: For complex calculations, TBEL is used. It enables advanced operations such as conditional statements, loops, and access to historical data. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + + +expression-script-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-pe.png + title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' + +output-script-1: + 0: + image: /images/user-guide/calculated-fields/output-script-1-pe.png + title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' + 1: + image: /images/user-guide/calculated-fields/output-script-2-pe.png + title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' + +--- + +{% assign docsPrefix = "paas/eu/" %} +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/script-calculated-field.md %} \ No newline at end of file diff --git a/docs/paas/eu/user-guide/calculated-fields/simple-calculated-field.md b/docs/paas/eu/user-guide/calculated-fields/simple-calculated-field.md new file mode 100644 index 0000000000..ead4f432e2 --- /dev/null +++ b/docs/paas/eu/user-guide/calculated-fields/simple-calculated-field.md @@ -0,0 +1,27 @@ +--- +layout: docwithnav-paas-eu +title: Simple calculated field +description: Simple calculated fields use basic arithmetic operations (+, -, *, /) and standard functions such as sqrt (square root), pow (power), abs (absolute value), etc. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + + +expression-simple-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-pe.png + title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' + +output-simple-1: + 0: + image: /images/user-guide/calculated-fields/output-simple-1-pe.png + title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' + 1: + image: /images/user-guide/calculated-fields/output-simple-2-pe.png + title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' + +--- + +{% assign docsPrefix = "paas/eu/" %} +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/simple-calculated-field.md %} \ No newline at end of file diff --git a/docs/paas/user-guide/calculated-fields.md b/docs/paas/user-guide/calculated-fields/index.md similarity index 89% rename from docs/paas/user-guide/calculated-fields.md rename to docs/paas/user-guide/calculated-fields/index.md index 1777e8658b..89d1184f8c 100644 --- a/docs/paas/user-guide/calculated-fields.md +++ b/docs/paas/user-guide/calculated-fields/index.md @@ -47,32 +47,6 @@ time-series-rolling-argument-type: image: /images/user-guide/calculated-fields/time-series-rolling-argument-type-2-pe.png title: 'A new argument has been added.' -expression-simple-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-pe.png - title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' - -output-simple-1: - 0: - image: /images/user-guide/calculated-fields/output-simple-1-pe.png - title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' - 1: - image: /images/user-guide/calculated-fields/output-simple-2-pe.png - title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' - -expression-script-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-pe.png - title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' - -output-script-1: - 0: - image: /images/user-guide/calculated-fields/output-script-1-pe.png - title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' - 1: - image: /images/user-guide/calculated-fields/output-script-2-pe.png - title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' - calculated-field-result: 0: image: /images/user-guide/calculated-fields/calculated-field-result-1-pe.png @@ -238,4 +212,4 @@ example-script-calculated-fields-3: {% assign docsPrefix = "paas/" %} {% include get-hosts-name.html docsPrefix=docsPrefix %} -{% include docs/user-guide/calculated-fields.md %} \ No newline at end of file +{% include docs/user-guide/calculated-fields/index.md %} \ No newline at end of file diff --git a/docs/paas/user-guide/calculated-fields/script-calculated-field.md b/docs/paas/user-guide/calculated-fields/script-calculated-field.md new file mode 100644 index 0000000000..0a02b422da --- /dev/null +++ b/docs/paas/user-guide/calculated-fields/script-calculated-field.md @@ -0,0 +1,26 @@ +--- +layout: docwithnav-paas +title: Script calculated field +description: For complex calculations, TBEL is used. It enables advanced operations such as conditional statements, loops, and access to historical data. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + +expression-script-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-pe.png + title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' + +output-script-1: + 0: + image: /images/user-guide/calculated-fields/output-script-1-pe.png + title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' + 1: + image: /images/user-guide/calculated-fields/output-script-2-pe.png + title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' + +--- + +{% assign docsPrefix = "paas/" %} +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/script-calculated-field.md %} \ No newline at end of file diff --git a/docs/paas/user-guide/calculated-fields/simple-calculated-field.md b/docs/paas/user-guide/calculated-fields/simple-calculated-field.md new file mode 100644 index 0000000000..05202eb7aa --- /dev/null +++ b/docs/paas/user-guide/calculated-fields/simple-calculated-field.md @@ -0,0 +1,27 @@ +--- +layout: docwithnav-paas +title: Simple calculated field +description: Simple calculated fields use basic arithmetic operations (+, -, *, /) and standard functions such as sqrt (square root), pow (power), abs (absolute value), etc. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + + +expression-simple-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-pe.png + title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' + +output-simple-1: + 0: + image: /images/user-guide/calculated-fields/output-simple-1-pe.png + title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' + 1: + image: /images/user-guide/calculated-fields/output-simple-2-pe.png + title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' + +--- + +{% assign docsPrefix = "paas/" %} +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/simple-calculated-field.md %} \ No newline at end of file diff --git a/docs/pe/user-guide/calculated-fields.md b/docs/pe/user-guide/calculated-fields/index.md similarity index 89% rename from docs/pe/user-guide/calculated-fields.md rename to docs/pe/user-guide/calculated-fields/index.md index ada3675bf7..6a8ff1705b 100644 --- a/docs/pe/user-guide/calculated-fields.md +++ b/docs/pe/user-guide/calculated-fields/index.md @@ -47,32 +47,6 @@ time-series-rolling-argument-type: image: /images/user-guide/calculated-fields/time-series-rolling-argument-type-2-pe.png title: 'A new argument has been added.' -expression-simple-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-pe.png - title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' - -output-simple-1: - 0: - image: /images/user-guide/calculated-fields/output-simple-1-pe.png - title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' - 1: - image: /images/user-guide/calculated-fields/output-simple-2-pe.png - title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' - -expression-script-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-pe.png - title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' - -output-script-1: - 0: - image: /images/user-guide/calculated-fields/output-script-1-pe.png - title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' - 1: - image: /images/user-guide/calculated-fields/output-script-2-pe.png - title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' - calculated-field-result: 0: image: /images/user-guide/calculated-fields/calculated-field-result-1-pe.png @@ -238,4 +212,4 @@ example-script-calculated-fields-3: {% assign docsPrefix = "pe/" %} {% include get-hosts-name.html docsPrefix=docsPrefix %} -{% include docs/user-guide/calculated-fields.md %} \ No newline at end of file +{% include docs/user-guide/calculated-fields/index.md %} \ No newline at end of file diff --git a/docs/pe/user-guide/calculated-fields/script-calculated-field.md b/docs/pe/user-guide/calculated-fields/script-calculated-field.md new file mode 100644 index 0000000000..5eec1bf6ea --- /dev/null +++ b/docs/pe/user-guide/calculated-fields/script-calculated-field.md @@ -0,0 +1,26 @@ +--- +layout: docwithnav-pe +title: Script calculated field +description: For complex calculations, TBEL is used. It enables advanced operations such as conditional statements, loops, and access to historical data. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + +expression-script-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-pe.png + title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' + +output-script-1: + 0: + image: /images/user-guide/calculated-fields/output-script-1-pe.png + title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' + 1: + image: /images/user-guide/calculated-fields/output-script-2-pe.png + title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' + +--- + +{% assign docsPrefix = "pe/" %} +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/script-calculated-field.md %} \ No newline at end of file diff --git a/docs/pe/user-guide/calculated-fields/simple-calculated-field.md b/docs/pe/user-guide/calculated-fields/simple-calculated-field.md new file mode 100644 index 0000000000..e8ab3432c9 --- /dev/null +++ b/docs/pe/user-guide/calculated-fields/simple-calculated-field.md @@ -0,0 +1,26 @@ +--- +layout: docwithnav-pe +title: Simple calculated field +description: Simple calculated fields use basic arithmetic operations (+, -, *, /) and standard functions such as sqrt (square root), pow (power), abs (absolute value), etc. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + +expression-simple-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-pe.png + title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' + +output-simple-1: + 0: + image: /images/user-guide/calculated-fields/output-simple-1-pe.png + title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' + 1: + image: /images/user-guide/calculated-fields/output-simple-2-pe.png + title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' + +--- + +{% assign docsPrefix = "pe/" %} +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/simple-calculated-field.md %} \ No newline at end of file diff --git a/docs/user-guide/calculated-fields.md b/docs/user-guide/calculated-fields/index.md similarity index 87% rename from docs/user-guide/calculated-fields.md rename to docs/user-guide/calculated-fields/index.md index 42e71f78dd..eb4143f34f 100644 --- a/docs/user-guide/calculated-fields.md +++ b/docs/user-guide/calculated-fields/index.md @@ -47,32 +47,6 @@ time-series-rolling-argument-type: image: /images/user-guide/calculated-fields/time-series-rolling-argument-type-2-ce.png title: 'A new argument has been added.' -expression-simple-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-ce.png - title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' - -output-simple-1: - 0: - image: /images/user-guide/calculated-fields/output-simple-1-ce.png - title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' - 1: - image: /images/user-guide/calculated-fields/output-simple-2-ce.png - title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' - -expression-script-calculated-fields-1: - 0: - image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-ce.png - title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' - -output-script-1: - 0: - image: /images/user-guide/calculated-fields/output-script-1-ce.png - title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' - 1: - image: /images/user-guide/calculated-fields/output-script-2-ce.png - title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' - calculated-field-result: 0: image: /images/user-guide/calculated-fields/calculated-field-result-1-ce.png @@ -200,4 +174,4 @@ example-script-calculated-fields-3: --- {% include get-hosts-name.html docsPrefix=docsPrefix %} -{% include docs/user-guide/calculated-fields.md %} \ No newline at end of file +{% include docs/user-guide/calculated-fields/index.md %} \ No newline at end of file diff --git a/docs/user-guide/calculated-fields/script-calculated-field.md b/docs/user-guide/calculated-fields/script-calculated-field.md new file mode 100644 index 0000000000..439277e620 --- /dev/null +++ b/docs/user-guide/calculated-fields/script-calculated-field.md @@ -0,0 +1,26 @@ +--- +layout: docwithnav +title: Script calculated field +description: For complex calculations, TBEL is used. It enables advanced operations such as conditional statements, loops, and access to historical data. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + + +expression-script-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-script-calculated-fields-1-ce.png + title: 'Define a function that will perform calculations using the variables defined in the "Arguments" section. The variable name that will store the calculation result is defined within the function itself.' + +output-script-1: + 0: + image: /images/user-guide/calculated-fields/output-script-1-ce.png + title: 'Time series: function must return a JSON object or array with or without a timestamp containing the computed value.' + 1: + image: /images/user-guide/calculated-fields/output-script-2-ce.png + title: 'Attribute: function must return a JSON object without timestamp information containing the computed value.' + +--- + +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/script-calculated-field.md %} \ No newline at end of file diff --git a/docs/user-guide/calculated-fields/simple-calculated-field.md b/docs/user-guide/calculated-fields/simple-calculated-field.md new file mode 100644 index 0000000000..4180e4262b --- /dev/null +++ b/docs/user-guide/calculated-fields/simple-calculated-field.md @@ -0,0 +1,25 @@ +--- +layout: docwithnav +title: Simple calculated field +description: Simple calculated fields use basic arithmetic operations (+, -, *, /) and standard functions such as sqrt (square root), pow (power), abs (absolute value), etc. +breadcrumbs: "true" +breadcrumbs-steps: "1" +hidetoc: "true" + +expression-simple-calculated-fields-1: + 0: + image: /images/user-guide/calculated-fields/expression-simple-calculated-fields-1-ce.png + title: 'In the "Expression" section, enter the mathematical expression for the calculation using the variables defined in the "Arguments" section.' + +output-simple-1: + 0: + image: /images/user-guide/calculated-fields/output-simple-1-ce.png + title: 'Select the output type as "Time series". Set a name to the variable that will store the calculation result. Optionally, specify the number of decimal places.' + 1: + image: /images/user-guide/calculated-fields/output-simple-2-ce.png + title: 'Select the output type as "Attribute" and choose its scope: "Server attributes", "Client attributes", or "Shared attributes". Set a name to the variable that will store the calculation result. Optionally, set the number of decimal places.' + +--- + +{% include get-hosts-name.html docsPrefix=docsPrefix %} +{% include docs/user-guide/calculated-fields/simple-calculated-field.md %} \ No newline at end of file From 90b9b79af438264e71a643475da32f7f40607d82 Mon Sep 17 00:00:00 2001 From: d2eight Date: Thu, 11 Dec 2025 14:04:10 +0200 Subject: [PATCH 2/5] Calculated fields, only ce --- _data/pages_info.yml | 18 ------------- _includes/calculated-fields-cards.liquid | 2 +- .../script-calculated-field.md | 3 ++- .../simple-calculated-field.md | 3 ++- .../script-calculated-field.md | 27 ------------------- .../simple-calculated-field.md | 27 ------------------- .../script-calculated-field.md | 26 ------------------ .../simple-calculated-field.md | 27 ------------------- .../script-calculated-field.md | 26 ------------------ .../simple-calculated-field.md | 26 ------------------ .../script-calculated-field.md | 1 - 11 files changed, 5 insertions(+), 181 deletions(-) delete mode 100644 docs/paas/eu/user-guide/calculated-fields/script-calculated-field.md delete mode 100644 docs/paas/eu/user-guide/calculated-fields/simple-calculated-field.md delete mode 100644 docs/paas/user-guide/calculated-fields/script-calculated-field.md delete mode 100644 docs/paas/user-guide/calculated-fields/simple-calculated-field.md delete mode 100644 docs/pe/user-guide/calculated-fields/script-calculated-field.md delete mode 100644 docs/pe/user-guide/calculated-fields/simple-calculated-field.md diff --git a/_data/pages_info.yml b/_data/pages_info.yml index 85bd5fbdf8..7c37afebb4 100644 --- a/_data/pages_info.yml +++ b/_data/pages_info.yml @@ -1979,12 +1979,6 @@ "/docs/paas/eu/user-guide/calculated-fields/": url: "/docs/paas/eu/user-guide/calculated-fields/" redirect_from: [] -"/docs/paas/eu/user-guide/calculated-fields/script-calculated-field/": - url: "/docs/paas/eu/user-guide/calculated-fields/script-calculated-field/" - redirect_from: [] -"/docs/paas/eu/user-guide/calculated-fields/simple-calculated-field/": - url: "/docs/paas/eu/user-guide/calculated-fields/simple-calculated-field/" - redirect_from: [] "/docs/paas/eu/user-guide/certificates/": url: "/docs/paas/eu/user-guide/certificates/" redirect_from: [] @@ -2528,12 +2522,6 @@ "/docs/paas/user-guide/calculated-fields/": url: "/docs/paas/user-guide/calculated-fields/" redirect_from: [] -"/docs/paas/user-guide/calculated-fields/script-calculated-field/": - url: "/docs/paas/user-guide/calculated-fields/script-calculated-field/" - redirect_from: [] -"/docs/paas/user-guide/calculated-fields/simple-calculated-field/": - url: "/docs/paas/user-guide/calculated-fields/simple-calculated-field/" - redirect_from: [] "/docs/paas/user-guide/certificates/": url: "/docs/paas/user-guide/certificates/" redirect_from: [] @@ -3749,12 +3737,6 @@ "/docs/pe/user-guide/calculated-fields/": url: "/docs/pe/user-guide/calculated-fields/" redirect_from: [] -"/docs/pe/user-guide/calculated-fields/script-calculated-field/": - url: "/docs/pe/user-guide/calculated-fields/script-calculated-field/" - redirect_from: [] -"/docs/pe/user-guide/calculated-fields/simple-calculated-field/": - url: "/docs/pe/user-guide/calculated-fields/simple-calculated-field/" - redirect_from: [] "/docs/pe/user-guide/certificates/": url: "/docs/pe/user-guide/certificates/" redirect_from: [] diff --git a/_includes/calculated-fields-cards.liquid b/_includes/calculated-fields-cards.liquid index 2c9b553f6a..e26b80bc42 100644 --- a/_includes/calculated-fields-cards.liquid +++ b/_includes/calculated-fields-cards.liquid @@ -3,7 +3,7 @@