I bet I know why you need this. We're working on the same thing.
The best way to do this is to use an Event Script. You'll have to look that up in the documentation, but basically it's a way to write bash scripts and extract information from the environment table. From there you should be able to assemble a JSON data structure and write it to a TXT file. From there you can do whatever you need to with that file.