#[non_exhaustive]pub struct LogMatch {
pub filter: String,
pub label_extractors: HashMap<String, String>,
}Expand description
A condition type that checks whether a log message in the scoping project satisfies the given filter. Logs from other projects in the metrics scope are not evaluated.
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.filter: StringRequired. A logs-based filter. See Advanced Logs Queries for how this filter should be constructed.
label_extractors: HashMap<String, String>Optional. A map from a label key to an extractor expression, which is
used to extract the value for this label key. Each entry in this map is
a specification for how data should be extracted from log entries that
match filter. Each combination of extracted values is treated as a
separate rule for the purposes of triggering notifications. Label keys
and corresponding values can be used in notifications generated by this
condition.
Please see the documentation on logs-based metric
valueExtractors
for syntax and examples.
Implementations§
Source§impl LogMatch
impl LogMatch
Sourcepub fn set_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_filter<T: Into<String>>(self, v: T) -> Self
Sets the value of filter.
Sourcepub fn set_label_extractors<T, K, V>(self, v: T) -> Self
pub fn set_label_extractors<T, K, V>(self, v: T) -> Self
Sets the value of label_extractors.