Skip to content

[NGINX] Add condition parameter support to logs and metrics data streams #19267

Merged
stefans-elastic merged 6 commits into
elastic:mainfrom
herrBez:nginx-add-condition
May 29, 2026
Merged

[NGINX] Add condition parameter support to logs and metrics data streams #19267
stefans-elastic merged 6 commits into
elastic:mainfrom
herrBez:nginx-add-condition

Conversation

@herrBez
Copy link
Copy Markdown
Contributor

@herrBez herrBez commented May 28, 2026

Proposed commit message

[NGINX] Add condition parameter support for logs and metrics inputs.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

  • Update the integration
  • Assign the integration to a host and verfy that is collecting the data
  • Add a condition
  • Verify that the conditions are reported in the elastic-agent inspect command
  • Verify that the components are not running

Related issues

Screenshots

image image
- data_stream:
    namespace: default
  id: logfile-nginx-545475e2-8cec-4c0d-900e-1a6e091c5586
  meta:
    package:
      name: nginx
      policy_template: nginx
      release: ga
      version: 3.2.0
  name: nginx-1
  package_policy_id: 545475e2-8cec-4c0d-900e-1a6e091c5586
  revision: 4
  streams:
  - condition: ${host.name} != "rocky-linux-small" # <----- CONDITION ADDED
    data_stream:
      dataset: nginx.access
      type: logs
    exclude_files:
    - .gz$
    id: logfile-nginx.access-545475e2-8cec-4c0d-900e-1a6e091c5586
    ignore_older: 72h
    paths:
    - /var/log/nginx/access.log*
    processors:
    - add_locale: null
    tags:
    - nginx-access
  - condition: ${host.name} != "rocky-linux-small" # <----- CONDITION ADDED
    data_stream:
      dataset: nginx.error
      type: logs
    exclude_files:
    - .gz$
    id: logfile-nginx.error-545475e2-8cec-4c0d-900e-1a6e091c5586
    ignore_older: 72h
    multiline:
      match: after
      negate: true
      pattern: '^\d{4}\/\d{2}\/\d{2} '
    paths:
    - /var/log/nginx/error.log*
    processors:
    - add_locale: null
    tags:
    - nginx-error
  type: logfile
  use_output: default
- data_stream:
    namespace: default
  id: nginx/metrics-nginx-545475e2-8cec-4c0d-900e-1a6e091c5586
  meta:
    package:
      name: nginx
      policy_template: nginx
      release: ga
      version: 3.2.0
  name: nginx-1
  package_policy_id: 545475e2-8cec-4c0d-900e-1a6e091c5586
  revision: 4
  streams:
  - condition: ${host.name} != "rocky-linux-small" # <----- CONDITION ADDED
    data_stream:
      dataset: nginx.stubstatus
      type: metrics
    hosts:
    - http://127.0.0.1:80
    id: nginx/metrics-nginx.stubstatus-545475e2-8cec-4c0d-900e-1a6e091c5586
    metricsets:
    - stubstatus
    period: 10s
    server_status_path: /nginx_status
    tags:
    - nginx-stubstatus
  type: nginx/metrics
  use_output: default

@herrBez herrBez requested a review from a team as a code owner May 28, 2026 11:49
@github-actions
Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 1 suggestion found

💡 Suggestions (1): Optional style improvements. Apply when helpful.
File Line Rule Message
packages/nginx/changelog.yml 1 Elastic.Versions Use 'later versions' instead of 'newer versions' when referring to versions.

The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

@andrewkroh andrewkroh added the Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] label May 28, 2026
Comment thread packages/nginx/manifest.yml Outdated
Comment thread packages/nginx/manifest.yml Outdated
@herrBez herrBez requested a review from stefans-elastic May 28, 2026 16:14
@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

Copy link
Copy Markdown
Contributor

@stefans-elastic stefans-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@herrBez herrBez requested a review from ishleenk17 May 29, 2026 14:27
@stefans-elastic stefans-elastic merged commit c39f5b0 into elastic:main May 29, 2026
9 checks passed
@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

Package nginx - 3.2.0 containing this change is available at https://epr.elastic.co/package/nginx/3.2.0/

herrBez added a commit to herrBez/integrations that referenced this pull request Jun 1, 2026
…ams (elastic#19267)

* Add conditions to the manifest

* Make sure the conditions are used in the different inputs

* bump nginx integration version

* Add entry to changelog

* Update changelog with correct PR number

* hide condition attribute by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration:nginx Nginx Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants