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

fields with dots in their name can overwrite each other #3628

Closed
joegallo opened this issue Feb 20, 2017 · 2 comments · Fixed by #13909
Closed

fields with dots in their name can overwrite each other #3628

joegallo opened this issue Feb 20, 2017 · 2 comments · Fixed by #13909
Assignees

Comments

@joegallo
Copy link

With this config, I see my.field3 for each of my log events, but my.field1 and my.field2 don't appear. If I remove the fields definition for the prospector, however, then my.field1 and my.field2 do appear.

filebeat.prospectors:
- input_type: log
  paths:
    - foobar.log
  fields_under_root: true
  fields:
    my.field3: "field3"

fields_under_root: true
fields:
  my.field1: "field1"
  my.field2: "field2"

Likewise, if I use underscores instead of dots as separators (e.g. my_field1), then everything works as I'd expect.

  • Version: 5.2.1
  • Operating System: OSX, Linux
  • Steps to Reproduce:
@tsg
Copy link
Contributor

tsg commented Feb 20, 2017

Marking it as a bug, even though the code actually works as initially intended, because we should revisit if the current behavior is the one we want.

@joegallo
Copy link
Author

Another workaround for this is to repeat the global fields in each location where they would otherwise be lost due to the overwriting, e.g.:

filebeat.prospectors:
- input_type: log
  paths:
    - foobar.log
  fields_under_root: true
  fields:
    my.field1: "field1" # repeated
    my.field2: "field2" # repeated
    my.field3: "field3"

- input_type: log
  paths:
    - bazquux.log
  # don't need to repeat field1 and field2 here, it'll just work since there's no field3 to overwrite them

fields_under_root: true
fields:
  my.field1: "field1"
  my.field2: "field2"

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

Successfully merging a pull request may close this issue.

3 participants