logstash-filter-translate icon indicating copy to clipboard operation
logstash-filter-translate copied to clipboard

Feature Request: Translate Multiple Fields

Open Grunticus03 opened this issue 5 years ago • 2 comments

Condensation of field and destination configuration options to a single configuration option as a hash, allowing multiple lookups and writes to separate fields where all other config options are the same.
Edit: This would not only reduce the complexity of the pipeline but also reduce the number of dictionary files that would need to be maintained by allowing merging of multiple smaller dictionary files with disparate terms.

For example, if I have three separate fields that contain the same value types to translate, I have to write out:

  translate {
    id => "Field1 Translate"
    dictionary_path => "/dictionaries/codes.yaml"
    field => "Field1"
    destination => "Field1Translate"
    refresh_behaviour => "replace"
  }
  translate {
    id => "Field2 Translate"
    dictionary_path => "/dictionaries/codes.yaml"
    field => "Field2"
    destination => "Field2Translate"
    refresh_behaviour => "replace"
  }
  translate {
    id => "Field3 Translate"
    dictionary_path => "/dictionaries/codes.yaml"
    field => "Field3"
    destination => "Field3Translate"
    refresh_behaviour => "replace"
  }

By converting the two options into a single hash type, it can be condensed down and would look like the following:

  translate {
    id => "Field Translate"
    dictionary_path => "/dictionaries/codes.yaml"
    translate => { 
      "Field1", "Field1Translate",
      "Field2", "Field2Translate",
      "Field3", "Field3Translate"
    }   
    refresh_behaviour => "replace"
  }

Grunticus03 avatar Nov 20 '18 19:11 Grunticus03