# How to include metrics for a specific process when using process.include\_top\_n

**URL:** <https://discuss.elastic.co/t/how-to-include-metrics-for-a-specific-process-when-using-process-include-top-n/118483>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [February 5, 2018, 3:38pm UTC](https://discuss.elastic.co/t/how-to-include-metrics-for-a-specific-process-when-using-process-include-top-n/118483 "2018-02-05T15:38:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishnu59](https://avatars.discourse-cdn.com/v4/letter/v/8c91f0/32.png) [@Vishnu59](https://discuss.elastic.co/u/Vishnu59)\
**Post date:** [February 5, 2018, 3:38pm UTC](https://discuss.elastic.co/t/how-to-include-metrics-for-a-specific-process-when-using-process-include-top-n/118483/1 "2018-02-05T15:38:41Z")

</div>

Hi,

I have a requirement, where I will need to collect data for top 10 resource consuming processes on the VM along with having to collect resource utilization data for metricbeat. First part was pretty simple, but when it comes to having to include resource utilization data for metricbeat process along with top 10 resource utilizing processes, I haven't been able to come up with a logic on how to do that. Can someone please help throw in any ideas on how I could possibly do this?

for Top 10 processes data, am using below command.

```auto
  processes: ['.*']
  process.include_top_n:
    by_cpu: 10 # include top 10 processes by CPU
    by_memory: 10 # include top 10 processes by memory

```

Appreciate your time and help with this 🙂

Thanks,

Vishnu

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [February 5, 2018, 4:06pm UTC](https://discuss.elastic.co/t/how-to-include-metrics-for-a-specific-process-when-using-process-include-top-n/118483/2 "2018-02-05T16:06:56Z")

</div>

How about doing it like this:

```auto
metricbeat.modules:
- name: system
  metricsets: [process]
  processes: ['^metricbeat$']
- name: system
  metricsets: [process]
  processes: ['.*']
  process.include_top_n:
    by_cpu: 10
    by_memory: 10

```

It instantiates two instances of the process metricset.

FYI: In the upcoming 6.2 release we are adding central monitoring for Beats that will give you the resource utilization for each of the Beats as part of X-Pack monitoring. [https://www.elastic.co/blog/brewing-in-beats-monitoring-beats-cpu-usage](https://www.elastic.co/blog/brewing-in-beats-monitoring-beats-cpu-usage)

---

<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:** [March 5, 2018, 4:06pm UTC](https://discuss.elastic.co/t/how-to-include-metrics-for-a-specific-process-when-using-process-include-top-n/118483/3 "2018-03-05T16:06:57Z")

</div>

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