Immediate exit

elof2 at sentor.se elof2 at sentor.se
Tue Apr 26 11:41:13 EDT 2011


Hi!

Both you and Mike missed my point.

It is not the output of one line I'm asking for, it is immediate 
termination of 'ra' as soon as the pipe command terminates.

Here's another example:

ra -r huge.logfile | grep -q "CON"



The 'grep' command will exit as soon as it encounters the string "CON".
One of the first lines of ra output probably contain "CON" so I would 
expect my script to end there, but no, even though grep has exited and ra 
no longer has anything to output to, ra still continue to execute and chew 
through the logfile(s) to absolutely no use.

If the log file is several GB, or if you have *lots* of logfiles, or if 
the files are located on a slow NFS-mount, ra will continue to execute for 
several minutes for something that typically should have taken less that 1 
ms.

/Elof




On Tue, 26 Apr 2011, Mark Poepping wrote:

> Use the record count feature.
> 	ra  -N 1
>
> -----Original Message-----
> From: argus-info-bounces+poepping=cmu.edu at lists.andrew.cmu.edu
> [mailto:argus-info-bounces+poepping=cmu.edu at lists.andrew.cmu.edu] On Behalf
> Of elof2 at sentor.se
> Sent: Tuesday, April 26, 2011 10:37 AM
> To: Argus Development
> Subject: [ARGUS] Immediate exit
>
>
> Question (and feature request):
>
> Is it possible to have 'ra' terminate immediately in cases similar to
> this:
>
> ra -r huge.logfile | head -1
>
>
> There's no need for 'ra' to spend minutes chewing through the rest of the
> logfile(s). The pipe command has terminated and is not waiting for any more
> data.
>
> /Elof
>
>
>



More information about the argus mailing list