You can try something like this config :
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "1d"
}
}
}
}
}
}
You can also inspire you from there :
https://www.elastic.co/guide/en/elasticsearch/reference/current/set-up-lifecycle-policy.html