# Metricbeat 7.17.20 cannot index logstash metrics into Elasticsearch

**URL:** https://discuss.elastic.co/t/metricbeat-7-17-20-cannot-index-logstash-metrics-into-elasticsearch/358275
**Category:** Beats
**Tags:** docker, metricbeat
**Created:** [April 26, 2024, 8:12am UTC](https://discuss.elastic.co/t/metricbeat-7-17-20-cannot-index-logstash-metrics-into-elasticsearch/358275 "2024-04-26T08:12:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gergelyzsamboki-seon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gergelyzsamboki-seon/32/126106_2.png) [@gergelyzsamboki-seon](https://discuss.elastic.co/u/gergelyzsamboki-seon)
#### Post date: [April 26, 2024, 8:12am UTC](https://discuss.elastic.co/t/metricbeat-7-17-20-cannot-index-logstash-metrics-into-elasticsearch/358275/1 "2024-04-26T08:12:41Z")

</div>

i'm using metricbeat to monitor logstash (also 7.17.20). both are running in docker.  
Metricbeat is logging the following error:  
`mapper [logstash_stats.pipelines.events.duration_in_millis] cannot be changed from type [float] to [long]`

Metricbeat configuration:

```auto
metricbeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
processors:
  - add_cloud_metadata: ~
  - add_docker_metadata: ~

output.elasticsearch:
  hosts: https://es-log.domain.internal:9200
  username: logstash-log
  password: ...

name: ls-dev-log-0-i-0182be70eacab9ae8.euw1
monitoring:
  cluster_uuid: ...
  enabled: true
logging.level: debug

```

Module config:

```auto
- module: logstash
  enabled: true
  xpack.enabled: true
  period: 10s
  hosts: ["http://logstash:9600"]

```

The data:

```auto
2024-04-25T15:28:56.979Z DEBUG [processors] processing/processors.go:203 Publish event: {                                                                                                                                                                                  
  "@timestamp": "2024-04-25T15:28:56.912Z",                                                                                                                                                                                                                                               
  "@metadata": {                                                                                                                                                                                                                                                                          
    "beat": "metricbeat",                                                                                                                                                                                                                                                                 
    "type": "_doc",                                                                                                                                                                                                                                                                       
    "version": "7.17.20",                                                                                                                                                                                                                                                                 
    "index": ".monitoring-logstash-7-mb"                                                                                                                                                                                                                                                  
  },                                                                                                                                                                                                                                                                                      
  "interval_ms": 10000,                                                                                                                                                                                                                                                                   
  "logstash_stats": {                                                                                                                                                                                                                                                                     
    "events": {                                                                                                                                                                                                                                                                           
      "duration_in_millis": 4.7338102e+07,                                                                                                                                                                                                                                                
      "in": 4.4495605e+07,                                                                                                                                                                                                                                                                
      "filtered": 4.4495605e+07,                                                                                                                                                                                                                                                          
      "out": 4.3300184e+07                                                                                                                                                                                                                                                                
    },                           

```

why are the numbers in floating point format? is there a way to turn that off?

---

<div class="post-metadata">

### Author: ![gergelyzsamboki-seon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gergelyzsamboki-seon/32/126106_2.png) [@gergelyzsamboki-seon](https://discuss.elastic.co/u/gergelyzsamboki-seon)
#### Post date: [April 26, 2024, 2:51pm UTC](https://discuss.elastic.co/t/metricbeat-7-17-20-cannot-index-logstash-metrics-into-elasticsearch/358275/2 "2024-04-26T14:51:07Z")

</div>

it turned out the issue was in the elasticsearch template. we have a default index template which unfortunately overlaped the default monitoring templates.  
`index template [default-logs] has index patterns [*logs*] matching patterns from existing older templates [.monitoring-logstash,.monitoring-es,logstash,ecs-logstash,.monitoring-beats,.items-default,.lists-default,.monitoring-kibana] with patterns (.monitoring-logstash => [.monitoring-logstash-7-*],.monitoring-es => [.monitoring-es-7-*],logstash => [logstash-*],ecs-logstash => [ecs-logstash-*],.monitoring-beats => [.monitoring-beats-7-*],.items-default => [.items-default-*],.lists-default => [.lists-default-*],.monitoring-kibana => [.monitoring-kibana-7-*]); this template [default-logs] will take precedence during new index creation`  
changing the pattern on our template fixed the issue
