Logstash clone filter use event field as clones parameter


I made some tests with the clone filter in logstash. In my opinion there is no way to make the "clones" parameter dynamic.
Does someone know how this can be done? Looking at the filter code I think it might be considered as an enhancement of this plugin.


input {
    id => "mystdin"
	ecs_compatibility => disabled
	add_field => {"clones_array" => ["clone1","clone2"]}
filter {
	clone {
	  clones => "%{[clones_array]}"
	  #clones => clones_array
	  #clones => [clones_array]
	  ecs_compatibility => disabled
output {
  stdout {
    codec => json

The clones parameter is taken as-is, giving as result:


Correct, the value of the clones option is a literal, the clone filter does not sprintf it.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.