Hi,
I am using ELK GA 5.0.0 . In Kibana, I have created a string type scripted field 'err_type` like below;
if (doc['error'].value == 'NONE') {
return 'typea';
}else if (doc['error'].value == 'ERRX') {
return 'typeb';
}
return 'typec';
When I try to + or - filter using it in Discover, I am getting Discover: compile error
. I was able to see the generated fields in the left sidebar. I then clicked +
filter corresponding to typec
. Then I got the error. When I click the edit button, I have seen the query constructed like below;
{
"script": {
"script": {
"inline": "(if (doc['error'].value == 'NONE') { \n return 'typea';\n}else if (doc['error'].value == 'ERRX') { \n return 'typeb';\n}\nreturn 'typec';) == params.value",
"lang": "painless",
"params": {
"value": "typec"
}
}
}
}
How can I fix this?
Thanks in advance..