Hi, I want to retrieve only the value of "job_id" when I make this query
GET _ml/anomaly_detectors/
It is posible to use something like "_source " in the _search queries to only retrieve the "job_id"?
Hi, I want to retrieve only the value of "job_id" when I make this query
GET _ml/anomaly_detectors/
It is posible to use something like "_source " in the _search queries to only retrieve the "job_id"?
That is an API call, not a query to an index. The rough equivalent to querying the index to only return job names would be something like:
GET .ml-config/_search
{
"query": {
"bool": {
"filter": [
{
"term": {
"job_type": "anomaly_detector"
}
}
]
}
},
"_source": "job_id"
}
If you want to make the API call then something like this might work for you:
curl localhost:9200/_ml/anomaly_detectors/?pretty | awk -F" : " '/job_id/{print $2}' | sed 's/\",//g' | sed 's/\"//g'
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.