Well, probably yes. I checked this in dev console, but it is returning date format error:
{
"error": {
"root_cause": [
{
"type": "number_format_exception",
"reason": "For input string: \"now-2d/d\""
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "filebeat-6.2.4-2018.05.15",
"node": "GXT24JxFR2u09ohBu50mBg",
"reason": {
"type": "number_format_exception",
"reason": "For input string: \"now-2d/d\""
}
}
]
},
"status": 400
}
Anything missing with date format?
Update:
I've got past this error by replacing range
with date_range
. But there seems to be IllegalStateException
:
[2018-05-16T04:17:21,532][DEBUG][o.e.a.s.TransportSearchAction] [GXT24Jx] [filebeat-6.2.4-2018.04.29][4], node[GXT24JxFR2u09ohBu50mBg], [P], s[STARTED], a[id=QorPzoKqSJyo4EPom0wgKg]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[filebeat-6.2.4-2018.05.09-index, filebeat-6.2.4-2018.04.29, filebeat-6.2.4-2018.05.08, filebeat-6.2.4-2018.05.12-index, filebeat-6.2.4-2018.05.11-index, filebeat-6.2.4-2018.05.10-index, filebeat-6.2.4-2018.04.30, filebeat-6.2.4-2018.05.05, filebeat-6.2.4-2018.05.16, filebeat-2017.09.24, filebeat-6.2.4-2018.04.25, filebeat-6.2.4-2018.05.04, filebeat-6.2.4-2018.05.15, filebeat-6.2.4-2018.04.28, filebeat-6.2.4-2018.05.07, filebeat-6.2.4-2018.05.06, filebeat-6.2.4-2018.05.01, filebeat-6.2.4-2018.05.12, filebeat-6.2.4-2018.04.24, filebeat-6.2.4-2018.05.03, filebeat-6.2.4-2018.05.14, filebeat-6.2.4-2018.04.23, filebeat-6.2.4-2018.05.02, filebeat-6.2.4-2018.05.13], indicesOptions=IndicesOptions[id=7, ignore_unavailable=true, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=false, ignore_aliases=false], types=[doc], routing='null', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=5, batchedReduceSize=512, preFilterShardSize=128, source={"query":{"bool":{"filter":[{"range":{"@timestamp":{"from":"now-2d","to":"now","include_lower":true,"include_upper":true,"boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"aggs1":{"date_range":{"ranges":[{"from":"now-2d/d"},{"to":"now-1d/d"}],"keyed":false},"aggregations":{"my_agg":{"max":{"script":{"source":"(doc['upstream'].value/100)","lang":"painless"}}}}},"aggs2":{"date_range":{"ranges":[{"from":"now-2d/d"},{"to":"now-1d/d"}],"keyed":false},"aggregations":{"my_agg":{"max":{"script":{"source":"(doc['downstream'].value/100)","lang":"painless"}}}}},"aggs3":{"date_range":{"ranges":[{"from":"now-1d/d"},{"to":"now/d"}],"keyed":false},"aggregations":{"my_agg":{"max":{"script":{"source":"(doc['upstream'].value/100)","lang":"painless"}}}}},"aggs4":{"date_range":{"ranges":[{"from":"now-1d/d"},{"to":"now/d"}],"keyed":false}},"aggs":{"max":{"script":{"source":"(doc['downstream'].value/100)","lang":"painless"}}}}}}] lastShard [true]
org.elasticsearch.transport.RemoteTransportException: [GXT24Jx][10.30.197.90:9300][indices:data/read/search[phase/query]]
Caused by: java.lang.IllegalStateException: value source config is invalid; must have either a field context or a script or marked as unwrapped
at org.elasticsearch.search.aggregations.support.ValuesSourceConfig.toValuesSource(ValuesSourceConfig.java:228) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.createInternal(ValuesSourceAggregatorFactory.java:51) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.aggregations.AggregatorFactory.create(AggregatorFactory.java:216) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.aggregations.AggregatorFactories.createTopLevelAggregators(AggregatorFactories.java:216) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.aggregations.AggregationPhase.preProcess(AggregationPhase.java:55) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:105) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:307) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:340) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:316) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:312) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.search.SearchService$3.doRun(SearchService.java:1002) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:672) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.2.4.jar:6.2.4]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]