distributed-system-analysis / pbench

A benchmarking and performance analysis framework
http://distributed-system-analysis.github.io/pbench/
GNU General Public License v3.0
188 stars 108 forks source link

Audit log formatter #3611

Closed dbutenhof closed 8 months ago

dbutenhof commented 8 months ago

Another late night ops side project: this queries the Audit log with filters and displays the results either in detail or summary, optionally with pagination.

/opt/pbench-server/bin/pbench-audit --since 2024-02-29 --until 2024-03-01 --name upload --summary
[...]
[2024-02-29 19:35:07] upload uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31 FAILURE (legacy) [2.584 seconds]
[2024-02-29 19:36:09] upload uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31 SUCCESS (legacy) [4.093 seconds]
Reported 428 audit events:
         BEGIN        214
       SUCCESS         24
       FAILURE        190

Or (full form):

/opt/pbench-server/bin/pbench-audit -C /opt/pbench-server/lib/config/pbench-server.cfg --since 2024-02-29T12:00:00 --until '2024-02-29 19:00:00' --name upload
[...]
  [2024-02-29 18:58:09.608043+00:00] : upload BEGIN
    DATASET uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31 by user legacy
      {'access': 'public', 'metadata': {'global.server.legacy.version': '0.69.11', 'global.server.legacy.sha1': '29bf18093', 'global.server.legacy.hostname': 'n010.intlab.redhat.com'}}
  [2024-02-29 18:58:12.279230+00:00] : upload FAILURE [2.671 seconds]
    DATASET uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31 by user legacy
      {'message': "A tarball with the name 'uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31' already exists"}
  [2024-02-29 18:59:05.843728+00:00] : upload BEGIN
    DATASET uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31 by user legacy
      {'access': 'public', 'metadata': {'global.server.legacy.version': '0.69.11', 'global.server.legacy.sha1': '29bf18093', 'global.server.legacy.hostname': 'n010.intlab.redhat.com'}}
  [2024-02-29 18:59:08.592574+00:00] : upload FAILURE [2.749 seconds]
    DATASET uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31 by user legacy
      {'message': "A tarball with the name 'uperf_HyperV_RHEL-9.4.0-20240225.8_x86_64_gen2_hv_netvsc_quick_D240227T172431_2024.02.27T09.24.31' already exists"}
Reported 354 audit events:
         BEGIN        177
       SUCCESS         23
       FAILURE        154