Created
January 7, 2021 16:56
-
-
Save sortega/bc02b95806d90bc030ba05d4f8c2edbb to your computer and use it in GitHub Desktop.
Export connect status to CSV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONNECT_URL=${1:-${CONNECT_URL:-http://localhost:8083}} | |
CONNECTOR_LIST=$(curl -s -L -X GET $CONNECT_URL/connectors | jq -r '.[]') | |
for CONNECTOR in $CONNECTOR_LIST; do | |
curl -s -L -X GET $CONNECT_URL/connectors/$CONNECTOR/status \ | |
| jq -r "(.tasks[] | [\"task\", \"$CONNECTOR\", .id, .state, .worker_id]), [\"connector\", \"$CONNECTOR\", .type, .connector.state, .connector.worker_id] | @csv" & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment