Public bug reported: When running `cloud-init analyze show` against a log file from an Amazon Linux 2 instance (e.g. https://pastebin.com/uhJNysgm), no useful output is produced:
$ cloud-init analyze show -i ~/Downloads/uhJNysgm.txt -- Boot Record 01 -- The total time elapsed since completing an event is printed after the "@" character. The time the event takes is printed after the "+" character. Total Time: 0.00000 seconds 1 boot records analyzed This is because the log configuration on Amazon Linux 2 (https://pastebin.com/x6NZ4NFJ) configures this for arg0Formatter: format=%(asctime)s cloud-init[%(process)d]: %(filename)s[%(levelname)s]: %(message)s which differs from the upstream definition: format=%(asctime)s - %(filename)s[%(levelname)s]: %(message)s This is a problem, because the `cloud-init analyze` commands depend on the " - " part of the line's presence as a separator (see https://github.com/canonical/cloud- init/blob/master/cloudinit/analyze/dump.py#L78), so when we run analyze against an Amazon Linux 2 log file, we incorrectly fail to identify any of the lines in it as being cloud-init log lines. (As an aside, this is the only non-whitespace difference between the two configuration files.) ** Affects: cloud-init Importance: Undecided Status: New -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to cloud-init. https://bugs.launchpad.net/bugs/1876323 Title: `cloud-init analyze` fails to produce useful output on Amazon Linux 2 due to log format configuration Status in cloud-init: New Bug description: When running `cloud-init analyze show` against a log file from an Amazon Linux 2 instance (e.g. https://pastebin.com/uhJNysgm), no useful output is produced: $ cloud-init analyze show -i ~/Downloads/uhJNysgm.txt -- Boot Record 01 -- The total time elapsed since completing an event is printed after the "@" character. The time the event takes is printed after the "+" character. Total Time: 0.00000 seconds 1 boot records analyzed This is because the log configuration on Amazon Linux 2 (https://pastebin.com/x6NZ4NFJ) configures this for arg0Formatter: format=%(asctime)s cloud-init[%(process)d]: %(filename)s[%(levelname)s]: %(message)s which differs from the upstream definition: format=%(asctime)s - %(filename)s[%(levelname)s]: %(message)s This is a problem, because the `cloud-init analyze` commands depend on the " - " part of the line's presence as a separator (see https://github.com/canonical/cloud- init/blob/master/cloudinit/analyze/dump.py#L78), so when we run analyze against an Amazon Linux 2 log file, we incorrectly fail to identify any of the lines in it as being cloud-init log lines. (As an aside, this is the only non-whitespace difference between the two configuration files.) To manage notifications about this bug go to: https://bugs.launchpad.net/cloud-init/+bug/1876323/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp