This is what worked for me:
1. Created a python script to generate the log:
1.1 open notepad++ and paste the following:
#!/usr/bin/env python3
import cli
cli.cli('syslog priority notifications msg Keepalive: Device is alive')
1.2 Save the file as keepalive.py and copy it to switch bootflash:
2. Create a scheduler job
3. Schedule to run the script every 5 min (you can adjust the time according to your needs)
Complete configuration :
scheduler job name python-keepalive
python3 bootflash:/keepalive.py
end-job
scheduler schedule name keepalive
job name python-keepalive
time start now repeat 0:0:5