# Records created by elasticsearch api can not show up in Kibana

**URL:** <https://discuss.elastic.co/t/records-created-by-elasticsearch-api-can-not-show-up-in-kibana/108265>\
**Category:** Kibana\
**Created:** [November 19, 2017, 4:40am UTC](https://discuss.elastic.co/t/records-created-by-elasticsearch-api-can-not-show-up-in-kibana/108265 "2017-11-19T04:40:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harim\_Tong](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@Harim\_Tong](https://discuss.elastic.co/u/Harim_Tong)\
**Post date:** [November 19, 2017, 4:40am UTC](https://discuss.elastic.co/t/records-created-by-elasticsearch-api-can-not-show-up-in-kibana/108265/1 "2017-11-19T04:40:51Z")

</div>

step1: use API to create the record:  
POST [http://localhost:9200/twitter/tweet/34/\_update](http://localhost:9200/twitter/tweet/34/_update)

```
{
    "scripted_upsert":true,
    "script" : {
        "source": "ctx._source.name = params.name;",
        "lang": "painless",
        "params" : {
        	"name": "John"
        }
    }	,
    "upsert" : {
    
    }
}

```

and get the response as below:

```
{
    "_index": "twitter",
    "_type": "tweet",
    "_id": "34",
    "_version": 1,
    "result": "created",
    "_shards": {
        "total": 2,
        "successful": 1,
        "failed": 0
    }
}

```

step2:use get api can get this record（GET [http://localhost:9200/twitter/tweet/34）:](http://localhost:9200/twitter/tweet/34%EF%BC%89:)

```
{
    "_index": "twitter",
    "_type": "tweet",
    "_id": "34",
    "_version": 1,
    "found": true,
    "_source": {
        "name": "John"
    }
}

```

step3: go to kibana dashboard to create the index pattern："twitter" in "Management" tab,

step4: go to "Discover" tab and select the index "twitter" created in step3, but I can not see this record under the index:"twitter".

Elasticsearch/kibana version:5.6.3

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 19, 2017, 6:54am UTC](https://discuss.elastic.co/t/records-created-by-elasticsearch-api-can-not-show-up-in-kibana/108265/2 "2017-11-19T06:54:11Z")

</div>

Question moved to #kibana

Just a comment. You don’t need to use a painless script like you did just to create a document.

Step3: May be share some screenshots about what does the index look like?  
Same for Step4.

---

<div class="post-metadata">

**Author:** ![Harim\_Tong](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@Harim\_Tong](https://discuss.elastic.co/u/Harim_Tong)\
**Post date:** [November 19, 2017, 11:03am UTC](https://discuss.elastic.co/t/records-created-by-elasticsearch-api-can-not-show-up-in-kibana/108265/3 "2017-11-19T11:03:31Z")

</div>

step3 & step4 's screenshots as below 2 pictures:

 ![step3](https://us1.discourse-cdn.com/elastic/original/3X/1/f/1fcf3ba6fcd73b6df1ee3c99631cf041b4a7c6c2.png) ![step4](https://us1.discourse-cdn.com/elastic/original/3X/8/0/807836385c68a272c9cf60725e90f27b6d049403.png)

There is no '@timestamp' in this record under this index,is that the problem?  
I have tried to add '@timestamp' field for the index using:'PUT [http://localhost:9200/twitter/](http://localhost:9200/twitter/)'

```
          {
    "settings": {
        "number_of_shards": 1
    },
    "mappings": {
        "tweet": {
            "properties": {
                "@timestamp": {
                    "format": "strict_date_optional_time||epoch_millis",
                    "type": "date"
                }
            }
        }
    }
}

```

but the '@timestamp' not created after the document generated.

---

<div class="post-metadata">

**Author:** ![Harim\_Tong](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@Harim\_Tong](https://discuss.elastic.co/u/Harim_Tong)\
**Post date:** [November 20, 2017, 5:17am UTC](https://discuss.elastic.co/t/records-created-by-elasticsearch-api-can-not-show-up-in-kibana/108265/4 "2017-11-20T05:17:03Z")

</div>

I add the ' **@timestamp**' field then the record shows up in kibana.

```
{
    "scripted_upsert":true,
    "script" : {
        "source": "ctx._source.name = params.name;ctx._source['@timestamp']=params.timestamp",
        "lang": "painless",
        "params" : {
        	"name": "John",
        	"timestamp":"2017-11-20T13:05:23.160Z"
        }
    }	,
    "upsert" : {
    
    }
}
```

---

<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:** [December 18, 2017, 5:18am UTC](https://discuss.elastic.co/t/records-created-by-elasticsearch-api-can-not-show-up-in-kibana/108265/5 "2017-12-18T05:18:14Z")

</div>

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