I have a working watch script with trigger, input, condition, and action. The input section has significant logic and the condition is hard coded to true. I would like to change that.
The input section has a transform with a complex chain block. It creates new terms which are used by the scripts that live inside of the input section.
I want to duplicate all of that logic (minus the input scripts) into the condition section. However I have not seen an examples. Examples simply access simple elastic fields.
Any tips for moving custom terms into a condition block? Is my issue syntactical or is it not possible?
The following closed thread discusses the same problem that I am having. Unlike the poster, my JSON appears to be valid:
Yes, I saw all of this. I've been looking at json and don't see anything wrong - looks like everything is properly formatted/quoted with matching/balanced curlies:
52 "field": "@timestamp",
53 "interval": "minute",
54 "offset": 0,
56 "_key": "asc"
I am not sure I fully got your issue, let me try to rephrase and feel free to correct me.
You have a script running as part of a transform (in a chained input)
You now don't want to rerun the same part in the script condition
How about writing something into the payload as part of your transform, so that the condition can simply check this particular field for
If I misunderstand, please share a watch, and more details including your expectations, I think that may help a bit.
I simply needed to return the value from the last executed input script before my condition script. I failed to realize that they needed to be returned at each level of a transform chain and accessed like ctx.payload.myField. Thanks.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.