How to define a template variable

hi guys,

for some reason, when I upgraded to the latest elasticsearch version,
the grafana panels do not work for me, and the reason is that i never get the options defined as templated variables.

More specifically, as an example, if i look into the “netelement” grafana templated variable (corresponds to “dev_name” elasticsearch field)

In Kibana, it looks OK:
54

In Grafana, it does not look OK (no results returned):

Would you be so kind to advise on how to debug this issue and found out what is wrong ?

PS. Developer Tools show the following:

Try:

{"find": "terms", "field":"dev_name.keyword"}

thanks @jangaraj for looking into it. unfortunately, no luck.

Unfortunately, “downgrade” is not an option “you cannot downgrade from 5.0 to previous versions.” (Release Notes v5.0.x)

Please provide details:

  • Grafana version
  • ES old/new version
  • ES index mapping old/new version
  • grafana version

    $ grafana-server -v
    Version 5.2.2 (commit: aeaf7b2)

  • elasticsearch version (NEW)
    {
    “name” : “ip-spotlight.elasticsearch.ixmac.nl-ams02c-ispcore03”,
    “cluster_name” : “ip-spotlight.elasticsearch.ixmac”,
    “cluster_uuid” : “QuzCs0Q3SP-mxjoj09OCoA”,
    “version” : {
    “number” : “6.4.0”,
    “build_flavor” : “default”,
    “build_type” : “rpm”,
    “build_hash” : “595516e”,
    “build_date” : “2018-08-17T23:18:47.308994Z”,
    “build_snapshot” : false,
    “lucene_version” : “7.4.0”,
    “minimum_wire_compatibility_version” : “5.6.0”,
    “minimum_index_compatibility_version” : “5.0.0”
    },
    “tagline” : “You Know, for Search”
    }

I had upgraded Grafana and was working with the old Elasticsearch instance (i do not remember the last before upgrade version of Elasticsearch but it should be 5.x or 6.x I had to migrate that quickly).

In order to make the fields searchable and aggregate-able, the mapping had to change like that:

Once again thanks @jangaraj and all for looking into it.

Try to use keyword type for dev_name field.

I think I found out what is wrong but do not know how to fix it.

the mapping
{
“mappings”: {

    "_default_": {
        "_all": { "enabled": false },
        "_source": { "enabled": true },
        "_routing": { "required": true },
        "dynamic": true,

        "properties": {
            "time_stamp": { "type": "date", "format": "epoch_second" },

In Kibana’s console with the GET _mapping command I see that

"time_stamp": {
        "type": "long"
      }

Could you please advise what I am doing wrong, and the time_stamp field does not recognized as a date field ?

Update your mapping: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html (use ES doc related to your ES version)