0

No matter what terragrunt command I execute, it always starts with the following lines:

$ terragrunt show --json outfile 2>/dev/null
[INFO] Getting version from tgenv-version-name
[INFO] TGENV_VERSION is 0.31.10
$ terragrunt terragrunt-log-level=error plan
[INFO] Getting version from tgenv-version-name
[INFO] TGENV_VERSION is 0.31.10

I assumed that setting log level to error would perhaps help skipping those 2 lines.

Any ideas?

pkaramol
  • 16,451
  • 43
  • 149
  • 324
  • Why would you need to remove these lines? – Marcin Oct 21 '21 at 07:08
  • for several reasons; it makes my `json` parsing harder in the first example to begin with; the question is why are (should) they be so indispensable / mandatory? why not making it easy to skip them? (perhaps it is and I am missing the option) – pkaramol Oct 21 '21 at 07:10
  • Could you explain what kind of json? Are these `outputs` in json? – Marcin Oct 21 '21 at 07:13
  • For example when running `tg state pull > mystate.json`, I want a pure json output to parse. These lines seem to break the `json` formatting – pkaramol Oct 21 '21 at 07:14
  • All the log is stderr, so `2>/dev/null` should work. Since logs are in stderr, `tg state pull > mystate.json` shoudl work as expected and you should get pure json in the file. – Marcin Oct 21 '21 at 07:42
  • How did it go? Did you double check `2>/dev/null`? – Marcin Oct 22 '21 at 00:25
  • yes that didn't work either; turns out it is an [issue](https://github.com/gruntwork-io/terragrunt/issues/1883) of `tgenv` I used to install `terragrunt` – pkaramol Oct 22 '21 at 07:06
  • FWIW you can try [`tgswitch`](https://warrensbox.github.io/tgswitch/) or [`asdf`](https://asdf-vm.com/) in place of `tgenv` which seems to be abandonware. – Ben Whaley Nov 05 '21 at 22:35

0 Answers0