# Split series by object keys

**URL:** <https://discuss.elastic.co/t/split-series-by-object-keys/244941>\
**Category:** Kibana\
**Created:** [August 13, 2020, 8:09pm UTC](https://discuss.elastic.co/t/split-series-by-object-keys/244941 "2020-08-13T20:09:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_Stehle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastian_stehle/32/73851_2.png) [@Sebastian\_Stehle](https://discuss.elastic.co/u/Sebastian_Stehle)\
**Post date:** [August 13, 2020, 8:09pm UTC](https://discuss.elastic.co/t/split-series-by-object-keys/244941/1 "2020-08-13T20:09:06Z")

</div>

Hello,

I do not use kibana that often, therefore sorry in advance for me stupid question.

I am analyzing logs from an application. These logs sometimes contains profiler information, structure like this.

```auto
{
    "logLevel": "Information",
    "profiler": {
      "MethodA": {
        "elapsedMsAvg": 1183,
        "count": 1,
        "elapsedMsTotal": 1183
      },
      "MethodB": {
        "elapsedMsAvg": 1183,
        "count": 1,
        "elapsedMsTotal": 1183
      }
    }

```

is it possible to create a line chart based on the keys / method names?

Right now I have created the different series manually, but it is a boring task and you can easily forget a method.

If not, can I provide the output in a different format?

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [August 18, 2020, 8:38am UTC](https://discuss.elastic.co/t/split-series-by-object-keys/244941/2 "2020-08-18T08:38:33Z")

</div>

Hey, to do so, you would have to split up your documents like this:

```auto
{
    "logLevel": "Information",
    "profiler": {
      "methodName: "MethodA",
      "elapsedMsAvg": 1183,
      "count": 1,
      "elapsedMsTotal": 1183
    }
},
{
    "logLevel": "Information",
    "profiler": {
      "methodName: "MethodB",
      "elapsedMsAvg": 1183,
      "count": 1,
      "elapsedMsTotal": 1183
    }
}

```

Then you can use a terms aggregation on `profiler.methodName` to split the series without worrying to forget a 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:** [September 15, 2020, 8:38am UTC](https://discuss.elastic.co/t/split-series-by-object-keys/244941/3 "2020-09-15T08:38:33Z")

</div>

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