# Awsfargate metricbeat module not working?

**URL:** https://discuss.elastic.co/t/awsfargate-metricbeat-module-not-working/307990
**Category:** Beats
**Tags:** metricbeat
**Created:** [June 23, 2022, 10:24am UTC](https://discuss.elastic.co/t/awsfargate-metricbeat-module-not-working/307990 "2022-06-23T10:24:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)
#### Post date: [June 23, 2022, 10:24am UTC](https://discuss.elastic.co/t/awsfargate-metricbeat-module-not-working/307990/1 "2022-06-23T10:24:46Z")

</div>

I've declared a metricbeat container in an AWS ECS task definition so that it runs as a "sidecar" container to my main application and uses the `awsfargate` module to index task stats (CPU, memory etc) into my monitoring cluster.

This is the command I'm using:

```auto
    "command": [
      "./metricbeat setup -E setup.kibana.host=\"${MONITORING_SERVER_KIBANA}\" -E output.elasticsearch.hosts=[\"${MONITORING_SERVER}\"] -E logging.level=\"debug\" && ./metricbeat modules enable awsfargate && ./metricbeat"
    ],

```

The `MONITORING_SERVER_KIBANA` and MONITORING\_SERVER values are injected into the environment from AWS Secrets Manager.

These are the only logs from the metricbeat container:

```auto
Overwriting ILM policy is disabled. Set `setup.ilm.overwrite: true` for enabling.
Index setup finished.
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards
Enabled awsfargate

```

It appears to be running with no errors, but I'm not getting any data at all into my monitoring cluster under any `metricbeat-*` indexes.

I've tried enabling debug logging by adding: `-d "*"` to the end of the command, but that just doesn't work.

I'm using version `7.12.0`.

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)
#### Post date: [June 23, 2022, 1:59pm UTC](https://discuss.elastic.co/t/awsfargate-metricbeat-module-not-working/307990/2 "2022-06-23T13:59:20Z")

</div>

The issue was the command, in the end. Whilst I was passing the `output.elasticsearch.hosts` parameter to the metricbeat setup, I wasn't passing it when actually running metricbeat. The command should, therefore, have been:

```auto
"./metricbeat setup -E setup.kibana.host=\"${MONITORING_SERVER_KIBANA}\" -E output.elasticsearch.hosts=[\"${MONITORING_SERVER}\"] && ./metricbeat modules enable awsfargate && ./metricbeat -e -E output.elasticsearch.hosts=[\"${MONITORING_SERVER}\"] "

```

Note: the `-e` is required to direct logging output to stdout, otherwise it goes to syslog.

---

<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: [July 21, 2022, 3:59pm UTC](https://discuss.elastic.co/t/awsfargate-metricbeat-module-not-working/307990/3 "2022-07-21T15:59:54Z")

</div>

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