pub enum SchemaPredicate {
FieldPresent(String),
FieldAbsent(String),
AnyOf(Vec<String>),
Equals {
field: String,
value: String,
},
Matches {
field: String,
regex: Regex,
},
Compare {
field: String,
op: CompareOp,
value: f64,
},
In {
field: String,
values: Vec<String>,
},
FieldEqualsField {
left: String,
right: String,
},
Not(Box<SchemaPredicate>),
Any(Vec<SchemaPredicate>),
All(Vec<SchemaPredicate>),
HasAnyField,
}Expand description
A single condition over a parsed event used to recognize a schema.
Field names use the same dot-notation as Event::get_field, so nested
shapes like Event.System.EventID or ecs.version work whether the event
is nested or carries flattened dotted keys.
Variants§
FieldPresent(String)
The named field is present (any non-absent value, including null).
FieldAbsent(String)
The named field is absent.
AnyOf(Vec<String>)
At least one of the named fields is present.
Equals
The field is present and its string-coerced value equals value
(ASCII case-insensitive).
Matches
The field is present and its string-coerced value matches regex.
Compare
The field is present, numeric-coercible, and compares to value under
op. A non-numeric or absent field fails closed (no match).
In
The field is present and its string-coerced value equals one of
values (ASCII case-insensitive). The multi-value form of Equals.
FieldEqualsField
Both fields are present, string-coercible, and equal (case-insensitive).
Not(Box<SchemaPredicate>)
Logical negation of the inner predicate.
Any(Vec<SchemaPredicate>)
At least one of the inner predicates holds (logical OR).
All(Vec<SchemaPredicate>)
All of the inner predicates hold (logical AND). Useful as a group under
Not or Any.
HasAnyField
The event has at least one structured field. Used by the
generic_json fallback to distinguish structured events from
field-less ones (raw text, empty objects), which stay “unknown”.
Trait Implementations§
Source§impl Clone for SchemaPredicate
impl Clone for SchemaPredicate
Source§fn clone(&self) -> SchemaPredicate
fn clone(&self) -> SchemaPredicate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more