# Metricbeat script processor

**URL:** <https://discuss.elastic.co/t/metricbeat-script-processor/229548>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 23, 2020, 9:13pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548 "2020-04-23T21:13:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![musician](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@musician](https://discuss.elastic.co/u/musician)\
**Post date:** [April 23, 2020, 9:13pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/1 "2020-04-23T21:13:22Z")

</div>

Hello,

I am trying to use the script processor in metricbeat. I have the following system.yml:

```auto
    - module: system
      period: 10s
      metricsets:
        - cpu
        - memory
        - process
      processes: ['^metricbeat.exe$']
      processors:
        - script:
            when:
                and:
                    - has_fields: ['system.process.memory.rss.pct']
                    - range: 
                        system.process.memory.rss.pct.gte: 0.0032
            lang: javascript
            id: my_filter
            source: >
              function process(event) {
                  event.Put("performance_issue", "1");
              }

```

When I run metricbeat, I get the following error printed:

**Exiting: 1 error: the processor script doesn't exist**

Any pointers as to what I may have done wrong here? I would appreciate if someone is able to give me a working sample of script processor that I can start with.

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [April 23, 2020, 10:31pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/2 "2020-04-23T22:31:57Z")

</div>

Which version of Metricbeat are you running?

Shaunak

---

<div class="post-metadata">

**Author:** ![musician](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@musician](https://discuss.elastic.co/u/musician)\
**Post date:** [April 23, 2020, 11:00pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/3 "2020-04-23T23:00:28Z")

</div>

I am using 7.1.1

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [April 23, 2020, 11:25pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/4 "2020-04-23T23:25:01Z")

</div>

Ah, that's why – the `script` processor was only released in `7.2.0`.

---

<div class="post-metadata">

**Author:** ![musician](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@musician](https://discuss.elastic.co/u/musician)\
**Post date:** [April 23, 2020, 11:44pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/5 "2020-04-23T23:44:54Z")

</div>

Oh - OK. If I use this for metricbeat 7.6, is it likely to work as it is?

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [April 24, 2020, 6:26pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/6 "2020-04-24T18:26:47Z")

</div>

> [@musician](#):
>
> If I use this for metricbeat 7.6, is it likely to work as it is?

Correct. And if you want to wait a bit, Metricbeat 7.7 is not too far away from release. We can't give an exact date but it should be out _very soon_ 🙂.

.

---

<div class="post-metadata">

**Author:** ![musician](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@musician](https://discuss.elastic.co/u/musician)\
**Post date:** [April 24, 2020, 11:03pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/7 "2020-04-24T23:03:10Z")

</div>

Appreciate very much your quick responses.

---

<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:** [May 22, 2020, 11:03pm UTC](https://discuss.elastic.co/t/metricbeat-script-processor/229548/8 "2020-05-22T23:03:19Z")

</div>

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