Skip to content

Instantly share code, notes, and snippets.

@alces
Created June 30, 2023 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alces/c536c0d052b8ae29ca37adeee0d6f2e3 to your computer and use it in GitHub Desktop.
Save alces/c536c0d052b8ae29ca37adeee0d6f2e3 to your computer and use it in GitHub Desktop.
Looking for a pattern inside NiFi flowfiles on multiple clusters deployed atop of k8s
#!/bin/bash
PATTERN='for-example-a-kafka-topic-name-to-look-for'
for ns in $(kubectl get ns | awk '{if ($1 !~ /^NAME|kube-/) {print $1}}')
do
echo "Looking into $ns"
kubectl exec -n "$ns" -c nifi nifi-0 -- zgrep "$PATTERN" permanent_configs/flow.xml.gz 2>/dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment