# Import data vs. Manage index / index pattern

**URL:** <https://discuss.elastic.co/t/import-data-vs-manage-index-index-pattern/204245>\
**Category:** Logstash\
**Created:** [October 18, 2019, 3:10pm UTC](https://discuss.elastic.co/t/import-data-vs-manage-index-index-pattern/204245 "2019-10-18T15:10:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre.Bernier](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Alexandre.Bernier](https://discuss.elastic.co/u/Alexandre.Bernier)\
**Post date:** [October 18, 2019, 3:10pm UTC](https://discuss.elastic.co/t/import-data-vs-manage-index-index-pattern/204245/1 "2019-10-18T15:10:29Z")

</div>

Hi,

I don't know if I'm in the good section of the forum and I'm sorry about that but I need help to setup my import pattern.

We actually import data daily at 6 AM using Logstash (7.3) into Elasticsearch (7.4) in the index "ls-X" with the settings "action =\> update" and "doc\_as\_upsert =\> true".

So, each day, I'm updating the data in "ls-X" but I never have the same amount of documents.

For example, the first day, I import 100 documents. The next day, I import 125 documents (100 documents updated + 25 documents added). Finally, I import 75 documents.

So I have 75 documents updated and 50 documents that I would like to delete automatically.

How can I achieve this? Is there a way to delete data using Logstash?

I tried to create an index named "ls-X-%{+YYYY.MM.dd}". This way, I'm able to insert all the documents in a new index each day so I don't need to delete the documents.

But I don't know how to use the last day only in my index pattern in Kibana (7.4)? Is there a way to name the index pattern to be dynamic (like the index)?

Thanks,  
Alexandre

---

<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:** [November 15, 2019, 3:10pm UTC](https://discuss.elastic.co/t/import-data-vs-manage-index-index-pattern/204245/2 "2019-11-15T15:10:31Z")

</div>

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