I was trying to use the following config:
filter {
clone {
add_tag => [ "cloned" ]
}
}
This is not doing what i expect. My expectation is, that this will clone the current event
and the cloned one has a tag "cloned". But, there is no event clone and also
no info/warning/error log output.
The following config is doing the right:
filter {
clone {
clones => ["cloned" ]
add_tag => [ "cloned" ]
}
}
Looking at the code, it is clearly working as intended. It iterates over the values in the clones array and clones for each one. If there are no values then you get no clones. The documentation could be more explicit on that.
From my point of view it would make sense
to through an exception, if the clones-array has a zero length.
And yes, the documentation should be more explicit and
should mark this option as required.
Because otherwise, the plugin usage would make no sense and the problem is,
that the user don't get any hint, that this plugin is doing nothing.
Do you agree and should i open an issue on GitHub?
Strictly speaking the option is not required. The plugin will not raise an exception if it is not supplied. The plugin is a no-op if it is not supplied and it might be helpful for the documentation to explicitly state that. You can try raising an issue. Sometimes I get a good result from that, sometimes not
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.