Skip to content

Commit 43cef71

Browse files
committed
update timers artifact to use systemctl plugin
1 parent b6c85e9 commit 43cef71

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

artifacts/definitions/SUSE/Linux/Events/Timers.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ sources:
1919
precondition: SELECT OS From info() where OS = 'linux'
2020
description: Collect systemd timer executions from journal
2121
query: |
22-
LET timers = SELECT parse_json_array(data=Stdout) AS list
23-
FROM execve(argv=['systemctl', 'list-timers', '--all', '-o', 'json', '--no-pager'])
22+
LET timer_triggered(service) = SELECT *
23+
FROM systemctl(command="show", unit=service, properties=["TriggeredBy"])
24+
WHERE len(list=TriggeredBy) > 0
2425
25-
LET timer_execs = SELECT *, {SELECT activates from timers.list} AS activates
26+
LET timer_execs = SELECT *
2627
FROM Artifact.SUSE.Linux.Events.Services()
27-
WHERE format(format="%s%s" , args=[Service, ".service"]) in activates
28+
WHERE timer_triggered(service=Service)
2829
2930
SELECT Timestamp, PID, User, Process as Cmd, Description
3031
FROM timer_execs

0 commit comments

Comments
 (0)