Delete docs by date

HI!

In the following index I have several days of data

image

I want to delete the data from the 29th and 30th of the 5th of 2021

But when I launch the following command I obtain this messages:

How cai I delete the data of this dates??

Thanks!!

Hey @Jose_Manuel_Tirado, the delete_by_query doesn't work for you? Something like:

POST discuss/_delete_by_query
{
"query": {
"range" : {
"timestamp" : {
"gte" : "18/01/2020",
"lte" : "20/02/2020",
"format": "dd/MM/yyyy"
}
}
}
}

Sorry I don´t show the command

I launch this

image
And I obtain the error

I see, this is an ES error so maybe it would be better to address it there but maybe it works if you also add ?conflicts=proceed&refresh=wait_for. Do you want to also try this?

The problem is that you have conflicted versions in your index.

Hi again!
When I launch this

image

I obtain this

image

Thanks!

I think this is normal if your index has a substantial size. Can you check if they are deleted, even though you get this error?

Hi!!

Now, I launch this

image
And obtain this:

image

And don´t delete nothing!

Why?

Thanks

The field that contains the timefield is @timestamp or nuanceTimestamp ?

Sorry!! Silly mistake on my part

When I launch

image

Delete what we wanted! And only we have data of the remaining days

image

Thanks very much!!

Best regards!!

1 Like

Nice, I am really happy that we solved it!

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