# Fiels does not contain any data after loading data using bulk

**URL:** <https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510>\
**Category:** Elasticsearch\
**Created:** [August 20, 2022, 1:30am UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510 "2022-08-20T01:30:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SofiaContreras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sofiacontreras/32/97487_2.png) [@SofiaContreras](https://discuss.elastic.co/u/SofiaContreras)\
**Post date:** [August 20, 2022, 1:30am UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510/1 "2022-08-20T01:30:11Z")

</div>

I'm trying to make some visualizations using kibana, but the fields have any data.

I thought that if I fill up an index in dev ops using bulk, then I would be able to interact with the data using kibana. Here is the code I ran in dev ops:

```auto
PUT /log_consultas
{
  "mappings": {
    "properties": {
      "@timestamp" : {"type": "date"},
      "estado_consulta": { "type": "keyword" },
      "servicio" : {"type": "keyword"}, 
      "administrador": {"type": "keyword"}, 
      "consultas_realizadas": {"type": "integer"}
    }
  }
}

PUT _index_template/template_1
{
  "index_patterns": ["log_consultas*"],
  "template": {
    "mappings": {
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "administrador": {
          "type": "text"
        },
        "consultas_realizadas": {
          "type": "integer"
        },
        "estado_consulta": {
          "type": "text"
        },
        "servicio": {
          "type": "text"
        }
      }
    }
  
  }
}

POST /log_consultas/_bulk
{"index":{"_index":"log_consultas","_id":1}}
{"@timestamp":"2010-05-15T22:00:54","estado_consulta":"consumo","servicio":"consulta","administrador":"Juan Carlos","consultas_realizadas":52}
{"index":{"_index":"log_consultas","_id":2}}
{"@timestamp":"2010-05-15T12:55:04","estado_consulta":"consumo","servicio":"modificacion","administrador":"Juan Lara","consultas_realizadas":10}
{"index":{"_index":"log_consultas","_id":3}}
{"@timestamp":"2010-05-15T14:56:48","estado_consulta":"consumo","servicio":"consulta","administrador":"Juan Lara","consultas_realizadas":20}

```

.... and so on

After this I created a new Data View call log\_consultas

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/9/39f23ed326f56d7c32334bb96420266bcf74a2a5.png)

but then when I try to create visualizations in the dashboard this comes up

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

Can anyone help me? What I'm missing? Any suggestions would be great!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 20, 2022, 5:06am UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510/2 "2022-08-20T05:06:46Z")

</div>

I have a few comments:

- You mapped some of the fields as `text`. This implies they will be analysed, which is generally not suitable if you want to build visualisations based on them in Kibana. Instead map them as `keyword`. See [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/keyword.html) for more information. If you are new to. Elasticsearch and don't know about mappings I would recommend using the default ones (not explicitly specifying index template or mappings).
- The timestamp in your documents is in 2010. Note that this is far outside the default time window Kibana uses. See the top right corner. I would modify the data to have current timestamps as that will make it easier to work with.

---

<div class="post-metadata">

**Author:** ![SofiaContreras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sofiacontreras/32/97487_2.png) [@SofiaContreras](https://discuss.elastic.co/u/SofiaContreras)\
**Post date:** [August 20, 2022, 4:38pm UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510/4 "2022-08-20T16:38:02Z")

</div>

Thank you for the comments, Christian!

I've changed the fields from text to keyword. But I keep getting the same problem, I don't know how my index hasn't been filled with data after I executed the bulk command. Or is there another way to visualize that json data?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 20, 2022, 4:40pm UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510/5 "2022-08-20T16:40:38Z")

</div>

Use the [cat indices API](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/cat-indices.html) to see if the index was created and does contain data.

---

<div class="post-metadata">

**Author:** ![SofiaContreras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sofiacontreras/32/97487_2.png) [@SofiaContreras](https://discuss.elastic.co/u/SofiaContreras)\
**Post date:** [August 20, 2022, 6:00pm UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510/6 "2022-08-20T18:00:37Z")

</div>

It returns:  
`green open log_consultas ITm9Q48SR8OqI8BImGmsLw 1 1 299 0 40.2kb 20.1kb`

I understand that it means that `log_consultas` has some data.  
Also, I've been using the SEARCH method with `log_consultas` just fine. I don't get why kibana tells me that there is any data.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 20, 2022, 6:14pm UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510/7 "2022-08-20T18:14:44Z")

</div>

Did you check the date interval covers the data you indexed?

---

<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 17, 2022, 6:15pm UTC](https://discuss.elastic.co/t/fiels-does-not-contain-any-data-after-loading-data-using-bulk/312510/8 "2022-09-17T18:15:36Z")

</div>

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