Syntax error using curl using complex query

Hi All
I am trying to run below query from RHEL Command line and it gives me syntax error. There might be something to do with *,) or " . Can some one guide me through.

curl -u test:test123 http://localhost:8093/query/service -d 'statement=select * from system:completed_requests where (requestTime >= 2019-03-15 15:17:00.000000000 -0700 MST and requestTime <= 2019-03-15 15:27:00.000000000 -0700 MST) and users=test and statement != select count(*) cnt fromtestand userAgent not like%Mozilla%` order by requestTime asc’

where as below statement gives results
curl -u test:test123 http://localhost:8093/query/service -d 'statement=select * from system:completed’

Your statement has LIKE "%Mozilla%" . the ‘%’ symbol is the escape character in URI’s.  
So, when using % as wild card in N1QL query, we need to escape that by replacing it with
 corresponding ascii code %25. 

Option 1)  Change "%Mozilla%" to  "%25Mozilla%25"
Option2) Use -H "Content-Type: application/json"

curl -u test:test123 http://localhost:8093/query/service -H "Content-Type: application/json"  -d '{"statement":"SELECT * FROM system:completed_requests WHERE requestTime BETWEEN \"2019-03-15T15:17:00.000-0700\" AND \"2019-03-15T15:27:00.000-0700\" AND users=\"test\" AND statement != \"select count(*) cnt from test\" AND userAgent NOT LIKE \"%Mozilla%\" ORDER BY requestTime ASC"}'