Watcher - check if string contains word

Hello everyone.
It is possible to check if some field contains word inside input string? using instruction contains()
I have this:

{
              "script": {
                "script": {
                  "source": "if(doc['exec.stdout.keyword'].toString().contains('cookie'))return true;",
                  "lang": "painless"
                }
              }

but this script always return false, I can't use regex, there is no possibility to enable it.

My false... I have something wrong in other place. Now is working, so leave this script for somebody who need it.