Delete documents from ES index_5.4 based on timestamp

Hi,

I am working on script which includes "Delete the data from OLD ES Indices" by using "timestamp" query.

TIme stamp looks like: timestamp August 21st 2018, 10:10:25.765

i tried with inputs from couple of blocks but not working , please advice?

Tried Below:
POST healthevents-2018-08-21/_delete_by_query
{
"query": {
"range" : {
"_timestamp" : {
"lt" : "now-30d"
}
}
}
}
########################
POST healthevents-2018-08-21/_delete_by_query
{
"query": {
"range" : {
"@timestamp" : {
"lt" : "datetime.datetime.utcnow()"

}
}
}
}

OUT PUT:
{
"took": 0,
"timed_out": false,
"total": 0,
"deleted": 0,
"batches": 0,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 0,
"requests_per_second": -1,
"throttled_until_millis": 0,
"failures": []
}

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