Hey,
Is it possible to use the values you get from transform in the action log message?
In my transform, I calculate the derivative and want to display it in my log/slack message.
Hey,
Is it possible to use the values you get from transform in the action log message?
In my transform, I calculate the derivative and want to display it in my log/slack message.
If you are using a transform, then you can only use the values, that the transform returns, and you do not have access to the original payload.
Can you explain where the problem is or show the transform
snippet?
Thanks!
Hey, I'm trying to access the transform's payload from actions in order to see it in logs.
Here's an example:
"transform": {
"script": {
"source": "ctx.payload.transform = []; def document = []; for (int j=0;j<ctx.payload.hits.hits;j++){ document = ['test': ctx.payload.hits.hits[j]._source.message]; ctx.payload.transform.add(document); } return ctx.payload.transform;",
"lang": "painless"
}
},
"actions": {
"my-logging-action": {
"logging": {
"level": "info",
"text": "{{ctx.payload.transform}}"
}
}
}
the payload is replaced with the data you return in the transform
. try logging {{ctx.payload}}
and you will see your list.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.