Variable Logfile Names

[posted 2007/04/17]

[Notes (edited slightly) issued with the release of PIKT 1.19.0pre4, which:  implemented variable logfile names.]

For 'output log' statements, we have implemented computable logfile names.  You are no longer forced to use a fixed logfile name string, for example,

                output log "=logdir/SyslogKernelScan.log" $inlin

Instead, you could generalize this to, say,

                output log "=logdir/" . $alarm() . ".log" $inlin

So if you used this macro

output_alarm_log(M)     output log "=logdir/" . $alarm() . ".log" (M)

in the SyslogKernelScan alarm script, the logfile name would resolve to

                output log "=logdir/SyslogKernelScan.log" $inlin

as above, but in the SyslogCriticalScan script, it would resolve to

                output log "=logdir/SyslogCriticalScan.log" $inlin

and similarly for other Syslog*Scan scripts.

Computable logfile names open up all sorts of possibilities, for example,

                output log "=logdir/" . $proc . $alarm() . "=piktalert=_.log"
                           $inlin

which might result in a logfile named

                /pikt/var/log/firefox-binRunawayCPUProcsStatsUrgent.log

or, instead of 'firefox-bin', some other arbitrary process name.

For more examples, see Developer's Notes.

 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
google_ad_client
error
Pikt script