Can I pass an array into a plugin through a field

I am currently writing a custom java plugin for Logstash.

One of the input settings is an array.

This array might be set in another field within the logstash event.

so basically I want to be able to do this:

#array_field=> ["aa","bb"]


roles=> {array_field}


On the back end in my java code I handle the input config using this

private static final PluginConfigSpec<List<Object>> ROLES_CONFIG = PluginConfigSpec.arraySetting(roles);

So I want array_field to be passed as an array (not a string) into the roles plugin setting parameter. But I don't now how.

It seems like "array_field" just gets passed in as a string literal when I try and my plugin throws error about how it's expecting an array not a string. Is there a way in Logstash to pass array_field's content as an array into my plugin?

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