NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Parsing pkg_admin audit



Aaron,
You can use a little python script I wrote. It is nothing fancy. Feel free to download it from github. It takes the output of pkg_admin audit and outputs either csv or JSON, depending on what you want.

https://github.com/rgeorgia/nbaudit_fmt


On 5/30/19, 5:59 AM, "Leonardo Taccari" <netbsd-users-owner%NetBSD.org@localhost on behalf of leot%NetBSD.org@localhost> wrote:

    Hello Aaron,
    
    Aaron B. writes:
    > [...]
    > Is there a mode, or some other utility/combination of commands, to get
    > the output of 'pkg_admin audit' in a machine-readable way - something
    > like CSV/JSON/etc?
    >
    > A regular expression should be able to do it, but I'm hoping there's
    > some format intended to be scripted.
    > [...]
    
    I would just pipe it to AWK (without any regular expression), e.g.
    to have a corresponding TSV of them:
    
     | % pkg_admin audit |
     |   awk '{ pkg = $2; vuln_type = $5; url = $NF; print pkg "\t" vuln_type "\t" url }'
    




Home | Main Index | Thread Index | Old Index