Automatic cleanup of YARN logs

I need help to understand settings that need to be done to automatically cleanup YARN logs under /hadoop/yarn/log

To enable automatic log cleanup in YARN, you will need to modify the configuration properties in the yarn-site.xml file. One way can be:

  1. yarn.log-aggregation.retain-seconds: This property determines the number of seconds that YARN should retain application logs after the application has completed. By default, YARN retains application logs for 7 days (604800 seconds). You can set this property to a lower value to cause YARN to automatically delete older logs more frequently.