logstash-plugins / logstash-filter-mutate

Apache License 2.0
16 stars 75 forks source link

Syntax for configuring filter is unnatural #86

Open joshuaspence opened 7 years ago

joshuaspence commented 7 years ago

The syntax for configuring the mutate filter is very strange to me. I suspect that it is old behavior that has simply been carried forward in order to prevent breaking backwards compatibility (see logstash-plugins/logstash-filter-date#71).

Basically, I would expect to configure the filter like this:

mutate {
  gsub => {
    "field_one" => { 
      "search" => "replace"
    }
    "field_two" => {
      "search" => "replace"
    }
  }
}

Instead, I must do this:

mutate {
  gsub => [
    "field_one", "search", "replace",
    "field_two", "search", "replace"
  ]
}