Logstash查询elasticsearch geohash数据
我正在使用geohash聚合位置数据,geohash在Chrome Sense插件上运行良好,但一旦我尝试通过logstash作为elasticsearch的输入插件进行查询,它就不起作用了。。。 我的感觉问题:Logstash查询elasticsearch geohash数据,
Warning: implode(): Invalid arguments passed in /data/phpspider/zhask/webroot/tpl/detail.html on line 45
,,我正在使用geohash聚合位置数据,geohash在Chrome Sense插件上运行良好,但一旦我尝试通过logstash作为elasticsearch的输入插件进行查询,它就不起作用了。。。 我的感觉问题: POST/_search { "query": { "match_all": {} }, "aggs": { "my_area": { "geohash_grid": { "field": "location", "precision": 6 } }
POST/_search
{
"query": {
"match_all": {}
},
"aggs": {
"my_area": {
"geohash_grid": {
"field": "location",
"precision": 6
}
}
}
}
我的日志存储配置文件:
input { elasticsearch {
hosts => "localhost:9200"
index => "devices"
query => '{"query":
{
"aggs": {
"my_area": {
"geohash_grid": {
"field": "location",
"precision": 6
}
}
} } }' }}}
我的日志存储例外:
←[31mA plugin had an unrecoverable error. Will restart this plugin.
Plugin: <LogStash::Inputs::Elasticsearch hosts=>["localhost:9200"], index=>"de
vices", query=>"{\"query\": \n\t{ \n\t\"aggs\": {\n \"my_area\": {\n \"
geohash_grid\": { \n \"field\": \"location\",\n \"precision\":
6\n\t\t\t}\n\t\t}\n\t} } }", codec=><LogStash::Codecs::JSON charset=>"UTF-8">,
scan=>true, size=>1000, scroll=>"1m", docinfo=>false, docinfo_target=>"@metadata
", docinfo_fields=>["_index", "_type", "_id"], ssl=>false>
Error: [400] {"error":{"root_cause":[{"type":"query_parsing_exception","reason
":"No query registered for [aggs]","index":"devices","line":3,"col":2}],"type":"
search_phase_execution_exception","reason":"all shards failed","phase":"init_sca
n","grouped":true,"failed_shards": [{"shard":0,"index":"devices","node":"fcYfrzLA
QQeQ4q9skTAHNw","reason":{"type":"query_parsing_exception","reason":"No query re
gistered for [aggs]","index":"devices","line":3,"col":2}}]},"status":400} {:leve
l=>:error}←[0m
←[31mA插件出现不可恢复的错误。将重新启动此插件。
插件:[“localhost:9200”],索引=>“de”
vices”,query=>“{\”query\”:\n\t{\n\t\“aggs\”:{\n\“my\u area\”:{\n\”
geohash\u grid\“:{\n\”字段\“:\”位置\“,\n\”精度\“:
6\n\t\t\t}\n\t\t}\n\t}},编解码器=>“UTF-8”>,
scan=>true,size=>1000,scroll=>1m,docinfo=>false,docinfo\u target=>“@metadata
,docinfo_字段=>[“_索引”、“_类型”、“_id”],ssl=>false>
错误:[400]{“错误”:{“根本原因”:[{“类型”:“查询异常”、“原因”
:“没有为[aggs]注册查询”,“索引”:“设备”,“行”:3,“列”:2}],“类型”:
搜索\u阶段\u执行\u异常”,“原因”:“所有碎片失败”,“阶段”:“初始化\u sca”
n,“grouped”:true,“failed_shard”:[{“shard”:0,“index”:“devices”,“node”:“fcYfrzLA”
QQ4Q9SKTAHNW,“原因”:{“类型”:“查询\解析\异常”,“原因”:“无查询”
注册为[aggs],“索引”:“设备”,“行”:3,“列”:2}}]},“状态”:400}{:leve
l=>:错误}←[0m
您的查询不正确,因为aggs
不是有效的查询。此外,您不能使用elasticsearch
输入运行聚合,只有普通查询您的查询不正确,因为aggs
不是有效的查询。此外,您不能使用elasticsearch
输入运行聚合,只有普通查询