# My first project ... beginner question

**URL:** <https://discuss.elastic.co/t/my-first-project-beginner-question/249000>\
**Category:** Elasticsearch\
**Created:** [September 17, 2020, 3:26pm UTC](https://discuss.elastic.co/t/my-first-project-beginner-question/249000 "2020-09-17T15:26:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leostereo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leostereo/32/74891_2.png) [@leostereo](https://discuss.elastic.co/u/leostereo)\
**Post date:** [September 17, 2020, 3:26pm UTC](https://discuss.elastic.co/t/my-first-project-beginner-question/249000/1 "2020-09-17T15:26:25Z")

</div>

Hi guys , here I am learning elk.

I managed to:  
1 Create an index.

```
PUT /dhcp_leases
{
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
    "properties": {
      "router": { "type": "text" },
      "current_leases": { "type": "integer" },
      "new_leases": { "type": "integer" }
    }
  }
}

```

2 Index some documents using api from external server.

```
POST /dhcp_leases/_doc/
{
  "router": "lujan",
  "current_leases": "2323",
  "new_leases": "2437"
}

```

I can view indexed docs doing:

```
GET dhcp_leases/_doc/ioOTnHQBgD6znyfFeQq9

GET dhcp_leases/_search
{
    "query": {
        "match_all": {}
    }
}

```

I have following questions:  
How can I set an autoincremental integer id (similar to sql) ?  
Why can not see anything at discovery section on kibana? should I add a date field ?  
I think the idea here is to filter by index ... this is what Ive tryed.

 ![elastic](https://us1.discourse-cdn.com/elastic/original/3X/b/1/b156296308dc0aa7a1602bbfb849192ceabc2eac.png)  
I would like to create a graph with those values on kibana ... im in the right way ?  
Regards.  
Leandro.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 17, 2020, 10:21pm UTC](https://discuss.elastic.co/t/my-first-project-beginner-question/249000/2 "2020-09-17T22:21:24Z")

</div>

We aren't all guys 🙂

> [@leostereo](#):
>
> How can I set an autoincremental integer id (similar to sql) ?

You would need to add that to the document yourself.

> [@leostereo](#):
>
> Why can not see anything at discovery section on kibana? should I add a date field ?

If you look at the left of the screen, you can see that your index pattern is `filebeat-*`, you will need to add a new pattern that points to your `dhcp_leases` index.  
It would probably also be worth adding a timestamp to the data.

---

<div class="post-metadata">

**Author:** ![gabriel\_tessier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_tessier/32/27911_2.png) [@gabriel\_tessier](https://discuss.elastic.co/u/gabriel_tessier)\
**Post date:** [September 18, 2020, 12:58am UTC](https://discuss.elastic.co/t/my-first-project-beginner-question/249000/3 "2020-09-18T00:58:31Z")

</div>

Hi @leostereo

> [@leostereo](#):
>
> How can I set an autoincremental integer id (similar to sql) ?

One solution quite old (and I use because I am old 👴 ) is using the \_version.

All the details and are in this blog:

[http://blogs.perl.org/users/clinton\_gormley/2011/10/elasticsearchsequence---a-blazing-fast-ticket-server.html](http://blogs.perl.org/users/clinton_gormley/2011/10/elasticsearchsequence---a-blazing-fast-ticket-server.html)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 18, 2020, 1:00am UTC](https://discuss.elastic.co/t/my-first-project-beginner-question/249000/4 "2020-09-18T01:00:26Z")

</div>

That really only applies if you are updating the existing documents.

---

<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:** [October 16, 2020, 1:00am UTC](https://discuss.elastic.co/t/my-first-project-beginner-question/249000/5 "2020-10-16T01:00:29Z")

</div>

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