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?

11

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.

| improve this answer | |
  • Thanks for this - this is super helpful for when there's more than 10-20 states (I've got around ~1500) – Steven Jun 18 at 19:22
5

I usually use:

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

that shows only change/failed states

| improve this answer | |
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)))'
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.