# Data is showing wrong when i add some nested fields

**URL:** <https://discuss.elastic.co/t/data-is-showing-wrong-when-i-add-some-nested-fields/263748>\
**Category:** Kibana\
**Created:** [February 9, 2021, 2:28pm UTC](https://discuss.elastic.co/t/data-is-showing-wrong-when-i-add-some-nested-fields/263748 "2021-02-09T14:28:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Alvarez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_alvarez/32/79117_2.png) [@Juan\_Alvarez](https://discuss.elastic.co/u/Juan_Alvarez)\
**Post date:** [February 9, 2021, 2:28pm UTC](https://discuss.elastic.co/t/data-is-showing-wrong-when-i-add-some-nested-fields/263748/1 "2021-02-09T14:28:15Z")

</div>

hello, i need help to visualiza the next json:

```
{ 
 "_index": "signaturetrace",
"_type": "_doc",
"_id": "pFVCUHcBaUOzInAquLbu",
"_version": 17,
"_score": null,
"_source": {
  "contractId": "baeb4e31-56a8-4b4e-32a3-08d85699ed01",
  "client": {
    "documentType": "CC",
    "documentNumber": "1545654654",
    "clientName": "JUAN ALVAREZ URIBE",
    "contractNumber": "3487191"
  },
  "sessions": [
    {
      "operations": [
        {
          "dateOperation": "2021-01-29T17:28:05.9983565",
          "traceOperation": "Ingresó al link"
        },
        {
          "dateOperation": "2021-01-29T17:28:49.9675683",
          "traceOperation": "Ingresó al paso de terminos y condiciones"
        },
        {
          "dateOperation": "2021-01-29T17:29:00.7984370",
          "traceOperation": "He leído y acepto la política de gestión de datos personales. - true"
        },
        {
          "dateOperation": "2021-01-29T17:29:02.3278159",
          "traceOperation": "He leído y acepto los términos y condiciones de firma electrónica. - true"
        },
        {
          "dateOperation": "2021-01-29T17:29:04.4420298",
          "traceOperation": "Ingresó al paso de visualización de documentos"
        },
        {
          "dateOperation": "2021-01-29T17:29:34.6691634",
          "traceOperation": "He leído el contrato y acepto las condiciones. - false"
        },
        {
          "dateOperation": "2021-01-29T17:29:40.0735090",
          "traceOperation": "He leído el pagaré y acepto las condiciones. - false"
        },
        {
          "dateOperation": "2021-01-29T17:29:49.4863372",
          "traceOperation": "Acepto Términos y condiciones de uso para la validación de identidad y mecanismo de Firma OTP. - true"
        },
        {
          "dateOperation": "2021-01-29T17:29:50.7576227",
          "traceOperation": "Acepto que procederé a firmar el contrato con la validación del OTP. - true"
        },
        {
          "dateOperation": "2021-01-29T17:29:51.7852959",
          "traceOperation": "Acepto que procederé a firmar el pagaré con la validación del OTP. - true"
        },
        {
          "dateOperation": "2021-01-29T17:29:56.8562255",
          "traceOperation": "Ingresó al paso de validación de identidad"
        },
        {
          "dateOperation": "2021-01-29T17:33:55.4688814",
          "traceOperation": "Tiempo total de la sesión: 5.838016666666666 minutos, Inicio: Fri Jan 29 2021 17:28:06 GMT-0500 (hora estándar de Colombia), Fin: Fri Jan 29 2021 17:33:56 GMT-0500 (hora estándar de Colombia)"
        },
        {
          "dateOperation": "2021-01-29T17:34:02.6970552",
          "traceOperation": "Ingresó al paso final de la firma"
        }
      ],
      "sessionIp": "IPADDRESS",
      "sessionId": "45a5e2a0-f06c-f243-30c4-3454e76f24da"
    },
    {
      "operations": [
        {
          "dateOperation": "2021-01-29T17:34:14.1832284",
          "traceOperation": "Ingresó al link"
        }
      ],
      "sessionIp": "IPADDRESS",
      "sessionId": "41d92c71-71cf-2186-948d-a96295ca53b8"
    },
    {
      "operations": [
        {
          "dateOperation": "2021-01-30T08:11:28.2056754",
          "traceOperation": "Ingresó al link"
        }
      ],
      "sessionIp": "IPADDRESS",
      "sessionId": "c8d801e3-7676-a997-fc5e-89c855d96465"
    }
  ]
},
"fields": {
  "sessions.operations.dateOperation": [
    "2021-01-29T17:28:05.998Z",
    "2021-01-29T17:28:49.967Z",
   "2021-01-29T17:29:00.798Z",
    "2021-01-29T17:29:02.327Z",
    "2021-01-29T17:29:04.442Z",
    "2021-01-29T17:29:34.669Z",
    "2021-01-29T17:29:40.073Z",
    "2021-01-29T17:29:49.486Z",
    "2021-01-29T17:29:50.757Z",
    "2021-01-29T17:29:51.785Z",
    "2021-01-29T17:29:56.856Z",
    "2021-01-29T17:33:55.468Z",
    "2021-01-29T17:34:02.697Z",
    "2021-01-29T17:34:14.183Z",
    "2021-01-30T08:11:28.205Z"
  ]
},
"highlight": {
  "client.documentNumber": [
    "@kibana-highlighted-field@1085308775@/kibana-highlighted-field@"
  ]
},
 "sort": [
   1611994288205
 ]
}

```

I need to visualize in Data Table every operations with the session Id filter by client document number, but when i filter, i cannot see all operations

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/f/1f73e07db99e2dbff17cf0f5bc02f8d4e3616388.png)

When i add more buckets to see the sessions, the data is wrong, because i only have 2 sessions an each only have 1 operation and other session with more operations.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/a/7a20d647055aa5cb1d939810d17405c95c80975a.png)

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [February 22, 2021, 2:30pm UTC](https://discuss.elastic.co/t/data-is-showing-wrong-when-i-add-some-nested-fields/263748/2 "2021-02-22T14:30:48Z")

</div>

What version of Elastic Stack is this?

Generally, most Kibana visualizations don't work with nested fields. An alternate way to do this is to create an index with documents in your `sessons` and `operations` fields, with those values, and then use aggregations and queries over that index in your visualizations.

---

<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:** [March 22, 2021, 2:31pm UTC](https://discuss.elastic.co/t/data-is-showing-wrong-when-i-add-some-nested-fields/263748/3 "2021-03-22T14:31:43Z")

</div>

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