Packer installations with versions to json

I have a compliance requirement that we need to capture all the software’s version details (http server,splunk etc) installed using packer in to json and store it in to s3 bucket.
When i run the packer i do see that there is a installed: and dependency Installed: in the log output of packer. Can i be able to capture it to file or json…?