Running a command similar to
drush pm:security --fields=name --format=json gives me what I am looking for.
Is there a way to remove warnings and notices from the output?
I can't see anything in the documentation. I have written a regular expression for the purpose, but it's not an ideal solution.