-
-
Notifications
You must be signed in to change notification settings - Fork 28
paStash NG Commands
Lorenzo Mangani edited this page Jan 26, 2019
·
11 revisions
This WIP outlines the nature of paStash commands and their general usage.
Command filters are pluggable pipeline functions users can inject in their logic using npm modules. Example:
.filter('method', 'INVITE')
.groupBy('response')
.divide('timestamp',1000,data)
.data(data)
In order to understand the potential usage of command
filters we'll create a simple custom plugin providing a divide
and multiply
set of commands to our pipeline.
The custom plugin (and any other) will be loaded at runtime via the plugins
property of our filter:
input {
stdin{}
}
filter {
json_fields {}
command {
debug => false
cmd => ".divide('age',2,data).multiply('eyes',2,data).data(data)"
plugins => ['@pastash/command_chain','@pastash/command_math']
}
}
output {
stdout {}
}
When executed, the command will apply any number of transformations and return the results to the next step.