Hey,
I have been trying to use a detector that calculates the high sum of a given field, and I have the following questions:
Why can't I see the single metric viewer for this job?
The job is configured in the "advanced job" mode, and although I can see anomalies in the Anomaly Explorer, I cannot see the single metric viewer for any detectors with a sum/high-sum function.
How is it possible that the model is calculating the "high_sum" of a STRING field?
The field I am using is "bytes_to_server", and the JSON decoder is decoding it as a string instead of as an integer. While I cannot apply aggregations on this field in Kibana visualizations (as I would expect), I am able to create an ML job that finds the sum of the same field. This is just something I can't wrap my head around
(Just FYI- I've been making and viewing all my Machine Learning jobs in the Kibana UI)
Here is a job I created in the advanced job config that has multiple detectors. It also has a partition around a keyword field, but I created another one without the partition and I could see it in Single Metric Viewer. This is in 7.1.0, but this type of visualization has been supported for a while now.
As for how we are summing a "string" field: What is the mapping of the field "bytes_to_server" in the index? If the mapped type is a numeric (i.e. long, double etc.) we will end up using doc_values when we gather the data before sending it to the Machine Learning job for processing.
Example of using doc values to get the appropriate type in the JSON payload from the search.
@Aashka, you found a wonderful bug in our visualization .
The DataFeed does NOT have to contain aggregations. I am assuming in your case, it is not using aggregations and simply scrolling through the documents. You can confirm this by looking at the data feed config definition and verifying that there are no aggregations referencing the keyword value. Once the datafeed sends the data back to the C++ process, it is casting the string into a numeric value.
The reason Single metric is not working is that the UI is attempting to aggregate the keyword, and is expecting a numeric value. I attempted this myself and found the following error in my console output.
Time series explorer - error getting metric data from elasticsearch:
Object { statusCode: 400, error: "Bad Request", message: "[illegal_argument_exception] Expected numeric type on field [response.keyword], but got [keyword]" }
I will reach out to the ML UI team to see if we can get this error to bubble up so that users see this occur, or how we can better handle unexpected values when trying to view things through single metric viewer.
@Aashka as Ben points out, the Single Metric Viewer is expecting the partitioning field to be a numeric type, and currently fails, without an obvious error (except in the browser console), by attempting to aggregate on a keyword field. There is currently an open issue for this.
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.