public class DissectOperator extends Object
See the original Logstash dissect plugin documentation at : https://github.com/logstash-plugins/logstash-filter-dissect/tree/master/docs https://www.elastic.co/guide/en/logstash/5.6/plugins-filters-dissect.html
The following example punchlet
{
[logs][log] = "Hello World";
boolean status = dissect("%{a} %{b}").on([logs][log]).into([dissect_result]);
}
will output this root tuple :
{
"logs": {
"log": "Hello World"
},
"dissect_result": {
"a": "Hello",
"b": "World"
}
}
Note: the dissect operator return a boolean value. This is very helpful to run conditional block code relying on operator success (or fail).
Constructor and Description |
---|
DissectOperator(org.logstash.dissect.Dissector dissector)
Dissect operator constructor.
|
Modifier and Type | Method and Description |
---|---|
static org.logstash.dissect.Dissector |
CompileDissectOperator(String pattern)
Pre-compile Dissect() pattern into Dissector objects to call
them at runtime.
|
DissectOperator |
debug()
Print multiple useful values for debugging.
|
boolean |
into(Tuple tuple)
Registers a tuple to hold the operator results.
|
DissectOperator |
on(String input)
Set the input data for running this operator.
|
DissectOperator |
on(Tuple input)
Set the input data for running this operator.
|
DissectOperator |
overwrite()
Request the existing content of your output tuple to be wiped and overwritten with the dissect value.
|
public DissectOperator(org.logstash.dissect.Dissector dissector)
dissector
- The pre-compile dissector object to callpublic static org.logstash.dissect.Dissector CompileDissectOperator(String pattern)
pattern
- The dissect pattern to compilepublic DissectOperator debug()
public DissectOperator overwrite()
public DissectOperator on(Tuple input)
input
- the data as a Tuple.public DissectOperator on(String input)
input
- the input as a Stringpublic boolean into(Tuple tuple)
tuple
- The resulting TupleCopyright © 2022. All rights reserved.