Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl MultiTail Question

Status
Not open for further replies.

manik112

Technical User
Feb 3, 2010
1
US
Hi ,

Am using MultiTail and my code is:
use MultiTail;

$tail1=MultiTail->new ( OutputPrefix => "f",
Debug => "$True",
Files => ["/tmp/log/*"]
);

while(1) {
$tail1->read;
#
# $tail1->print;
system ("/usr/bin/logger", "-p", "local0.notice", $tail1->print);
sleep 10;
}

So my script is failing at system execute level, in the sense that its not displaying actual value of $tail1->print in the log file. Is there a different way to parse each line of $tail1 ?
 
$tail->print does not return the contents of the lines that were read, it just prints them.

My guess is you will need to loop through the contents of the $tail1->LineArray and run the external command once for each item in the array.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top