Skip to content

Instantly share code, notes, and snippets.

@clux
Last active April 1, 2020 07:34
Show Gist options
  • Save clux/5b0fe2c7de2c19907e34f1ff30391812 to your computer and use it in GitHub Desktop.
Save clux/5b0fe2c7de2c19907e34f1ff30391812 to your computer and use it in GitHub Desktop.
k-update-cm-filebeat
cat <<EOF | yq . -y | kubectl apply -n kube-system -f -
apiVersion: v1
kind: ConfigMap
metadata: { name: filebeat-config }
data:
filebeat.yml: |-
$(kubectl get cm -n kube-system filebeat-config -oyaml \
| yq '.data["filebeat.yml"]' -r \
| sed -n "/output/q;p" \
| sed -e "\$aoutput.console:\n pretty: false"
| sed 's/^/ /')
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment