insights-core icon indicating copy to clipboard operation
insights-core copied to clipboard

LogRotateConfPEG cannot handle setting with '='

Open TZ3070 opened this issue 1 year ago • 0 comments

LogRotateConfPEG cannot handle setting with '=', and cannot identify the target files set vertically.

Example setting::

"/var/log/httpd/access.log" /var/log/httpd/error.log {
    rotate 5
    mail [email protected]
    size=100k
    sharedscripts
    postrotate
                /sbin/killall -HUP httpd
    endscript
}

/var/log/news/news.crit
/var/log/news/olds.crit  {
    monthly
    rotate 2
    olddir /var/log/news/old
    missingok
    postrotate
                kill -HUP `cat /var/run/inn.pid`
    endscript
    nocompress
}

Parse result:

'size=100k' in log_rt['/var/log/httpd/access.log']
'missingok' not in log_rt['/var/log/news/news.crit']
'missingok' in log_rt['/var/log/news/olds.crit']

Correct result:

'100k' in log_rt['/var/log/httpd/access.log']['size']
'missingok' in log_rt['/var/log/news/news.crit']
'missingok' in log_rt['/var/log/news/olds.crit']

TZ3070 avatar Aug 17 '23 01:08 TZ3070