Parse Terraspace output

Hi, I am trying to parse the output for when i run terraspace output db-api for the password.

I’m unable to ‘grep’ for the password and pass as a variable. The output of the ‘grep password’ pulls the entire output.

The command ‘terraspace output --help’ doesn’t provide an option to output a single variable such as “password”.

Since the output is not in json i cannot utilize jq to parse. I was able to get a parse solution, but going forward will there be an option to retrieve output for a single variable such as “password” ?

RE: grep output

The output is being printed to stderr not stdout. To redirect stderr to stdout:

terraspace output db-api 2>&1 | grep …

RE: JSON

terraspace output calls terraform output, which I believe has the -output option.