1

salt-call grains.get cluster local: up102 Is there a way for salt-call to display only the value (eg. up102) without the rest of the output, or must I resort to using awk or jq etc to extract it?

I don't see any command line options to do this, but maybe there's a built-in way that I'm not seeing.

Michael Martinez
  • 2,543
  • 3
  • 20
  • 31

2 Answers2

1

In the past I didn't find a native solution for that. I mostly pipe it with jq this way:

# salt-call --out=json grains.get saltversion|jq '.[]'
"2017.7.1"
ProT-0-TypE
  • 491
  • 4
  • 8
0

How about

salt-call --out=newline_values_only grains.get cluster
rapli
  • 1