Open preaction opened 8 years ago
The default input should be default
, and work like Perl's ARGV
(STDIN + arguments). The default output should be stdout
.
filter
should take a subref to allow for Perl-based filtering.
input
/output
should both accept filehandles. Should that be considered a file
even if it's a pipe or a socket?
input
/output
should all have format
options. The default for output
should be default
. The default for input
is trickier... grok
requires lines, everything else requires documents. Probably, for consistency, we should use default
as the default input, but perhaps we should, for ease-of-use, default to lines
if grok
is the first filter...
In the future, it'd be nice if input/output could have attached filters. So, the filter command should return something that can be used as an argument to input/output.
It would be nice to do filtering in forked processes for performance maybe...
This should still be done even as we create the new Perl API. The Script API should export three functions: input
, output
, and transform
(which replaces the existing transform
function). input
registers a new input. output
registers an output.transform
registers a transform. Once the script is done, the pipelines are constructed:
@ARGV
+STDIN
STDOUT
Once the pipelines are constructed, the loop can be run.
We could have a yertl command line script that works similarly to logstash: