Delete by query api command line not working

curl -s -XPOST http://localhost:9200/xxxlog-*/delete_by_query?q=xxx:"xxxx"
throwing error -

{"error":{"root_cause":[{"type":"parse_exception","reason":"request body is required"}],"type":"parse_exception","reason":"request body is required"},"status":400}

In kibana -> Dev tools 'POST xxxlog-*/delete_by_query?q=xxx:"xxxx" ' worked although.

Please help

Works for me.

Request

curl -XPOST "http://es.xxx.com:9200/xxx/_delete_by_query?q=id:2"

Response

{"took":64,"timed_out":false,"total":1,"deleted":1,"batches":1,"version_conflicts":0,"noops":0,"retries":{"bulk":0,"search":0},"throttled_millis":0,"requests_per_second":-1.0,"throttled_until_millis":
0,"failures":}

1 Like

Thanks I missed "_"(underscore) before 'delete_by_query' api name. :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.