Hi All,

I've been trying to graph data obtains from a "SHOW STATUS" mysql query. 
When attempting to graph "Threads_connected" using Kibana is received the 
following error...

Oops! 
ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData
 
cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData] 


I checked my mappings and the "Value" field has been added to elasticsearch 
as a string even though it only ever contains integer counts. I don;t 
really want to re-dump my data and change mappings so I've managed to fix 
the query using dynamic scripting like so...

curl -XGET 'http://hostname:9200/_all/_search?pretty' -d '{
  "facets": {
    "0": {
      "date_histogram": {
        "key_field": "@timestamp",
        "value": "doc['Value'].Intvalue",
        "interval": "5m"
      },
      "global": true,
      "facet_filter": {
        "fquery": {
          "query": {
            "filtered": {
              "query": {
                "query_string": {
                  "query": "source:mysql_status AND 
Variable_name:Threads_connected"
                }
              },
              "filter": {
                "bool": {
                  "must": [
                    {
                      "range": {
                        "@timestamp": {
                          "from": 1411520355984,
                          "to": 1411563555984
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "size": 0

I have simply changed..

"value": "Value",

to...

"value": "doc['Value'].Intvalue",

This query returns what I want but I am unable to get this into Kibana 
without it throwing some kind of error. So my question would be... how do I 
get my historgram to use data from the above query?

Rhys




-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/77748482-1a0c-4b92-89bf-368fd635c252%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to