Currently is not possible to add additional ENV variables to be exported to ES.
Add custom fields to ES docs using the logstash plugin.
def myFields = [:] myFields['env_a'] = 1 myFields['env_b'] = 2 logstashSend failBuild: false, maxLines: 200,customData: myFields