pub enum Transformation {
Show 26 variants
FieldNameMapping {
mapping: HashMap<String, String>,
},
FieldNamePrefixMapping {
mapping: HashMap<String, String>,
},
FieldNamePrefix {
prefix: String,
},
FieldNameSuffix {
suffix: String,
},
DropDetectionItem,
AddCondition {
conditions: HashMap<String, SigmaValue>,
negated: bool,
},
ChangeLogsource {
category: Option<String>,
product: Option<String>,
service: Option<String>,
},
ReplaceString {
regex: String,
replacement: String,
skip_special: bool,
},
ValuePlaceholders,
WildcardPlaceholders,
QueryExpressionPlaceholders {
expression: String,
},
SetState {
key: String,
value: String,
},
RuleFailure {
message: String,
},
DetectionItemFailure {
message: String,
},
FieldNameTransform {
transform_func: String,
mapping: HashMap<String, String>,
},
HashesFields {
valid_hash_algos: Vec<String>,
field_prefix: String,
drop_algo_prefix: bool,
},
MapString {
mapping: HashMap<String, Vec<String>>,
},
SetValue {
value: SigmaValue,
},
ConvertType {
target_type: String,
},
Regex,
AddField {
field: String,
},
RemoveField {
field: String,
},
SetField {
fields: Vec<String>,
},
SetCustomAttribute {
attribute: String,
value: String,
},
CaseTransformation {
case_type: String,
},
Nest {
items: Vec<TransformationItem>,
},
}Expand description
All supported pipeline transformation types.
Variants§
FieldNameMapping
Map field names via a lookup table.
FieldNamePrefixMapping
Map field name prefixes.
FieldNamePrefix
Add a prefix to all matched field names.
FieldNameSuffix
Add a suffix to all matched field names.
DropDetectionItem
Remove matching detection items.
AddCondition
Add field=value conditions to the rule’s detection.
ChangeLogsource
Replace logsource fields.
ReplaceString
Regex replacement in string values.
When skip_special is true, replacement is applied only to the plain
(non-wildcard) segments of SigmaString, preserving * and ? wildcards.
Mirrors pySigma’s ReplaceStringTransformation.skip_special.
ValuePlaceholders
Expand %name% placeholders with pipeline variables.
WildcardPlaceholders
Replace unresolved %name% placeholders with * wildcard.
QueryExpressionPlaceholders
Store expression template (no-op for eval, kept for YAML compat).
SetState
Set key-value in pipeline state.
RuleFailure
Fail if rule conditions match.
DetectionItemFailure
Fail if detection item conditions match.
FieldNameTransform
Apply a named function to field names (lowercase, uppercase, etc.). In pySigma this takes a Python callable; we support named functions.
Fields
HashesFields
Decompose the Hashes field into per-algorithm fields.
Hashes: "SHA1=abc,MD5=def" → FileSHA1: abc + FileMD5: def
Fields
MapString
Map string values via a lookup table.
Supports one-to-many mapping: a single value can map to multiple alternatives (pySigma compat). When one-to-many is used, the detection item’s values list is expanded in place.
SetValue
Set all values of matching detection items to a fixed value.
Fields
value: SigmaValueConvertType
Convert detection item values to a different type. Supported: “str”, “int”, “float”, “bool”.
Regex
Convert plain string values to regex patterns.
AddField
Add a field name to the rule’s output fields list.
RemoveField
Remove a field name from the rule’s output fields list.
SetField
Set (replace) the rule’s output fields list.
SetCustomAttribute
Set a custom attribute on the rule.
Stores the key-value pair in SigmaRule.custom_attributes as a
serde_yaml::Value::String. Backends / engines can read these to
modify per-rule behavior (e.g. rsigma.suppress, rsigma.action).
Mirrors pySigma’s SetCustomAttributeTransformation.
CaseTransformation
Apply a case transformation to string values. Supported: “lower”, “upper”, “snake_case”.
Nest
Nested sub-pipeline: apply a list of transformations as a group. The inner items share the same conditions as the outer item.
Fields
items: Vec<TransformationItem>Implementations§
Source§impl Transformation
impl Transformation
Sourcepub fn apply(
&self,
rule: &mut SigmaRule,
state: &mut PipelineState,
detection_item_conditions: &[DetectionItemCondition],
field_name_conditions: &[FieldNameCondition],
field_name_cond_not: bool,
) -> Result<bool>
pub fn apply( &self, rule: &mut SigmaRule, state: &mut PipelineState, detection_item_conditions: &[DetectionItemCondition], field_name_conditions: &[FieldNameCondition], field_name_cond_not: bool, ) -> Result<bool>
Apply this transformation to a SigmaRule, mutating it in place.
Returns Ok(true) if the transformation was applied, Ok(false) if skipped.
Trait Implementations§
Source§impl Clone for Transformation
impl Clone for Transformation
Source§fn clone(&self) -> Transformation
fn clone(&self) -> Transformation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more