while IFS= read -r line1 do rabbitmqctl close_connection "$line1" "connection closed" & done < <(rabbitmqctl list_connections user peer_host state pid | grep -F 127.0.0.1 | awk ' {print $4}')
The script above gets the connections with the columns user, peer_host, state, and pid. Then filters by peer_host "127.0.0.1" with grep and gets the 4th column with awk, which is the connection pid. Then it uses "rabbitmqctl close_connection" with the pid and adds the "explanation" argument with value "connection closed".
Note: Use the command at your own risk and test the "rabbitmqctl list_connections ..." part thoroughly to be sure you are listing the connections you intend to close.