insights-core
insights-core copied to clipboard
"filterable" specs in insights-archive are not filtered
❯ grep "add_filter" test_rule.py | grep Messages
add_filter(Messages, ['Successfully activated', 'Installed product 479 not present in response'])
❯ grep "(Messages)" test_rule.py -A 5
@incident(Messages)
def check_error_log(messages):
for line in messages.lines:
print(line)
return messages.cron_rhsmd_error_log.get('raw_message', '')
The filter works well when the archive is an sos-report archive:
❯ insights-run -p test_rule /tmp/insights/sosreport-rdd0061-03577646-2023-08-02-nozjraw
...
Jul 31 00:55:29 RDCAS0061 dbus-daemon[1081]: [system] Successfully activated service 'org.freedesktop.timedate1'
Aug 1 03:11:51 RDCAS0061 dbus-daemon[1081]: [system] Successfully activated service 'org.freedesktop.timedate1'
Aug 1 08:53:59 RDCAS0061 dbus-daemon[1081]: [system] Successfully activated service 'org.freedesktop.timedate1'
Aug 1 08:57:11 RDCAS0061 dbus-daemon[1055]: [system] Successfully activated service 'org.freedesktop.hostname1'
Aug 1 08:57:11 RDCAS0061 dbus-daemon[1055]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Aug 1 08:57:11 RDCAS0061 dbus-daemon[1055]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Aug 1 09:25:29 RDCAS0061 dbus-daemon[1091]: [system] Successfully activated service 'org.freedesktop.hostname1'
Aug 1 09:25:29 RDCAS0061 dbus-daemon[1091]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Aug 1 09:25:30 RDCAS0061 dbus-daemon[1091]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Aug 2 01:35:18 RDCAS0061 dbus-daemon[1091]: [system] Successfully activated service 'org.freedesktop.timedate1'
Aug 2 16:15:16 RDCAS0061 dbus-daemon[1091]: [system] Successfully activated service 'org.freedesktop.UDisks2'
Aug 2 16:15:17 RDCAS0061 dbus-daemon[1091]: [system] Successfully activated service 'org.freedesktop.fwupd'
Aug 2 16:15:18 RDCAS0061 dbus-daemon[1091]: [system] Successfully activated service 'org.freedesktop.hostname1'
But it does not when the archive is an insights-archive collected by core-collection:
❯ ll /tmp/insights/insights-central-1.compute.internal-20240229074820
total 48K
-rw-r--r--. 1 liuxc wheel 181 Feb 29 15:48 blacklist_report
-rw-r--r--. 1 liuxc wheel 40 Feb 29 15:48 branch_info
drwxr-x---. 10 liuxc wheel 168 Feb 29 15:48 data
-rw-r--r--. 1 liuxc wheel 8 Feb 29 15:48 egg_release
-rw-r--r--. 1 liuxc wheel 0 Feb 29 15:48 insights_archive.txt
drwxr-x---. 2 liuxc wheel 28K Feb 29 15:48 meta_data
-rw-r--r--. 1 liuxc wheel 55 Feb 29 15:48 version_info
❯ insights-run -p test_rule.py /tmp/insights/insights-central-1.compute.internal-20240229074820
---------
Progress:
---------
Feb 26 07:21:35 ip-172-31-28-57 kernel: Linux version 4.18.0-372.52.1.el8_6.x86_64 ([email protected]) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC)) #1 SMP Fri Mar 31 06:22:44 EDT 2023
Feb 26 07:21:35 ip-172-31-28-57 kernel: input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
Feb 26 07:21:35 ip-172-31-28-57 kernel: input: Sleep Button as /devices/LNXSYSTM:00/LNXSLPBN:00/input/input1
Feb 26 07:21:35 ip-172-31-28-57 kernel: input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
Feb 26 07:21:36 ip-172-31-28-57 kernel: input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input4
Feb 26 07:21:39 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:21:46 ip-172-31-28-57 systemd[1]: Started Security Auditing Service.
Feb 26 07:21:47 ip-172-31-28-57 kernel: input: PC Speaker as /devices/platform/pcspkr/input/input5
Feb 26 07:21:48 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:21:53 ip-172-31-28-57 NetworkManager[736]: <info> [1708932113.5623] manager: NetworkManager state is now CONNECTED_SITE
Feb 26 07:24:57 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:25:09 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:26:41 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:27:25 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:30:10 ip-172-31-28-57 dbus-daemon[620]: [system] Activating via systemd: service name='com.redhat.RHSM1' unit='rhsm.service' requested by ':1.74' (uid=0 pid=17064 comm="rhc connect " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023")
Feb 26 07:30:15 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:31:45 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:31:45 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:48:29 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 07:48:36 ip-172-31-28-57 systemd[1]: Starting firewalld - dynamic firewall daemon...
Feb 26 07:48:36 ip-172-31-28-57 systemd[1]: Started firewalld - dynamic firewall daemon.
Feb 26 08:09:45 ip-172-31-28-57 ansible-ansible.legacy.command[29691]: Invoked with _raw_params=/usr/bin/leapp preupgrade --report-schema=1.2.0 --no-rhsm || true _uses_shell=True stdin_add_newline=True strip_empty_ends=True argv=None chdir=None executable=None creates=None removes=None stdin=None
Feb 26 08:23:54 ip-172-31-28-57 rhsm-service[17068]: WARNING [subscription_manager.cert_sorter:199] Installed product 479 not present in response from server.
Feb 26 08:23:54 ip-172-31-28-57 rhsm-service[17068]: WARNING [subscription_manager.cert_sorter:199] Installed product 479 not present in response from server.
Feb 26 08:26:02 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 08:26:02 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 08:26:03 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 08:26:03 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 08:26:03 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 08:26:03 ip-172-31-28-57 systemd[1]: Reloading.
Feb 26 10:41:10 ip-172-31-28-57 rhsm-service[17068]: WARNING [subscription_manager.cert_sorter:199] Installed product 479 not present in response from server.
Feb 26 14:41:19 ip-172-31-28-57 rhsm-service[17068]: WARNING [subscription_manager.cert_sorter:199] Installed product 479 not present in response from server.
Feb 26 18:41:18 ip-172-31-28-57 rhsm-service[17068]: WARNING [subscription_manager.cert_sorter:199] Installed product 479 not present in response from server.
Feb 26 18:49:31 ip-172-31-28-57 rhsm-service[17068]: WARNING [subscription_manager.cert_sorter:199] Installed product 479 not present in response from server.
Feb 26 22:41:18 ip-172-31-28-57 rhsm-service[17068]: WARNING [subscription_manager.cert_sorter:199] Installed product 479 not present in response from server.
All lines are outputted here which is not expected