# How to graph automatically those data

**URL:** <https://discuss.elastic.co/t/how-to-graph-automatically-those-data/78477>\
**Category:** Kibana\
**Created:** [March 14, 2017, 9:17am UTC](https://discuss.elastic.co/t/how-to-graph-automatically-those-data/78477 "2017-03-14T09:17:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![florentmair](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@florentmair](https://discuss.elastic.co/u/florentmair)\
**Post date:** [March 14, 2017, 9:17am UTC](https://discuss.elastic.co/t/how-to-graph-automatically-those-data/78477/1 "2017-03-14T09:17:12Z")

</div>

Hi everyone,

I need some advices to graph some data.  
Every day at 10:30pm i have an audit of our docbase, the results is the number of documents by type, by format, ...

Those data are stored into ES like that :

```
{
  "_index": "logstash-dmt",
  "_type": "stateofdocbase",
  "_id": "AVrJTMRHPMa1Ahhz2UYM",
  "_score": null,
  "_source": {
    "IndexName": "logstash-dmt",
    "@timestamp": "2017-03-12T21:30:02.000Z",
    "NB_DOCUMENTS_BY_FORMAT": {
      "bmp": "1",
      "csv": "661",
      "msw6template": "10",
      "java": "4",
      "excel12bbook": "34",
      "excel12mebook": "1361",
      "PDF_StampTest": "4",
      "text": "12232",
      "excel5book": "8",
      "powerpoint": "2",
      "zip": "22678",
      "excel12book": "3798",
      "ppt8_template": "41",
      "ppt12": "3976",
      "excel8book": "821179",
      "ppt8": "26006",
      "pdf": "427521"
    },
    "@version": "1",
    "host": "XXX",
    "IndexRotation": "none",
    "type": "stateofdocbase",
    "IndexType": "dmt",
    "tags": [
      "multiline"
    ]
  },
  "fields": {
    "@timestamp": [
      1489354202000
    ]
  },
  "sort": [
    1489354202000
  ]
} 

```

is it possible to make a chart with all "NB\_DOCUMENTS\_BY\_FORMAT.\*" like a Pie chart.

Thanks

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [March 14, 2017, 1:00pm UTC](https://discuss.elastic.co/t/how-to-graph-automatically-those-data/78477/2 "2017-03-14T13:00:02Z")

</div>

Kibana charts are generated by performing aggregations on documents in Elasticsearch. Using your example, this means that there would need to be an Elasticsearch document for each `NB_DOCUMENTS_BY_FORMAT.*` format, so something like this (3 example documents shown):

Document #1:

```
{
  "format": "bmp",
  "count": 1
}

```

Document #2:

```
{
  "format": "csv",
  "count": 661
}

```

Document #3:

```
{
  "format": "msw6template",
  "count": 10
}

```

Then you could create a pie chart showing the various formats and their total counts like this:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/d/dd3da28b5d4020b49379722795b2d484990ddbe9.png)

---

<div class="post-metadata">

**Author:** ![florentmair](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@florentmair](https://discuss.elastic.co/u/florentmair)\
**Post date:** [March 14, 2017, 2:04pm UTC](https://discuss.elastic.co/t/how-to-graph-automatically-those-data/78477/3 "2017-03-14T14:04:07Z")

</div>

Thanks for your response, it seems i need to change my method to integrate values into ES.  
I have already asked for a solution here [Need advices to ingest this type of data](https://discuss.elastic.co/t/multiline-need-advices/76636)

maybe you will have an idea to improve my method

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 11, 2017, 2:04pm UTC](https://discuss.elastic.co/t/how-to-graph-automatically-those-data/78477/4 "2017-04-11T14:04:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
