I have a few packer templates which have several builders - up to 5 per template. This makes it very easy to provision all the resources necessary in a pipeline -- however by default packer writes all the output in a single stream. Yes, it separates builders by colour which makes it a bit easier to see what's going on, but it is nevertheless very difficult to find where a particular build failed.

I would like to know what would be a good way to split the packer output per builder into a separate file.

Note :

  • I do not want to lose paralellism
  • I do accept that some post-processing of the log is necessary

Packer has a -machine-readable flag which writes things like :

1564995900,,ui,message,    admin-ami: Instance ID: i-04ef2474a070403ad
1564995900,,ui,say,==> admin-ami: Waiting for instance (i-04ef2474a070403ad) to become ready...

which one could parse.


Browse other questions tagged or ask your own question.