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

id_key should allow nested fields #347

Closed
tom932 opened this issue Jan 19, 2018 · 5 comments
Closed

id_key should allow nested fields #347

tom932 opened this issue Jan 19, 2018 · 5 comments

Comments

@tom932
Copy link

tom932 commented Jan 19, 2018

Problem

I have several fields that are represented as json structures, of which i want to use one's value for the id.

Currently, I have to move the value of such a nested field to an own field via a record_transformer in order to use it in id_key.

Is there a possibility to use such a nested structure for the id_key command?

Steps to replicate

  • have a json-structure as input with field a.b.c=val
  • try to use nested field a.b.c for id_key
  • the id setting doesn't work, a random id is generated.

Expected Behavior or What you need to ask

Key within nested structure is usable for the id

@tom932 tom932 changed the title id_key should allow nested keys id_key should allow nested fields Jan 19, 2018
@cosmo0920
Copy link
Collaborator

This request for 2.x series?
If so, it should be possible to specify nested structured record's key with record_accessor plugin helper.
For 1.x, it is not easy to implement your request.

@tom932
Copy link
Author

tom932 commented Jan 22, 2018

I'm currently using fluentd v0.12 (since I use another github project), therefore I used 1.13.0 of your plugin, since the documentation stated that v2.x.y doesn't work with fluentd 0.12.
If it is too hard to implement, I can use the work-around with writing the data to a seperate, non-nested filed.

@cosmo0920
Copy link
Collaborator

cosmo0920 commented Jan 23, 2018

I've noticed that fluent-plugin-elasticsearch 1.x should work with Ruby 1.9.
So, it is too hard to implement nested id_key feature in v0.12 branch.
Do you want to use 1.x version of this plugin with Ruby 1.9?
Dropping Ruby 1.9 support and then targeting Ruby 2.0 or later will be possible to accept your request.

@cosmo0920
Copy link
Collaborator

cosmo0920 commented Jan 25, 2018

I decided this feature request accept for v2.x and decline for 1.x.
Because, Fluentd v0.12 era, accessing nested record way had not been standardize:
fluent/fluentd#1578
Introduce nested record manipulation support on 1.x for Fluentd v0.12 version causes confuse about usability against other plugins.

@cosmo0920
Copy link
Collaborator

I've released v2.5.0 including this feature.

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

2 participants