Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate for multi values fields #19

Closed
Mostafa-Ashmawy opened this issue Mar 2, 2016 · 4 comments
Closed

Translate for multi values fields #19

Mostafa-Ashmawy opened this issue Mar 2, 2016 · 4 comments

Comments

@Mostafa-Ashmawy
Copy link

Mainly we are trying to add a field productName to a document before indexing it based on the document productId using the translate plugin and a yaml dictionary file containing a mapping (productId:productName). We couldn't apply the filter to all the elements of that field.
We would like to have something like that where i is [0, basketInfos.length]
translate{
field => "[basketInfos][i][productId]"
destination => "[basketInfos][i][productName]"
dictionary_path=> "/home/ms/logstash-2.1.0/dictionary.yaml"
exact => true
}

And this is a snippet of the dictionary.yaml file
"378801434": Product-111
"417509627": Product-112
"ov393627130": Product-113

@Mostafa-Ashmawy Mostafa-Ashmawy changed the title Translate for nested documents Translate for multi field values Mar 3, 2016
@Mostafa-Ashmawy Mostafa-Ashmawy changed the title Translate for multi field values Translate for multi values fields Mar 3, 2016
@markwalkom
Copy link
Contributor

Multi-value field - arrays - support would be unreal.

@roman-parkhunovskyi
Copy link

Looks like it's addressed in #15 but has been stale for some time.

@guyboertje
Copy link

Seems like this config would express the intent:

translate {
  field => "[productId]"
  destination => "[productName]"
  foreach => "[basketInfos]"
  dictionary_path=> "/home/ms/logstash-2.1.0/dictionary.yaml"
  exact => true
}

I can implement this and I think this is useful in the other enrichment filters too.

@guyboertje
Copy link

Closing, will be covered with PR #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants