Configuration parameters
Use the parameters in this section to configure this processing rule. The Telemetry Pipeline web interface uses the items in the Name column to describe these parameters. Pipeline configuration files use the items in the Key column as YAML keys.| Name | Key | Description | Default |
|---|---|---|---|
| Time window | window | Required. How long to wait (in seconds) for data to accumulate in your pipeline before computing metrics from that data. For each interval that elapses, a new set of metrics is computed. | none |
| Select keys | keys | Required. Any logs that contain matching values for all of the specified keys will be grouped together during compute operations. This parameter must be formatted as a JSON array of strings, like ["keyName1","keyName2"]. | none |
| Compute keys | compute | Required. The keys and computed metrics to include in your output data. This parameter must be formatted as a JSON object. For more information, see Compute syntax. | none |
| Comment | comment | A custom note or description of the rule’s function. This text is displayed next to the rule’s name in the Actions list in the processing rules interface. | none |
Compute syntax
The aggregate records processing rule offers three compute functions:sum, average, and count. To use these functions, the Compute keys
configuration parameter expects a JSON object with the following syntax:
"selectKey": "value": This key and value match the Select keys parameter, and together represent the log groups for which metrics are computed. If Select keys includes multiple keys, all keys and their corresponding values are included.countMetric: The number of times that"selectKey": "value"occurred within the specified time window.averageMetric: The mean value ofKEY_TO_COMPUTEwithin the specified time window and group.sumMetric: The sum of allKEY_TO_COMPUTEvalues within the specified time window and group.
Example
Using the aggregate records rule lets you retain information about the logs that pass through your pipeline without needing to retain each individual log. For example, given this sample JSON data:60, the Select keys value
["profession"], and the Compute keys value
{"headcount":["count"],"averageAge":["average","age"],"totalProjects":["sum","projects"]}
returns the following result:
profession key had four possible values, this
rule created four groups (designer, programmer, chef, and architect), and
then computed the following metrics for each group:
averageAge: The meanagevalue of every person within that group.headcount: The number of people within that group.totalProjects: The combined number of projects completed by the people within that group.