Skip to content

[Filebeat] Avoid updating Fleet health status to degraded when HTTPJSON template value evaluation is empty #45664

@navnit-elastic

Description

@navnit-elastic

There are many Fleet integrations that rely on fail_on_template_error to control the flow of execution. For example rapid7_insightvm.asset uses fail_on_template_error: true to stop the paginated calls when page token is empty.
See: https://github.com/elastic/integrations/blob/1a9b422d2da21d060d167eead02ee0fa6405fbca/packages/rapid7_insightvm/data_stream/asset/agent/stream/httpjson.yml.hbs#L40-L44

This raised an issue after addition of Fleet health status updates in the httpjson input. CI runs are failing due to failures in system tests.
For example rapid7_insightvm.asset fails in CI with error message:

test case failed: one or more errors found while examining elastic-agent.logs3454491136: [0] found error "Unit state changed httpjson-default-httpjson-rapid7_insightvm-8b98e88b-6def-4afe-8ae5-5421b0e8d649 (HEALTHY->DEGRADED): failed to execute template cursor: the template result is empty"

The update in Fleet status should be done conditionally based on value of do_not_log_failure parameter. If it is set to true the status should not be updated to degraded.

There is a similar PR that allows empty cursor template values to be ignored by health status update.

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions