Can I use environment variables with field values?

When using environment variables in logstash, set them as follows:
${environment_variable_name}

example)
export ENV_TAG="tag2"

filter {
  mutate {
    add_tag => [ "tag1", "${ENV_TAG}" ]
  }
}

question:
Can I make an environment variable a field value and load an environment variable with that field value?
is it possible?

example)
export A001="etc"

filter {
json {
source => "message"
}
# message => {"name":"A001"]

  mutate {
    add_field => [ 
	   "pattern" => "${%{name}}" 
	   ]
  }
}

result => pattern: etc

I'm getting an error with the method above, but please let me know if there is an available method.

or Is it possible to define content in an external text file and load it?

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