Is there a parser already written to output zypper.log entries in a nice format?
All, I'm chasing problems in Thunderbird and wanted to parse zypper.log (yes I could use the rpmdb), and wanted to know if there was a parse already written or whether is just one for awk (and xzcat for the compressed files)? awk and xzcat work fine, but if there is already a tool, I'd rather not reinvent another wheel. For when installed, e.g., something ike: 2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 START 2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 END 2024-09-13 22:57:21 MozillaThunderbird-115.15.0-1.1.x86_64 START 2024-09-13 22:57:24 MozillaThunderbird-115.15.0-1.1.x86_64 END 2024-10-12 16:18:49 MozillaThunderbird-openpgp-librnp-128.3.1-1.1.x86_64 START 2024-10-12 16:18:49 MozillaThunderbird-openpgp-librnp-128.3.1-1.1.x86_64 END 2024-10-12 16:18:50 MozillaThunderbird-128.3.1-1.1.x86_64 START 2024-10-12 16:18:54 MozillaThunderbird-128.3.1-1.1.x86_64 END 2024-10-22 05:51:34 MozillaThunderbird-openpgp-librnp-128.3.2-1.1.x86_64 START 2024-10-22 05:51:34 MozillaThunderbird-openpgp-librnp-128.3.2-1.1.x86_64 END 2024-10-22 05:51:34 MozillaThunderbird-128.3.2-1.1.x86_64 START 2024-10-22 05:51:38 MozillaThunderbird-128.3.2-1.1.x86_64 END 2024-10-26 02:03:09 MozillaThunderbird-openpgp-librnp-128.3.3-1.1.x86_64 START 2024-10-26 02:03:09 MozillaThunderbird-openpgp-librnp-128.3.3-1.1.x86_64 END 2024-10-26 02:03:09 MozillaThunderbird-128.3.3-1.1.x86_64 START 2024-10-26 02:03:13 MozillaThunderbird-128.3.3-1.1.x86_64 END Which you can produce with, e.g. # xzcat /var/log/zypper.log-20240918.xz | awk '/[Tt]hunderbird/ && $5 == "[Progress++]" { p=sub(/}/,"",$(NF-1)); print $1, $2, $(NF-1), $NF }' -- David C. Rankin, J.D.,P.E.
On 10/29/24 7:06 PM, David C. Rankin wrote:
All,
I'm chasing problems in Thunderbird and wanted to parse zypper.log (yes I could use the rpmdb), and wanted to know if there was a parse already written or whether is just one for awk (and xzcat for the compressed files)?
awk and xzcat work fine, but if there is already a tool, I'd rather not reinvent another wheel.
For when installed, e.g., something ike:
2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 START 2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 END 2024-09-13 22:57:21 MozillaThunderbird-115.15.0-1.1.x86_64 START 2024-09-13 22:57:24 MozillaThunderbird-115.15.0-1.1.x86_64 END 2024-10-12 16:18:49 MozillaThunderbird-openpgp-librnp-128.3.1-1.1.x86_64 START 2024-10-12 16:18:49 MozillaThunderbird-openpgp-librnp-128.3.1-1.1.x86_64 END 2024-10-12 16:18:50 MozillaThunderbird-128.3.1-1.1.x86_64 START 2024-10-12 16:18:54 MozillaThunderbird-128.3.1-1.1.x86_64 END 2024-10-22 05:51:34 MozillaThunderbird-openpgp-librnp-128.3.2-1.1.x86_64 START 2024-10-22 05:51:34 MozillaThunderbird-openpgp-librnp-128.3.2-1.1.x86_64 END 2024-10-22 05:51:34 MozillaThunderbird-128.3.2-1.1.x86_64 START 2024-10-22 05:51:38 MozillaThunderbird-128.3.2-1.1.x86_64 END 2024-10-26 02:03:09 MozillaThunderbird-openpgp-librnp-128.3.3-1.1.x86_64 START 2024-10-26 02:03:09 MozillaThunderbird-openpgp-librnp-128.3.3-1.1.x86_64 END 2024-10-26 02:03:09 MozillaThunderbird-128.3.3-1.1.x86_64 START 2024-10-26 02:03:13 MozillaThunderbird-128.3.3-1.1.x86_64 END
Which you can produce with, e.g.
# xzcat /var/log/zypper.log-20240918.xz | awk '/[Tt]hunderbird/ && $5 == "[Progress++]" { p=sub(/}/,"",$(NF-1)); print $1, $2, $(NF-1), $NF }'
I might be missing something, but the desired results seems easier to achieve by reading /var/log/zypp/history.
29.10.2024 21:06, David C. Rankin wrote:
All,
I'm chasing problems in Thunderbird and wanted to parse zypper.log (yes I could use the rpmdb), and wanted to know if there was a parse already written or whether is just one for awk (and xzcat for the compressed files)?
zypper-log
awk and xzcat work fine, but if there is already a tool, I'd rather not reinvent another wheel.
For when installed, e.g., something ike:
2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 START 2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 END
No, zypper-log will not do it.
Hi For a visual log analysis tool try chipmunk: https://github.com/esrlabs/chipmunk regards, Bogdan
On 29 Oct 2024, at 20:06, David C. Rankin <drankinatty@gmail.com> wrote:
All,
I'm chasing problems in Thunderbird and wanted to parse zypper.log (yes I could use the rpmdb), and wanted to know if there was a parse already written or whether is just one for awk (and xzcat for the compressed files)?
awk and xzcat work fine, but if there is already a tool, I'd rather not reinvent another wheel.
For when installed, e.g., something ike:
2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 START 2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 END 2024-09-13 22:57:21 MozillaThunderbird-115.15.0-1.1.x86_64 START 2024-09-13 22:57:24 MozillaThunderbird-115.15.0-1.1.x86_64 END 2024-10-12 16:18:49 MozillaThunderbird-openpgp-librnp-128.3.1-1.1.x86_64 START 2024-10-12 16:18:49 MozillaThunderbird-openpgp-librnp-128.3.1-1.1.x86_64 END 2024-10-12 16:18:50 MozillaThunderbird-128.3.1-1.1.x86_64 START 2024-10-12 16:18:54 MozillaThunderbird-128.3.1-1.1.x86_64 END 2024-10-22 05:51:34 MozillaThunderbird-openpgp-librnp-128.3.2-1.1.x86_64 START 2024-10-22 05:51:34 MozillaThunderbird-openpgp-librnp-128.3.2-1.1.x86_64 END 2024-10-22 05:51:34 MozillaThunderbird-128.3.2-1.1.x86_64 START 2024-10-22 05:51:38 MozillaThunderbird-128.3.2-1.1.x86_64 END 2024-10-26 02:03:09 MozillaThunderbird-openpgp-librnp-128.3.3-1.1.x86_64 START 2024-10-26 02:03:09 MozillaThunderbird-openpgp-librnp-128.3.3-1.1.x86_64 END 2024-10-26 02:03:09 MozillaThunderbird-128.3.3-1.1.x86_64 START 2024-10-26 02:03:13 MozillaThunderbird-128.3.3-1.1.x86_64 END
Which you can produce with, e.g.
# xzcat /var/log/zypper.log-20240918.xz | awk '/[Tt]hunderbird/ && $5 == "[Progress++]" { p=sub(/}/,"",$(NF-1)); print $1, $2, $(NF-1), $NF }'
-- David C. Rankin, J.D.,P.E.
On 10/29/24 1:19 PM, Bogdan Cristea wrote:
Hi
For a visual log analysis tool try chipmunk: https://github.com/esrlabs/ chipmunk <https://github.com/esrlabs/chipmunk>
regards, Bogdan
Thanks Bogdan, Georg and Andrei, I'll check out chipmunk. Until then, I just cobbled together the following one-liner. If needed, I'll throw it in a script: for f in /var/log/zypper.log*; do if [ "${f##*.}" = xz ]; then xzcat "$f" | awk '/[Tt]hunderbird/ && $5 == "[Progress++]" && $NF == "END" { sub(/}/,"",$(NF-1)); print $1, $2, $(NF-1) }'; else awk '/[Tt]hunderbird/ && $5 == "[Progress++]" && $NF == "END" { sub(/}/,"",$(NF-1)); print $1, $2, $(NF-1) }' "$f"; fi; done Just a loop over the zypper log files and an if on whether xzcat is needed or not. Better output: 2024-09-08 23:08:32 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 2024-09-08 23:08:37 MozillaThunderbird-115.15.0-1.1.x86_64 2024-09-13 22:57:21 MozillaThunderbird-openpgp-librnp-115.15.0-1.1.x86_64 2024-09-13 22:57:24 MozillaThunderbird-115.15.0-1.1.x86_64 2024-10-12 16:18:49 MozillaThunderbird-openpgp-librnp-128.3.1-1.1.x86_64 2024-10-12 16:18:54 MozillaThunderbird-128.3.1-1.1.x86_64 2024-10-22 05:51:34 MozillaThunderbird-openpgp-librnp-128.3.2-1.1.x86_64 2024-10-22 05:51:38 MozillaThunderbird-128.3.2-1.1.x86_64 2024-10-26 02:03:09 MozillaThunderbird-openpgp-librnp-128.3.3-1.1.x86_64 2024-10-26 02:03:13 MozillaThunderbird-128.3.3-1.1.x86_64 And with awk -- it's always reasonably fast... -- David C. Rankin, J.D.,P.E.
participants (4)
-
Andrei Borzenkov
-
Bogdan Cristea
-
David C. Rankin
-
Georg Pfuetzenreuter