SaltStack: Is there a way to only display failed and warnings in output?

Running state.apply or state.highstate on minions can result in hundreds of lines in output. Sometimes only one minion can be enough.

...
Summary for my_minion
--------------
Succeeded: 112 (changed=78)
Failed:      6
Warnings:    1
--------------
Total states run:     118
Total run time:     4.958 s

Is there a way to show only failed and warnings in the output?


Change the state_output in master's configuration file.

It is also possible to override the state output from the command line, like:

salt '*' state.apply --state-output=mixed

Take a look at the documentation for more information about the state-output.


I usually use:

salt '*' state.apply -l quiet --state-verbose=false

that shows only change/failed states


You can use JSON output, then filter out the successful entries with jq.

salt-run jobs.lookup_jid 20180318whatever --out=json | \
jq 'map_values(with_entries(select(.value.result|not)))'