I'm trying to alter datafeed for ml jobs but the same errror keep occurs.
What I want to do is alter data like 'abc/def/ghi' into 'abc' so based on this i wrote script as follows
@zerojin63 I have been able to configure a runtime field similar to the one you are trying to use in your datafeed. The double quotes at the end of the second snippet you posted just need editing.
I am using the Advanced wizard in the Machine Learning page in Kibana, and then edit the JSON used in the datafeed to this for the data view (index pattern) I am using:
You can see in the datafeed preview that the runtime field is getting populated (most of my entries are empty, but there are non-empty ones too), and I can use the field in a job:
Note we have an issue open to switch to a new JSON editor throughout the Machine Learning UI, which would allow you to define the script using the same syntax you posted in your first snippet. Depending on which version of the stack you have, you can also define this field in the data view (index pattern) itself, using that simpler syntax, and it will be available to use in the anomaly detection job.
An error occurs on job validation process when I use the runtime field I added as a detector field on anomaly detection job.
This is the error that keeps occuring.
I've checked that the runtime field I added works fine on 'Discover' section.
I've also checked that if I use other fields (the original fields, except for the one I added) as detector, no error occurs.
So it must have something to do with rhe field I added.. But I don't get what's wrong with it.
Do you happen to have any idea regarding this situation?
Apologies for the delay in replying @zerojin63. The error you are seeing when trying to use the field in an ML job looks like it is being caused by the datafeed preview step which validates the job configuration taking too long. The fact that the field shows up in Discover would imply that the configuration of the field is ok.
What version of the stack do you have, and which of the anomaly detection job wizards are you using? If you use the advanced job wizard, add the detector using the runtime field, then hit 'Edit JSON' and take a look in the datafeeed preview panel. Do you see values for your runtime field in there, like I see here:
Thanks for your reply.
Here's the answer to your questions.
What version of the stack do you have?
-> I'm using v 7.17.3
Which of the anomaly detection job wizatd I am using?
-> I used advanced job as well. Also I was able to see values for my runtime field.
So I don't think there's anything wrong with my runtime field script, but still the error occurs on job validation process.
I'm using 'rare' as my anomaly detection job detector. Can this be the reason for this error?
You shouldn't have any problems using the runtime field in a 'rare' detector. I have stepped through the advanced wizard and the validation step succeeded. My job and datafeed config and preview look like this (I have two runtime fields defined in my data view, but the job is only using one of them):
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.