Below is the query which applies ILM policies to the existing inidices
where mylogs-* is the index pattern which matches the list of indices and mylogs-ilm-policy is new policy which I want to apply.
PUT /mylogs-*/_settings
{
"index.lifecycle.name": "mylogs-ilm-policy"
}