How to remove unwanted records

Hi,

I want to delete all records containing Project:cfa_uk and env:tst from my ElasticSearch indexes.

I created this son data file:

{
    "query": {
        "query_string" : {
            "fields" : ["project", "env"],
            "query" : "cfa_uk AND tst"
        }
    }
}

`
And executed

curl -d "@data.txt" --user 'ukadmin:XXXXXXX' -H "Content-Type: application/json" -X GET https://kibana.maxown.com/logstream-2020-06-14/_delete_by_query

But I get a 400:

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"No endpoint or operation is available at [_delete_by_query]"}],"type":"illegal_argument_exception","reason":"No endpoint or operation is available at [_delete_by_query]"},"status":400}

I think this is because I am using the wrong URL.

Please could someone explain where I have made a mistake?

TIA

S

I think you should use POST instead of GET

Thanks so much, works fine now!

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