We used to have the following painless script for two of our APM pipelines (traces-apm-8.1.2 & traces-apm.rum-8.1.2) that vanished after upgrading escloud version from 8.1.2 to 8.2.3.
That script generates an apdex value an creates a new field with the value.
We don't only have the problem of removing the painless script when upgrading but we also have the problem of having new pipelines after the upgrade (traces-apm.rum-8.2.0 & traces-apm-8.2.0)
We were thinking of moving that painless script to a runtime field for the Index Templates traces-apm & traces-apm-rum , but we don't know how to do that and we also don't know if that runtimefield will disappear when we upgrade escloud in the future.
As of writing this comment, pipelines don't persist through upgrades. However, the feature to support optional and custom ingest pipelines is in work.
For runtime fields, you can define them on a data-view from the Stack Management/Data Views section. Documentation for the same can be found here. Runtime fields also use painless script, an example of the script you shared translated to be used with runtime field would be something like:
Thanks for all your help. I created the runtime field at the Data View with the script you mentioned and it worked. I also modified some visualisations pointing to that new field and they worked too but there is a watcher failing since then.
I attach an screenshot of the runtime field set up.
And this is the error related to those null values.
"type": "null_pointer_exception",
"reason": "Cannot invoke \"Object.getClass()\" because \"leftObject\" is null",
"stack_trace": "java.lang.NullPointerException: Cannot invoke \"Object.getClass()\" because \"leftObject\" is null\n\tat
Do you know why this is happening? Thanks in advance
Glad that the runtime fields worked for you. I am not a watcher expert but, AFAIK, dataview runtime fields are not available to watcher for a query. Dataview alerts can be used with runtime fields on dataview but I think they are available in 8.3+ versions.
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.