In many cases you can use ${varname} to reference environment variables but you can't get Logstash to run a command like in your example. Why do you need the current date? Maybe there's another way of accomplishing your end goal.
@magnusbaeck I thought of a case where I could need to get the output of a shell command.
I've been using logstash's docker image, and recente versions of Docker has a docker secrets option, so I can save passwords and other sensitive information.
Tha way docker makes it available to containers is via a tmpfs filesystem at /run/secrets directory, and won't use environment variables anymore.
So if I need a password created via docker secret create mypassword I need to get its content via cat /run/secrets/mypassword
This should be a nice example of the need to get the output of a shell command.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.