mongodump failing with invalid json input
Try adjusting the input:
/usr/bin/mongodump -u backup -p backup12345  --host=XX.XX.XX.XX --port XXXX --out=/tmp -d local -c oplog.rs --gzip --authenticationDatabase admin \
--query '{&quot;ts&quot;: { &quot;$gt&quot;: Timestamp(1619548593, 1) } }'
--ssl --sslAllowInvalidCertificates

I tried multiple versions and they worked fine with me:

--query '{ &quot;ts&quot;: { &quot;$gt&quot;: Timestamp(1111111, 1) }}'
--query '{ &quot;ts&quot;: { &quot;$gt&quot;: ISODate(&quot;2021-04-05T08:00:00.000Z&quot;) }}'
--query &quot;{ 'ts': { \$gt:  ISODate(\&quot;2021-04-05T08:00:00.000Z\&quot;) }}&quot;

In older mongo versions you need to use the &quot;extended json&quot;:

--query '{ &quot;ts&quot;: { &quot;$gt&quot;: {&quot;$timestamp&quot;:{&quot;t&quot;:1565545664,&quot;i&quot;:1}} }}'

this is completetly valid json and should work with the old client as well.
also see mongodump command with timestamp query