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

Clone semantics, may generate conflict due to added "type" field. #8

Open
mjscosta opened this issue Apr 20, 2016 · 8 comments · May be fixed by #12
Open

Clone semantics, may generate conflict due to added "type" field. #8

mjscosta opened this issue Apr 20, 2016 · 8 comments · May be fixed by #12
Labels

Comments

@mjscosta
Copy link

If possible add, additional configuration, for a configurable fieldref, to customize the clone descreminator attribute/value.

If your events already contain a field with the "type" value, you will be polluting the event, and may have a conflict with the clone!

Example:
clone {
clone_field => "[@metadata][type]"
}

@andrewvc andrewvc added the P4 label May 17, 2016
@shaharmor
Copy link

Any chance to support this?

@dmarkhas
Copy link

Agree, "type" is a very common field name - it doesn't make sense that logstash metadata would overwrite the original data.

@dmarkhas dmarkhas linked a pull request Oct 18, 2017 that will close this issue
@kshep
Copy link

kshep commented Sep 12, 2018

Before I go through all sorts of gymnastics with my current 'type' field, is there any update/progress on this?

@mjscosta
Copy link
Author

There's a pull request meant to address the issue, though the CI failed ... #12 ...

@kshep
Copy link

kshep commented Sep 17, 2018

For the time being I'm just using a workaround to save the old type, clone (and create a tag), then restore the old type:

filter {
  mutate {
    copy => { "type" => "pre_clone_type" }
  }
  clone {
    clones => ["clone1"]
    add_tag => ["clone1"]
  }
  mutate {
    copy => { "pre_clone_type" => "type" }
    remove_field => [ "pre_clone_type" ]
  }
}

@dmarkhas
Copy link

The CI indeed failed but due to some issue with the build server, not a problem with the (very simple) code.
We are using this code for a while without any issues.

@tomryanx
Copy link

After a few aborted attempts, I've submitted PR #20. It's very similar to #12 (which I hadn't seen in advance, sadly) but with spec and docs updated, and passing CI.

@dmarkhas
Copy link

I wouldn't get my hopes up about this ever being fixed...
You are welcome to use my fork in the meanwhile: https://github.com/dmarkhas/logstash-filter-clone

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

Successfully merging a pull request may close this issue.

6 participants