Help for this page

Select Code to Download


  1. or download this
    
    #Write a script which parses /var/log/messages and generates a CSV wit
    +h two columns: minute, number_of_messages in sorted time order.
    ...
    #Jan 20 05:20,1
    #Jan 20 05:22,6
    #---------- end sample output ------------"""
    
  2. or download this
    Jan 20 03:25:08 fakehost logrotate: ALERT exited abnormally with [1]
    Jan 20 03:25:09 fakehost run-parts(/etc/cron.daily)[20447]: finished l
    +ogrotate
    ...
    Jan 20 05:22:08 fakehost cs3[31163]:  I: Last 1 quoted lines were gene
    +rated by "/sbin/sv restart /export/service/cool-service"
    Jan 20 05:22:09 fakehost cs3[31163]:  R: cs3:  The cool service on fak
    +ehost does not appear to be communicating with the cool service leade
    +r.  Automating a restart of the cool service in attempt to resolve th
    +e communication problem.
    Jan 20 05:22:37 fakehost ACCT_ADD: WARNING: Manifest /var/syscmds/inpu
    +ts/config-general/doit.txt has been processed already, bailing
    
  3. or download this
    open(IN, "fixed.txt") or die "cannot open file $!";
    my %hash ={};
    ...
    $csv->print ( OUT, $_ ) for @heading;
    $csv->print ( OUT, $_ ) for sort keys %hash;   # Error's Out
    close OUT;