parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: distributed grep


From: Ole Tange
Subject: Re: distributed grep
Date: Mon, 20 Feb 2012 17:34:55 +0100

On Sun, Feb 19, 2012 at 9:50 PM, Hans Schou <chlor@schou.dk> wrote:
> On Sat, 18 Feb 2012, siddharth chhabra wrote:

>> I have have 3 servers (lets say
>> server1.mycompany.com,server2.mycompany.com and server3.mycompany.com)
>> On all 3 servers I have log files called server.log in the following
>> locations -
>>
>> /home/testuser/store1/log/server.log
>> /home/testuser/store2/log/server.log
>> /home/testuser/store3/log/server.log
>>
>> I want to do a grep on all these log files (9 in total 3 on each) from my
>> current computer (server1.mycompany.com) and have the results displayed on
>> my computer.

[... Hans gave one solution ...]

Basically what you want to do is to run the same command on all
computers. That is what --onall is for:

parallel -q --onall -S .. --tag grep 'my search regexp' :::
/home/testuser/store{1,2,3}/log/server.log

The benefit of this is that 'my search regexp' will be quoted if
needed (e.g. if it contains space or similar).

Remove --tag if you do not care what server the output is from.


/Ole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]