Is it available logstash "environment" filter plugin in Windows?

I have this simple configuration:

input { stdin { } }
filter {
  environment {
    add_metadata_from_env => {"test" => "TEST_ENV"}
    add_field => ["my_test", "%{[@metadata][test]}"]
  }
}
output { stdout { codec => rubydebug { metadata => true } } }

When I run: bin\logstash.bat -f config\test-env.conf
logstash (version 7.7.1) cannot start and produces these messages:

'Sending Logstash logs to C:/data/sw/elk/logstash-7.7.1/logs which is now configured via log4j2.properties'
'[2020-06-12T14:42:24,077][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified'
'[2020-06-12T14:42:24,199][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.7.1"}'
'[2020-06-12T14:42:26,113][INFO ][org.reflections.Reflections] Reflections took 35 ms to scan 1 urls, producing 21 keys and 41 values'
'[2020-06-12T14:42:26,740][ERROR][logstash.plugins.registry] Tried to load a plugin's code, but failed. {:exception=>#<LoadError: no such file to load -- logstash/filters/environment>, :path=>"logstash/filters/environment", :type=>"filter", :name=>"environment"}'

Am I missing some configuration for my install?

Solved, in fact the environment plugin was not installed with the windows package.
After "bin\logstash-plugin.bat install logstash-filter-environment" it worked.

By the way, ¿does anybody know if is possible to use part of the message in the environment variable name?

Like this:

filter {
  environment {
    add_metadata_from_env => {"test" => "TEST_%{sufix}"}
    add_field => ["my_test", "%{[@metadata][test]}"]
  }
}

Is not working for me, the result is nil value in [@metadata][test]

I would expect a sprintf reference to work in the field name because it calls event.set, but not in the environment variable name, since it is a simple lookup.

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