title: Logstash query elasticsearch geohash data
body: <p>I am aggregating the location data using geohash, which works well on the Chrome Sense plugin, but once i try to query through logstash as an input plugin of elasticsearch, its not working...
  My Sense Query:</p>
  
  <pre><code>POST/_search
  {
  
  "query": {
  "match_all": {}
  },
  "aggs": {
  "my_area": {
    "geohash_grid": { 
      "field":     "location",
      "precision": 6
    }
  }  
  }
  }
  </code></pre>
  
  <p>My logstash configuration file:</p>
  
  <pre><code>input {  elasticsearch {
  hosts =&gt; "localhost:9200"
  index =&gt; "devices"
  query =&gt; '{"query": 
  { 
  "aggs": {
  "my_area": {
    "geohash_grid": { 
      "field":     "location",
      "precision": 6
          }
      }
  } } }'  }}}
  </code></pre>
  
  <p>My logstash Exception:</p>
  
  <pre><code>←[31mA plugin had an unrecoverable error. Will restart this plugin.
    Plugin: &lt;LogStash::Inputs::Elasticsearch hosts=&gt;["localhost:9200"],             index=&gt;"de
  vices", query=&gt;"{\"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=&gt;&lt;LogStash::Codecs::JSON charset=&gt;"UTF-8"&gt;,
  scan=&gt;true, size=&gt;1000, scroll=&gt;"1m", docinfo=&gt;false, docinfo_target=&gt;"@metadata
  ", docinfo_fields=&gt;["_index", "_type", "_id"], ssl=&gt;false&gt;
  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=&gt;:error}←[0m
  </code></pre>