#!/usr/bin/perl $SUCHE="TARS"; $BEGRENZER_probe = "probe"; $i=0; $TEXT='probe http probe_L7_IDST-TARS-8085 port 8085 interval 5 passdetect interval 5 passdetect count 2 request method get url /login.jsp expect status 200 200 probe http probe_L7_IDST-TARS-18080 port 18080 interval 5 passdetect interval 5 passdetect count 2 request method get url /login.jsp expect status 200 200 probe icmp probe_L3_PING interval 4 passdetect interval 8 passdetect count 2 receive 2'; # Text in Zeilen aufteilen ------------------------------------------------------- $TRENNER="\n"; @KONFIG=split(/$TRENNER/,$TEXT); foreach $STRING(@KONFIG) { chomp($STRING); } #============================================================== #Suche------------------------------------------------------------------ if ($TEXT =~ /probe.*$SUCHE/) { print $&."\n"; } elsif ($TEXT =~ /.*probe.*/) { print $'."\n"; }