Ask Your Question

How to access system's environment variables in Query consumer.

asked 2020-01-29 23:38:54 -0600

Shashank Shukla gravatar image

How can I access system's environment variables in Streamsets pipeline. I want to read database connection URL which is in a system variable in a JDBC executor.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-02-03 12:48:34 -0600

metadaddy gravatar image

You cannot access an environment variable directly from Expression Language, but you can do it indirectly via a Runtime Property. Use ${env("ENV_VAR_NAME")} in the Runtime Property, then you can reference that property in configuration with ${runtime:conf(<property name>)}.

For example, I set an environment variable:

export PG_URL=jdbc:postgresql://

I then added this setting to my runtime properties file (I'm using a separate runtime properties file as outlined in the docs):


Finally, I was able to reference the property in my JDBC Query Consumer:

image description

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-01-29 23:38:54 -0600

Seen: 23 times

Last updated: Feb 03