Hello everyone,
I'm trying to create a simple scripted field in my index of ES. Basically, I have a field "attempResult" in my index that could be null when the grok(logstash pattern) does not match, or "Successful", "Failed" in the cases in which the pattern match.
So, what I would like is to create a field (number) with the value of 1 when the field 'attemptResult' is "failed", and 0 in the case it is "Successful". I'm trying to create that on the script section of the scripted field definition by using
if(doc['attemptResult.keyword'] == ("Sucessful")){
return 0;
}
if(doc['attemptResult.keyword'] == ("Failed")){
return 1;
}
but when i run it, it always adds null value to the scripted field,
any suggestion?
Thanks su much,
JUAN DAVID BRICENO GUERRERO
MASTER STUDENT IN SUSTAINABLE INDUSTRIAL ENGINEERING