How to specify date of yesterday in Log Import section?

Joost van Baal joostvb at logreport.org
Thu Mar 8 09:19:45 CET 2007


Hi,

Op vr  2 mrt 2007 om 06:23:11 +0300 schreef Alexei Korobkin:
> 
> Sorry for easy question, I can't find an answer in Archives or in man 
> strftime.
> My firewall logs are gzipped daily and path to them looks like
> /var/log/fw/2007/03/02/firewall.log.gz
> 
> I want Lire to run in the morning, parse yesterday log and send me the 
> report.
> But I can't think of how I could specify this path in lire interface, in 
> strftime format.
> 
> Could someone provide me with an example, or it is simply impossible within 
> config.xml
> and I have to use my own cron jobs like
> lr_log2report firewall /var/log/`date -d '-1 day' 
> +%Y/%m/%d/`/firewall.log.gz
> ?

Using such a cronjob would surely work.

For config.xml, can't you convert current time to number  of  seconds
since the Epoch using %s, subtract 24 \* 60 \* 60 seconds and convert
that to %Y/%m/%d?

Bye,

Joost

-- 
.    .                                        http://logreport.com/
| '.|                        /^LogReport$/
| Lire                                        http://logreport.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://lists.logreport.org/pipermail/questions/attachments/20070308/74879919/attachment.bin 


More information about the Questions mailing list