@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
73 lines • 2.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogsArithmeticProcessor = void 0;
/**
* Use the Arithmetic Processor to add a new attribute (without spaces or special characters
* in the new attribute name) to a log with the result of the provided formula.
* This enables you to remap different time attributes with different units into a single attribute,
* or to compute operations on attributes within the same log.
*
* The formula can use parentheses and the basic arithmetic operators `-`, `+`, `*`, `/`.
*
* By default, the calculation is skipped if an attribute is missing.
* Select “Replace missing attribute by 0” to automatically populate
* missing attribute values with 0 to ensure that the calculation is done.
* An attribute is missing if it is not found in the log attributes,
* or if it cannot be converted to a number.
*
* *Notes*:
*
* - The operator `-` needs to be space split in the formula as it can also be contained in attribute names.
* - If the target attribute already exists, it is overwritten by the result of the formula.
* - Results are rounded up to the 9th decimal. For example, if the result of the formula is `0.1234567891`,
* the actual value stored for the attribute is `0.123456789`.
* - If you need to scale a unit of measure,
* see [Scale Filter](https://docs.datadoghq.com/logs/log_configuration/parsing/?tab=filter#matcher-and-filter).
*/
class LogsArithmeticProcessor {
constructor() { }
/**
* @ignore
*/
static getAttributeTypeMap() {
return LogsArithmeticProcessor.attributeTypeMap;
}
}
exports.LogsArithmeticProcessor = LogsArithmeticProcessor;
/**
* @ignore
*/
LogsArithmeticProcessor.attributeTypeMap = {
expression: {
baseName: "expression",
type: "string",
required: true,
},
isEnabled: {
baseName: "is_enabled",
type: "boolean",
},
isReplaceMissing: {
baseName: "is_replace_missing",
type: "boolean",
},
name: {
baseName: "name",
type: "string",
},
target: {
baseName: "target",
type: "string",
required: true,
},
type: {
baseName: "type",
type: "LogsArithmeticProcessorType",
required: true,
},
additionalProperties: {
baseName: "additionalProperties",
type: "any",
},
};
//# sourceMappingURL=LogsArithmeticProcessor.js.map