Skip to content

Commit

Permalink
Added yum query to Packages.yaml
Browse files Browse the repository at this point in the history
Currently "old" versions of RHEL are not supported as they do not have dnf. I added yum support to resolve this issue
  • Loading branch information
hendrkss authored Nov 13, 2023
1 parent 169ac54 commit dde1509
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions artifacts/definitions/Linux/RHEL/Packages.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Linux.RHEL.Packages
description: |
Parse packages installed from dnf
Parse packages installed from dnf or yum
parameters:
- name: DNFGrokExpression
Expand All @@ -12,8 +12,14 @@ sources:
SELECT OS From info() where OS = 'linux'
query: |
SELECT * FROM foreach(row={
LET exec = SELECT * FROM foreach(row={
SELECT grok(grok=DNFGrokExpression, data=Stdout) AS Parsed
FROM execve(argv=["dnf", "--quiet", "list", "installed"], sep="\n")
FROM execve(argv=cmd, sep="\n")
WHERE count() > 2
}, column="Parsed")
SELECT * FROM switch(
a=exec(cmd=["dnf", "--quiet", "list", "installed"]),
b=exec(cmd=["yum", "--quiet", "list", "installed"]),
c={SELECT log(level="ERROR",message="Could not retrieve Package Information") FROM scope()}
)

0 comments on commit dde1509

Please sign in to comment.