Assuming that each log entry is exactly one line, you can use the -R
or --raw-input
option to tell jq to leave the lines unparsed, after which you can prepend fromjson? |
to your filter to make jq try to parse each line as JSON and throw away the ones that error.