perlgrok.pl
changeset 9 f1cb959b4603
parent 8 31c4ce4d9b73
child 10 72f6df1085b7
equal deleted inserted replaced
8:31c4ce4d9b73 9:f1cb959b4603
    37     "pattern=s"     => \@fn_patterns,
    37     "pattern=s"     => \@fn_patterns,
    38     "top=s"         => \$top,
    38     "top=s"         => \$top,
    39     "parsed=s"      => \$fn_parsed,
    39     "parsed=s"      => \$fn_parsed,
    40     "failed=s"      => \$fn_fail,
    40     "failed=s"      => \$fn_fail,
    41     "debug=i"       => \$DEBUG,
    41     "debug=i"       => \$DEBUG,
       
    42     "retrace!"      => \$re_trace,
    42     "help"          => \$help,
    43     "help"          => \$help,
    43 ) or die "error in command line arguments";
    44 ) or die "error in command line arguments";
    44 
    45 
    45 if( $help ) {
    46 if( $help ) {
    46     my $VER = '$Id: perlgrok.pl,v d6e64daafdc1 2021/09/29 23:46:59 grin $';
    47     my $VER = '$Id: perlgrok.pl,v d6e64daafdc1 2021/09/29 23:46:59 grin $';
    47     print "$0 $VER (c) Peter 'grin' Gervai, 2021\n\n";
    48     print "$0 $VER (c) Peter 'grin' Gervai, 2021\n\n";
    48     print "Usage: $0 [--input input_file] [--pattern pattern_file] [--pattern another] [--top final_macro] \n";
    49     print "Usage: $0 [--input input_file] [--pattern pattern_file] [--pattern another] [--top final_macro] \n";
    49     print "          [--parsed parsed_outfile] [--failed failed_lines_file] [--debug n] [--help]\n";
    50     print "          [--parsed parsed_outfile] [--failed failed_lines_file] [--debug n] [--noretrace] [--help]\n";
    50     print "       defaults are stdin, stdout, 'patterns' as patternfile and 'TEST' as final macro.\n\n";
    51     print "        input:   input file to be processed; default stdin\n";
       
    52     print "        pattern: input grok-style pattern file; default patterns (name space pattern) (multiple possible)\n";
       
    53     print "        top:     name of the pattern to match; default TEST\n";
       
    54     print "        parsed:  output filename for parsed data; default stdout\n";
       
    55     print "        failed:  output filename for lines not matched; default none\n";
       
    56     print "        debug:   debug level 0 (none), 1 (error), 3 (warning), 7 (debug), 9 (trace)\n";
       
    57     print "        notrace: disable regexp syntax check per pattern\n";
       
    58     print "\n\n";
    51     exit;
    59     exit;
    52 }
    60 }
    53 
    61 
    54 if( $#fn_patterns < 0 ) {
    62 if( $#fn_patterns < 0 ) {
    55     push @fn_patterns, "patterns";
    63     push @fn_patterns, "patterns";