Elastic search query returns none

87 views
Skip to first unread message

BalaKrishna Mumdluri

unread,
Sep 21, 2015, 6:47:10 AM9/21/15
to Blueflood Discuss
Hi,

I have configured the following properties in blueflood.conf file to enable elastic search.

ELASTICSEARCH_HOSTS=localhost:9300
ELASTICSEARCH_CLUSTERNAME=elasticsearch
USE_ES_FOR_UNITS=true
DISCOVERY_MODULES=com.rackspacecloud.blueflood.io.ElasticIO

I have ingested the raw metrics from ingest.py file. And tried to query the metric data using URL "http://localhost:20000/v2.0/tenant-1/metrics/search?query=abc.*". But returns no hits.
But when I query elastic search directly using the URL "http://localhost:9200/_search?pretty=true", I could see the records that were ingested to Elastic search by Blueflood discovery module.

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 3,
    "max_score" : 1.0,
    "hits" : [  {
      "_index" : "metric_metadata",
      "_type" : "metrics",
      "_id" : "tenant-1:abc.bytes",
      "_score" : 1.0,
      "_source":{"tenantId":"tenant-1","metric_name":"abc.bytes","unit":"seconds"}
    } ]
  }
}

Is there anything i am missing to configure Elastic search with Blueflood? 

Regards,
Balakrishna

George J

unread,
Sep 25, 2015, 5:11:56 PM9/25/15
to Blueflood Discuss
It looks to me like you are doing it right.  I can't think of anything else you need.

If you post the exact return value from the query, as well as your entire blueflood config file, we may be able to help more.

BalaKrishna Mumdluri

unread,
Oct 1, 2015, 3:21:51 AM10/1/15
to Blueflood Discuss
For URL  "http://localhost:20000/v2.0/tenant-1/metrics/search?query=abc.bytes"

The request query would be

{
  "bool" : {
    "should" : {
      "bool" : {
        "must" : [ {
          "term" : {
            "tenantId" : "tenant-1"
          }
        }, {
          "term" : {
            "metric_name" : "abc.bytes"
          }
        } ]
      }
    }
  }
}


the request query would be 

{
  "bool" : {
    "should" : {
      "bool" : {
        "must" : [ {
          "term" : {
            "tenantId" : "tenant-1"
          }
        }, {
          "regexp" : {
            "metric_name" : {
              "value" : "abc\\..*"
            }
          }
        } ]
      }
    }
  }
}

The response is same as below:

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

Please find blueflood.conf file attached.
blueflood.conf

Vinny Ly

unread,
Oct 12, 2015, 4:55:52 PM10/12/15
to Blueflood Discuss
Another thing to check is make sure your elasticsearch cluster name matches the value you set in blueflood.conf (i.e. "elasticsearch").

ELASTICSEARCH_CLUSTERNAME=elasticsearch

you can set the cluster name via the elasticsearch.yml property file, or you can check what the current cluster name is if you submit a GET to:  http://localhost:9200/_nodes/settings?pretty
Reply all
Reply to author
Forward
0 new messages