10

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?

gogan
  • 115
  • 1
  • 6

3 Answers3

13

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.

Roald Nefs
  • 426
  • 5
  • 13
  • 1
    Thanks for this - this is super helpful for when there's more than 10-20 states (I've got around ~1500) – Steven Jun 18 '20 at 19:22
6

I usually use:

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

that shows only change/failed states

ProT-0-TypE
  • 491
  • 4
  • 8
3

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)))'
Brad Ackerman
  • 2,141
  • 2
  • 17
  • 19