Here is some more bash foo in case you want to parse the schema names correctly and you know what the schema names are like:
/usr/bin/pt-query-digest --type tcpdump mysql.tcp --output slowlog | sed 's/\(^use schema_name\).*/\1 /g' | awk '{ if($0 ~ /use schema_name/) {print $1" "$2} else { print $0 } }'
Here is some more bash foo in case you want to parse the schema names correctly and you know what the schema names are like:
/usr/bin/ pt-query- digest --type tcpdump mysql.tcp --output slowlog | sed 's/\(^use schema_name\).*/\1 /g' | awk '{ if($0 ~ /use schema_name/) {print $1" "$2} else { print $0 } }'