Hi David,
Thanks for the reply and sorry for delay in reply.Now i created advance job by Edit Json method.below is JSON for scripted field.
here scripted field name is - Scripted_field
var1, var2 and var3 are normal(no scripted fields) which are used in formula calculation of scripted field.
But I am still getting below errros messgae while running job after selecting date range.Below are datafeed,JSON and job messages..Please suggets root cause of error.
Also one out of context query is that single/multi metric jobs can not be created using scripted field.
Error:Job messages
demo-es-1 Datafeed lookback retrieved no data
2018-01-29 15:33:56 demo-es-1 Datafeed stopped
2018-01-29 15:33:56 demo-es-1 Job is closing
2018-01-29 15:38:06 demo-es-1 Loading model snapshot [N/A], job latest_record_timestamp [N/A]
2018-01-29 15:38:06 demo-es-1 Opening job on node [{demo-es-1}{EkYGvk4xSrGXw4SlJHhIeg}{QEvMEcUuRf6YwdVwQiyYzg}{172.19.1.69}{172.19.1.69:9300}{ml.max_open_jobs=10, ml.enabled=true}]
2018-01-29 15:38:07 demo-es-1 Starting datafeed [datafeed-test2] on node [{demo-es-1}{EkYGvk4xSrGXw4SlJHhIeg}{QEvMEcUuRf6YwdVwQiyYzg}{172.19.1.69}{172.19.1.69:9300}{ml.max_open_jobs=10, ml.enabled=true}]
2018-01-29 15:38:07 demo-es-1 Datafeed started (from: 2017-11-30T18:30:00.000Z to: real-time)
2018-01-29 15:38:09 demo-es-1 Datafeed stopped
2018-01-29 15:38:21 demo-es-1 Starting datafeed [datafeed-test2] on node [{demo-es-1}{EkYGvk4xSrGXw4SlJHhIeg}{QEvMEcUuRf6YwdVwQiyYzg}{172.19.1.69}{172.19.1.69:9300}{ml.max_open_jobs=10, ml.enabled=true}]
2018-01-29 15:38:21 demo-es-1 Datafeed started (from: 2017-11-05T18:30:00.000Z to: real-time)
2018-01-29 15:43:17 demo-es-1 Datafeed stopped
2018-01-29 15:43:31 demo-es-1 Starting datafeed [datafeed-test2] on node [{demo-es-1}{EkYGvk4xSrGXw4SlJHhIeg}{QEvMEcUuRf6YwdVwQiyYzg}{172.19.1.69}{172.19.1.69:9300}{ml.max_open_jobs=10, ml.enabled=true}]
2018-01-29 15:43:31 demo-es-1 Datafeed started (from: 2017-10-31T18:30:00.000Z to: real-time)
JSON
{
"job_id": "test2",
"job_type": "anomaly_detector",
"job_version": "5.5.2",
"description": "test2",
"create_time": 1517219553362,
"finished_time": 1517220236980,
"analysis_config": {
"bucket_span": "5m",
"detectors": [
{
"detector_description": "high_mean(Scripted_field)",
"function": "high_mean",
"field_name": Scripted_field
"detector_rules": [],
"detector_index": 0
}
],
"influencers": []
},
"data_description": {
"time_field": "@timestamp",
"time_format": "epoch_ms"
},
"model_snapshot_retention_days": 1,
"model_snapshot_id": "1517220750",
"results_index_name": "custom-test2",
"state": "opened",
"data_counts": {
"job_id": "test2",
"processed_record_count": 0,
"processed_field_count": 0,
"input_bytes": 0,
"input_field_count": 0,
"invalid_date_count": 0,
"missing_field_count": 0,
"out_of_order_timestamp_count": 0,
"empty_bucket_count": 0,
"sparse_bucket_count": 0,
"bucket_count": 0,
"input_record_count": 0
},
"model_size_stats": {
"job_id": "test2",
"result_type": "model_size_stats",
"model_bytes": 0,
"total_by_field_count": 0,
"total_over_field_count": 0,
"total_partition_field_count": 0,
"bucket_allocation_failures_count": 0,
"memory_status": "ok",
"log_time": 1517220236000,
"timestamp": -300000
},
"open_time": "493s",
"datafeed_config": {
"datafeed_id": "datafeed-test2",
"job_id": "test2",
"query_delay": "60s",
"frequency": "150s",
"indices": [
"master_neo"
],
"types": [
" "
],
"query": {
"match_all": {
"boost": 1
}
},
"script_fields": {
"Scripted_field": {
"script": {
"inline":"(doc['var1'].sum().5)(-doc['var2'].avg()0.1)(doc['var3'].avg()*10)*0.0001",
"lang": "expression"
},
"ignore_failure": false
}
},
"scroll_size": 1000,
"chunking_config": {
"mode": "auto"
},
"state": "started"
}
}
Datafeed
datafeed_iddatafeed-test2
job_idtest2
query_delay60s
frequency150s
indices: master_leo
types:
query{"match_all":{"boost":1}}
script_fields{"Scripted_field":{"script":{"inline":"(doc['var1'].sum().5)(-doc['var2'].avg()0.1)(doc['var3'].avg()*10)*0.0001","lang":"expression"},"ignore_failure":false}}
scroll_size1000
chunking_config{"mode":"auto"}
state started