# Error fetching data for metricset windows.service: The data is invalid

**URL:** <https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079>\
**Category:** Beats\
**Tags:** windows, metricbeat\
**Created:** [March 4, 2020, 1:06pm UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079 "2020-03-04T13:06:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrianbumbas](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@adrianbumbas](https://discuss.elastic.co/u/adrianbumbas)\
**Post date:** [March 4, 2020, 1:06pm UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079/1 "2020-03-04T13:06:46Z")

</div>

Hello

I'm trying to get Windows metrics using Metricbeat 7.6.0 and all I get in the logs is this message:

```
Error fetching data for metricset windows.service: The data is invalid.

```

The user under which I'm running Metricbeat is a local administrator and I can manage services without issu, the OS is Windows Server 2012 R2 Standard.  
The metricbeat.yml config looks like this:

```
- module: windows
  metricsets:
  - service
  period: 1m

```

Here is the full JSON message send by Metricbeat:

```
{
"@timestamp": "2020-03-04T12:51:50.868Z",
"@metadata": {
  "beat": "metricbeat",
"type": "_doc",
"version": "7.6.0"
},
"agent": {
"id": "8a19eb30-924a-477a-bc09-69092dcad8c2",
"version": "7.6.0",
"type": "metricbeat",
"ephemeral_id": "74e6de13-aafa-49f3-8084-3f0d45f1f309",
"hostname": "x"
},
"event": {
"dataset": "windows.service",
"module": "windows",
"duration": 17997900
},
"metricset": {
"period": 60000,
"name": "service"
},
"service": {
"type": "windows"
},
"error": {
"message": "The data is invalid."
},
"ecs": {
"version": "1.4.0"
},
"host": {
"id": "ce499e1c-7cc3-4bd9-a800-938fccb31cb8",
"name": "x",
"hostname": "x",
"architecture": "x86_64",
"os": {
  "platform": "windows",
  "version": "6.3",
  "family": "windows",
  "name": "Windows Server 2012 R2 Standard",
  "kernel": "6.3.9600.19629 (winblue_ltsb_escrow.200127-1700)",
  "build": "9600.19629"
}
}
}

```

What could be the issue?

Thanks

---

<div class="post-metadata">

**Author:** ![MarianaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marianad/32/42687_2.png) [@MarianaD](https://discuss.elastic.co/u/MarianaD)\
**Post date:** [March 18, 2020, 11:25am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079/2 "2020-03-18T11:25:12Z")

</div>

hi @adrianbumbas , I am not able to reproduce this scenario on the same OS at the moment. Can you enable debug logging and let us know if more information is found there, also can you check in the Event Viewer if this error is logged there as well.  
The error message is most likely coming from the win api [https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-enumservicesstatusexw](https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-enumservicesstatusexw) we use to retrieve the metric values.

---

<div class="post-metadata">

**Author:** ![adrianbumbas](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@adrianbumbas](https://discuss.elastic.co/u/adrianbumbas)\
**Post date:** [March 18, 2020, 11:35am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079/3 "2020-03-18T11:35:43Z")

</div>

Hi @MarianaD. To enable debug output which is the selector i need to use?

---

<div class="post-metadata">

**Author:** ![MarianaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marianad/32/42687_2.png) [@MarianaD](https://discuss.elastic.co/u/MarianaD)\
**Post date:** [March 18, 2020, 11:41am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079/4 "2020-03-18T11:41:53Z")

</div>

hi @adrianbumbas, you can either run:

```auto
metricbeat -e -d "*"

```

and send us any interesting snippets from the console output or set the debug level in the logs and provide us more info from the metricbeat.log files:  
set in the metricbeat.yml file:

```auto
logging.level: debug

```

---

<div class="post-metadata">

**Author:** ![adrianbumbas](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@adrianbumbas](https://discuss.elastic.co/u/adrianbumbas)\
**Post date:** [March 18, 2020, 11:53am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079/5 "2020-03-18T11:53:29Z")

</div>

All I can see in the logs is this

```
INFO	module/wrapper.go:252	Error fetching data for metricset windows.service: The data is invalid.
```

---

<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:** [April 15, 2020, 11:53am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-windows-service-the-data-is-invalid/222079/6 "2020-04-15T11:53:29Z")

</div>

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