Struct datadog_api_client::datadogV1::model::model_logs_arithmetic_processor::LogsArithmeticProcessor
source · #[non_exhaustive]pub struct LogsArithmeticProcessor {
pub expression: String,
pub is_enabled: Option<bool>,
pub is_replace_missing: Option<bool>,
pub name: Option<String>,
pub target: String,
pub type_: LogsArithmeticProcessorType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}Expand description
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 is0.123456789. - If you need to scale a unit of measure, see Scale Filter.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.expression: StringArithmetic operation between one or more log attributes.
is_enabled: Option<bool>Whether or not the processor is enabled.
is_replace_missing: Option<bool>If true, it replaces all missing attributes of expression by 0, false
skip the operation if an attribute is missing.
name: Option<String>Name of the processor.
target: StringName of the attribute that contains the result of the arithmetic operation.
type_: LogsArithmeticProcessorTypeType of logs arithmetic processor.
additional_properties: BTreeMap<String, Value>Implementations§
source§impl LogsArithmeticProcessor
impl LogsArithmeticProcessor
pub fn new( expression: String, target: String, type_: LogsArithmeticProcessorType, ) -> LogsArithmeticProcessor
pub fn is_enabled(self, value: bool) -> Self
pub fn is_replace_missing(self, value: bool) -> Self
pub fn name(self, value: String) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
source§impl Clone for LogsArithmeticProcessor
impl Clone for LogsArithmeticProcessor
source§fn clone(&self) -> LogsArithmeticProcessor
fn clone(&self) -> LogsArithmeticProcessor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LogsArithmeticProcessor
impl Debug for LogsArithmeticProcessor
source§impl<'de> Deserialize<'de> for LogsArithmeticProcessor
impl<'de> Deserialize<'de> for LogsArithmeticProcessor
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl PartialEq for LogsArithmeticProcessor
impl PartialEq for LogsArithmeticProcessor
source§impl Serialize for LogsArithmeticProcessor
impl Serialize for LogsArithmeticProcessor
impl StructuralPartialEq for LogsArithmeticProcessor
Auto Trait Implementations§
impl Freeze for LogsArithmeticProcessor
impl RefUnwindSafe for LogsArithmeticProcessor
impl Send for LogsArithmeticProcessor
impl Sync for LogsArithmeticProcessor
impl Unpin for LogsArithmeticProcessor
impl UnwindSafe for LogsArithmeticProcessor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)