How to capture JSON stdout and re-use it