Does elastic search store the data and logs permanently?

I'm very curious to know whether elastic search stores the data and logs permannetly or deletes the old filess.

I'm trying to store the logs and data of few machines permanently, for other servers say for 30 days or upto 20 files.

Is there anyway we can make changes in the config? Can anyone guide me?

Elasticsearch does not delete anything by itself. To have different retention policies for different kind of logs, use multiple index series (e.g. logstash-shortterm-YYYY.MM.DD and logstash-longterm-YYYY.MM.DD) and use Curator to cull one of the series after e.g. 30 days.