Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables in jvm.options are not replaced by the JvmOptionsParser #16444

Open
andsel opened this issue Sep 12, 2024 · 0 comments
Open
Labels

Comments

@andsel
Copy link
Contributor

andsel commented Sep 12, 2024

Logstash information:

Please include the following information:

  1. Logstash version (e.g. bin/logstash --version)
  2. Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker)
  3. How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes)

Plugins installed: (bin/logstash-plugin list --verbose)

JVM (e.g. java -version):

If the affected version of Logstash is 7.9 (or earlier), or if it is NOT using the bundled JDK or using the 'no-jdk' version in 7.10 (or higher), please provide the following information:

  1. JVM version (java -version)
  2. JVM installation source (e.g. from the Operating System's package manager, from source, etc).
  3. Value of the LS_JAVA_HOME environment variable if set.

OS version (uname -a if on a Unix-like system):

Description of the problem including expected versus actual behavior:

In jvm.options

#-XX:HeapDumpPath=${LOGSTASH_HOME}/heapdump.hprof
a couple of environment variables are used : LOGSTASH_HOME and LS_GC_LOG_FILE but the JvmOptionsParser don't apply any substitution of those. I think Logstash lost that function with PR #12530 , when switched the parsing of such file from bash to the Java CLI options composer. Before that, the resolution of environment variables was done by bash.

There could be a couple of solutions:

  • document that the user has manually update to a real path in the places where environment variables are used in the jvm.options file.
  • update JvmOptionsParser to replace with environment variables, if defined.

Steps to reproduce:

Please include a minimal but complete recreation of the problem,
including (e.g.) pipeline definition(s), settings, locale, etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.

  1. set LS_GC_LOG_FILE on shell
  2. decomment the line that uses the LS_GC_LOG_FILE in jvm.options
  3. run logstash and check the gc log is not produced in the configured path

Provide logs (if relevant):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants