How to send logs to AWS S3

I have setup ELK on AWS EC2. and started sending logs to it. But after 1 week logserver stopped working due to less space on device.

So I need to move the logs (archive) to S3 . But no idea of that.

Please help me to start with it.

Can anyone please suggest and your help is appreciated

Welcome!

How does it relate to elasticsearch?

I have done through aws s3 snapshot repository.

Thanks for prompt response