thclpr
thclpr

Reputation: 5938

Creating a chart from a integer field

I'm not sure how i can achieve this , but i have the following data imported to elasticsearch:

{
  "_index": "logstash-2014.09.18",
  "_type": "profiler",
  "_id": "Wp6zn3CSQ9qhdt8cfHxEgw",
  "_score": null,
  "_source": {
    "message": ["wm.server.query:getClusterError,2"],
    "@version": "1",
    "@timestamp": "2014-09-18T15:49:26.287Z",
    "type": "svc-profiler",
    "host": "pc.local",
    "path": "/Users/myuser/profiler.csv",
    "Service Name": "wm.server.query:getClusterError",
    "Call Count": "2"
  },
  "sort": [
    1411055366287,
    1411055366287
  ]
}

And i'm not sure how could i create a chart ( bar or pie ) using the call count field.

I'm sorry if i'm not clear, but english isn't my native language...

So, Anyone have any tip about how could i achieve create a chart using that field?

Thanks in advance.

Upvotes: 0

Views: 80

Answers (1)

Alcanzar
Alcanzar

Reputation: 17155

Your example record shows that it's in your ES cluster as a string. You need to load it as a number to be able to make charts against it. You'll need to use something like this in your logstash config to turn the field into a number:

filter { 
  mutate { 
    convert => { "Call Count" => "integer" } 
  }
}

Since you can't change an existing mapping, you'll need to reload your data to be able to do anything useful.

Once you do, you can just use a histogram panel with Call Count as the field and do either total or average on it.

Upvotes: 1

Related Questions