PUT _ingest/pipeline/test1
{
"processors": [
{"dissect": {
"field": "message",
"pattern": "%{logdata}"
}}
]
}
POST _ingest/pipeline/_simulate
{
"pipeline": {
"processors": [
{
"dissect": {
"field": "message",
"pattern": "%{num1}"
},
"pipeline": {
"name": "test1",
"if": "ctx._source.num == '123'"
}
}
]
},
"docs": [
{
"_source": {
"message": "123"
}
}
]
}
I want to use the variable which generated by dissect or grok in if condition to use pipeline test1.
{
"docs" : [
{
"error" : {
"root_cause" : [
{
"type" : "script_exception",
"reason" : "runtime error",
"script_stack" : [
"ctx._source.num == '123'",
" ^---- HERE"
],
"script" : "ctx._source.num == '123'",
"lang" : "painless",
"position" : {
"offset" : 11,
"start" : 0,
"end" : 24
}
}
],
"type" : "script_exception",
"reason" : "runtime error",
"script_stack" : [
"ctx._source.num == '123'",
" ^---- HERE"
],
"script" : "ctx._source.num == '123'",
"lang" : "painless",
"position" : {
"offset" : 11,
"start" : 0,
"end" : 24
},
"caused_by" : {
"type" : "null_pointer_exception",
"reason" : null
}
}
}
]
}
But it will give an error.
How should i use it.