Logrotate command returns the following error:
# logrotate -vf /etc/logrotate.d/mylog
reading config file mylog
reading config info for /var/log/mylog.log
error: iptables:1 lines must begin with a keyword or a filename (possibly in double quotes)
Solution
This error appear because you the logrotate configuration file is not a valid Unix file. Execute the following command to convert the logrotate file to unix format.
# dos2unix -b /etc/logrotate.d/mylog
where -b stands for backup.
Alternative command is:
# tr -d '\r' < /etc/logrotate.d/mylog > /etc/logrotate.d/mylog