From 3f1d843175ec7adc8d734eee13694db2b1fbd196 Mon Sep 17 00:00:00 2001 From: "Michael Holt (Corp IT)" Date: Tue, 18 Feb 2025 11:41:56 -0800 Subject: [PATCH] [Windows] Add custom conditions support for Perfmon --- packages/windows/changelog.yml | 5 +++++ .../data_stream/perfmon/agent/stream/stream.yml.hbs | 4 ++++ packages/windows/data_stream/perfmon/manifest.yml | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/packages/windows/changelog.yml b/packages/windows/changelog.yml index 2d7e6169d87..57098c92c6c 100644 --- a/packages/windows/changelog.yml +++ b/packages/windows/changelog.yml @@ -1,4 +1,9 @@ # newer versions go on top +- version: "2.5.0" + changes: + - description: Enable using conditionals to apply custom perfmon queries to specific systems. + type: enhancement + link: https://github.com/elastic/integrations/pull/XXXX - version: "2.4.2" changes: - description: Updated SSL description to be uniform and to include links to documentation. diff --git a/packages/windows/data_stream/perfmon/agent/stream/stream.yml.hbs b/packages/windows/data_stream/perfmon/agent/stream/stream.yml.hbs index e9bc00e6f3c..cfcc0eaece6 100644 --- a/packages/windows/data_stream/perfmon/agent/stream/stream.yml.hbs +++ b/packages/windows/data_stream/perfmon/agent/stream/stream.yml.hbs @@ -1,5 +1,9 @@ metricsets: ["perfmon"] +{{#if condition }} +condition: ${host.platform} == 'windows' and {{ condition }} +{{ else }} condition: ${host.platform} == 'windows' +{{/if}} perfmon.group_measurements_by_instance: {{perfmon.group_measurements_by_instance}} perfmon.ignore_non_existent_counters: {{perfmon.ignore_non_existent_counters}} perfmon.refresh_wildcard_counters: {{perfmon.refresh_wildcard_counters}} diff --git a/packages/windows/data_stream/perfmon/manifest.yml b/packages/windows/data_stream/perfmon/manifest.yml index 356f0ee3376..77649e56104 100644 --- a/packages/windows/data_stream/perfmon/manifest.yml +++ b/packages/windows/data_stream/perfmon/manifest.yml @@ -49,6 +49,13 @@ streams: required: true show_user: true default: 10s + - name: condition + title: Condition + description: Condition to filter when to collect this input. See [Dynamic Input Configuration](https://www.elastic.co/guide/en/fleet/current/dynamic-input-configuration.html) for details. + type: text + multi: false + required: false + show_user: false - name: processors type: yaml title: Processors