To answer your questions one by one,
Aparently that error can occur if the index is either empty
Indices in test-*
index pattern are test-2020.01.01
, test-2020.01.02
and so on.
GET /test-*/_count?
{
"count" : 8462636,
"_shards" : {
"total" : 14,
"successful" : 14,
"skipped" : 0,
"failed" : 0
}
}
if the user who is configuring the job doesn't have permissions to read that index.
The user I am using has some roles attached to it.
- machine_learning_user
- machine_learning_admin
- kibana_user
- log_reader
- test (custom role we added)
- Cluster privileges : monitor_ml, manage_index_templates, manage
- Run As privileges : None
- Index privileges
- indices : test-*
- privileges : all
Validate that this is not the case
From the details above, I think I can conclude the indices are not empty and that I have right permissions.
what if anything do you see if you select the "Data Preview" tab?
Yeah I see the documents with the fields I need. For your information, I had to scrub id
and request_header_forwareded_for
fields. They do contain legitimate values though.
[
{
"_index": "test-2020.02.05",
"_type": "_doc",
"_id": "",
"_score": 2,
"_source": {
"request_header_forwarded_for": "",
"@timestamp": "2020-02-05T00:27:38.381Z"
}
},
{
"_index": "test-2020.02.05",
"_type": "_doc",
"_id": "",
"_score": 2,
"_source": {
"request_header_forwarded_for": "",
"@timestamp": "2020-02-05T00:27:34.719Z"
}
}
⋮
]
What errors, if any get logged to elasticsearch.log at that time?
What I got while reproducing the error is as follows.
Feb 25, 2020, 12:34:35 PM UTC
WARN
i2@eu-west-1c
[instance-0000000002] [GET /_xpack/ml/anomaly_detectors/_stats] is deprecated! Use [GET /_ml/anomaly_detectors/_stats] instead.
Feb 25, 2020, 12:34:35 PM UTC
WARN
i5@eu-west-1a
[instance-0000000005] [GET /_xpack/ml/anomaly_detectors] is deprecated! Use [GET /_ml/anomaly_detectors] instead.
Feb 25, 2020, 12:34:04 PM UTC
WARN
i1@eu-west-1c
[instance-0000000001] [GET /_xpack/ml/anomaly_detectors/_stats] is deprecated! Use [GET /_ml/anomaly_detectors/_stats] instead.
Feb 25, 2020, 12:34:04 PM UTC
WARN
i2@eu-west-1c
[instance-0000000002] [GET /_xpack/ml/info] is deprecated! Use [GET /_ml/info] instead.