# Want to create monitoring indices for only 7 days

**URL:** https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605
**Category:** Metrics
**Created:** [September 22, 2023, 8:09am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605 "2023-09-22T08:09:59Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Rakhshunda\_Noorein\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakhshunda_noorein_j/32/99407_2.png) [@Rakhshunda\_Noorein\_J](https://discuss.elastic.co/u/Rakhshunda_Noorein_J)
#### Post date: [September 22, 2023, 8:09am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/1 "2023-09-22T08:09:59Z")

</div>

Hello,

I am monitoring my logstash instance through metricbeat monitoring.  
I want to configure monitoring setting as such that only 7 days monitoring indices is created in my cluster in order to monitor for only 7 days and not more..

Also Is there a way that only 1 logstash monitoring index is created once a week or month?? I dont dont want daily creation of monitoring index.

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [September 22, 2023, 10:32am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/2 "2023-09-22T10:32:59Z")

</div>

Hi @Rakhshunda_Noorein_J,

I think you would want to have a look at setting up ILM to manage the index rollover. You would still be able to use logstash to push to the stream:

> **[ILM: Manage the index lifecycle | Elasticsearch Guide \[8.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html)**

---

<div class="post-metadata">

### Author: ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)
#### Post date: [September 22, 2023, 11:08am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/3 "2023-09-22T11:08:57Z")

</div>

Hello @Rakhshunda_Noorein_J ,

Not sure which version of ELK you're using, 8.X vesrion bydefault creates monitoring indices for beats,logstash..etc.  
I would like to know about your way to send data through metricbeat to monitor logstash and beats stats, alternatively can check in datastream.  
This data streams monitoring indices are governed by default ILM policy, you can alter them as per your requirement under policy.

Index Management-\>Data stream-\>Monitoring indices.

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

---

<div class="post-metadata">

### Author: ![Rakhshunda\_Noorein\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakhshunda_noorein_j/32/99407_2.png) [@Rakhshunda\_Noorein\_J](https://discuss.elastic.co/u/Rakhshunda_Noorein_J)
#### Post date: [September 22, 2023, 11:24am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/4 "2023-09-22T11:24:16Z")

</div>

I am using version 8.4.3, but my monitoring index creating is .monitoring-es-7-2023.09.22, .monitoring-kibana-7-2023.09.22, .monitoring-logstash-7-2023.09.22, .monitoring-beat-7-2023.09.22... They are using legacy index template(i.e. .monitoring-es, .monitoring-kibana, .monitoring-logstash) and not .monitoring-logstash-mb, .monitoring-es-mb, .monitoring-kibana-mb.

---

<div class="post-metadata">

### Author: ![Rakhshunda\_Noorein\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakhshunda_noorein_j/32/99407_2.png) [@Rakhshunda\_Noorein\_J](https://discuss.elastic.co/u/Rakhshunda_Noorein_J)
#### Post date: [September 22, 2023, 11:29am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/5 "2023-09-22T11:29:44Z")

</div>

> [@Rakhshunda\_Noorein\_J](#):
>
> .monitoring-es-7-2023.09.22,

now I have seen both of the indices are generating,

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/c/4ccfd6d21d7c9c22c72f0da653f3883c3201e5df.png)

## .ds-.monitoring-logstash-8-mb - this type of indices are hidden indices and

## .monitoring-es-7-2023.09.22 - this type of indices are not hidden..

---

<div class="post-metadata">

### Author: ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)
#### Post date: [September 22, 2023, 11:52am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/6 "2023-09-22T11:52:51Z")

</div>

Ok, are you using xpack settings? , in your elasticsearch,kibana, beats and logsstash YML settings are you using xpack.monitoring.enabled: true setting?  
Also do let know your yml settings and if your are using metricbeats to monitor then have you enable beats.yml,logstash.yml under modules. d folder? please share the settings used for monitoring.

---

<div class="post-metadata">

### Author: ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)
#### Post date: [September 22, 2023, 11:53am UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/7 "2023-09-22T11:53:36Z")

</div>

Ok, nice.So its done, do share your solution for community reference.

---

<div class="post-metadata">

### Author: ![Rakhshunda\_Noorein\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakhshunda_noorein_j/32/99407_2.png) [@Rakhshunda\_Noorein\_J](https://discuss.elastic.co/u/Rakhshunda_Noorein_J)
#### Post date: [September 22, 2023, 12:08pm UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/8 "2023-09-22T12:08:50Z")

</div>

my elasticsearch cluster and kibana cluster are self monitored, and logstash cluster is metricbeat monitored.

Yes I have enabled logstash.yml under modules. d folder. And It is monitoring properly.

logstash-xpack.yml

```auto
- module: logstash
  xpack.enabled: true
  period: 10s
  hosts: ["localhost:9600"]
  username: ""
  password: ""

```

---

<div class="post-metadata">

### Author: ![Rakhshunda\_Noorein\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakhshunda_noorein_j/32/99407_2.png) [@Rakhshunda\_Noorein\_J](https://discuss.elastic.co/u/Rakhshunda_Noorein_J)
#### Post date: [September 22, 2023, 12:22pm UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/9 "2023-09-22T12:22:42Z")

</div>

my monitoring indices that is generating is for elasticsearch kibana and beat that is self monitored is as

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

where no ILM is attached

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

but for logstash indices generating is as

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

where ILM is attached.

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

```auto
**How do I Delete indices where ILM is not attached?? I have created an ILM for 3 days default policy, but it is giving ILM error as it is asking for an alias.**

```

---

<div class="post-metadata">

### Author: ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)
#### Post date: [September 22, 2023, 2:23pm UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/10 "2023-09-22T14:23:18Z")

</div>

> **[Configuring data streams created by Metricbeat 8 | Elasticsearch Guide \[8.8\]...](https://www.elastic.co/guide/en/elasticsearch/reference/8.8/config-monitoring-data-streams-metricbeat-8.html)**

This might help you ,here you can controll through templates, also for monitoring have you checked default reference files ex logsatsh.yml. There you will get more info. metricbeat.yml,logstash.yml settings need to look to see wht exactly you're doing for monitoring config. Above link would help you understand.

---

<div class="post-metadata">

### Author: ![Andrew\_Mora](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_mora/32/125622_2.png) [@Andrew\_Mora](https://discuss.elastic.co/u/Andrew_Mora)
#### Post date: [September 22, 2023, 5:08pm UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/11 "2023-09-22T17:08:53Z")

</div>

> [@Rakhshunda\_Noorein\_J](#):
>
> Hello,
> 
> I am monitoring my logstash instance through metricbeat monitoring.  
> I want to configure monitoring setting as such that only 7 days monitoring indices is created in my cluster in order to monitor for only 7 days and not more..
> 
> Also Is there a way that only 1 logstash monitoring index is created once a week or month?? I dont dont want daily creation of monitoring index.

Hello,

To achieve your monitoring goals, you can configure Logstash's monitoring settings in your Elasticsearch cluster. To keep monitoring indices for only 7 days, set the index lifecycle management (ILM) policy accordingly. Additionally, you can use ILM to control the frequency of Logstash monitoring index creation, such as creating a new one weekly or monthly, ensuring that only one index is active at a time, rather than daily creations. This will help you manage your monitoring data efficiently.

---

<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 20, 2023, 5:09pm UTC](https://discuss.elastic.co/t/want-to-create-monitoring-indices-for-only-7-days/343605/12 "2023-10-20T17:09:39Z")

</div>

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