Get ssh thumbprint or ssh fingerprint of every entry in known_hosts as json:
ssh-keygen -l -f known_hosts | awk '{ print "{" "\042host\042:\042" $3 "\042" ",\042thumbprint\042:\042" $2 "\042" ",\042alg\042:\042" $4 "\042" ",\042size\042:\042" $1 "\042" "}"}' | sort | jtbl
formatted:
ssh-keygen -l -f known_hosts \
| awk '{ print "{" "\042host\042:\042" $3 "\042" ",\042thumbprint\042:\042" $2 "\042" ",\042alg\042:\042" $4 "\042" ",\042size\042:\042" $1 "\042" "}"}' \
| sort \
| jtbl
Awk needs octal escapes (hex is not portable) for quotes to avoid clashing with the shell. I chose double quotes 042 instead of single quotes 047
The host is first so the sort groups entries by host. The default order of known_hosts is newest entry at bottom.
jtbl
is a nifty util to pretty-print the json as a table. Remove it to process the json lines with jq or any other json processor.