Skip to content

Commit

Permalink
fix(config): Correct filter transform generation via `vector genera…
Browse files Browse the repository at this point in the history
…te` to use a comparison (#22079)

* fix(config): Correct filter transform generation via vector generate to use a comparison

* Update changelog.d/22079_correct_filter_condition_via_vector_generate.fix.md

---------

Co-authored-by: Jesse Szwedko <[email protected]>
  • Loading branch information
abcdam and jszwedko authored Jan 2, 2025
1 parent 2594837 commit d15dc01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The `filter` transform now generates a more accurate config when generated via `vector generate` by using a comparison rather than an assignment.

authors: abcdam
2 changes: 1 addition & 1 deletion src/transforms/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl From<AnyCondition> for FilterConfig {

impl GenerateConfig for FilterConfig {
fn generate_config() -> toml::Value {
toml::from_str(r#"condition = ".message = \"value\"""#).unwrap()
toml::from_str(r#"condition = ".message == \"value\"""#).unwrap()
}
}

Expand Down

0 comments on commit d15dc01

Please sign in to comment.