Conversation
a65f82e to
30cfee1
Compare
c7fc1c2 to
fe47eba
Compare
libbeat/_meta/config.reference.yml
Outdated
There was a problem hiding this comment.
Seems like this is exactly the opposite to what we have in the defaults in the code for fail_on_error and ignore_missing. Is that on purpose?
There was a problem hiding this comment.
No. Thanks for finding it.
There was a problem hiding this comment.
I think this is still missing?
There was a problem hiding this comment.
What happens if you copy message.original to message? Will it fail?
There was a problem hiding this comment.
I set message.original as a single key containing a dot, so it does not lead to an error when someone wants to manipulate the submaps under message. It is a different key.
If the test input was different e.g. the key message was already present
Input: common.MapStr{
"message": common.MapStr{
"original": 42,
},
}It would fail and tell the user to drop the field message first, before attempting to copy stuff.
This is a more realistic test case, so I am adding it also.
There was a problem hiding this comment.
Interesting, good to know. Could you add a test case for both and one of them would fail. The reason I'm asking also for the failing one is because in case we change the behaviour of the above in the future, we will know that it has an impact.
There was a problem hiding this comment.
The test with the description "copy number from hierarchical message.original to top level message which fails" will fail if the behaviour changes, as the new field would show up in the output. I have also added a new test case which demonstrates what happens when the key contains a dot and is present as a top level key in the fields. If MapStr is changed one of the tests will fail.
|
Failing test in Travis is unrelated. |
There was a problem hiding this comment.
Could we have a selector for logger? I like what @andrewkroh's did in the script processor, see
And
There was a problem hiding this comment.
TBH in case of this simple processor, I don't see the added value of letting a user set a debug selector. I doubt that users would need to filter for a specific copy processor in their logs, or if they have to, I think messages let then identify the processor easily.
If we want to let user set a selector, it would be much better to let them configure it for all processors. There are other processors which would benefit more from having such setting than this one. What if I open an issue and implement the functionality for all processors in a follow up PR?
f4579e3 to
4d3c2f5
Compare
CHANGELOG.next.asciidoc
Outdated
| - Add `script` processor that supports using Javascript to process events. {pull}10850[10850] {pull}11260[11260] | ||
| - Add `script` processor that supports using Javascript to process events. {pull}10850[10850] | ||
| - New processor: `copy_fields`. {pull}11303[11303] | ||
| - Add error.message to events when `fail_on_error` is set in `rename` and `copy_fields` processors. {pull}11303[11303] |
|
@kvch Can you please make sure this new processor gets added to the documentation. |
A new processor is introduced as part of support for keeping orignal messages. Options and naming follows the convention of other processors.
### `copy_fields`
This processor copies one field to another. Example configuration is below:
```yaml
processors:
- copy_fields:
fields:
- from: message
to: event.original
fail_on_error: false
ignore_missing: true
```
|
@kvch can you add the docs when you have a minute? I was just looking for this functionality and couldn't find it. |
|
@kvch or @ruflin @dedemorton |
|
@zez3 Please open an issue to report Beats documentation problems. Comments on old PRs are likely to get lost. Thanks! |
|
@zez3 Also...forgot to mention that you can ask questions and search for answers in the discuss forum. |
|
@dedemorton I've opened a new 33088 Issue |
|
Thanks for creating the issue! I've added it to our project queue. |
A new processor is introduced as part of support for keeping orignal messages. Options and naming follows the convention of other processors.
copy_fieldsThis processor copies one field to another. Example configuration is below:
Blocks #11297