Metricbeat script processor

Hello,

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

    - 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.

Which version of Metricbeat are you running?

Shaunak

I am using 7.1.1

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

1 Like

Oh - OK. 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 :slightly_smiling_face:.

.

Appreciate very much your quick responses.

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