Skip to content

Add close to conditions processors#46653

Merged
leehinman merged 4 commits intoelastic:mainfrom
leehinman:conditions_close
Oct 22, 2025
Merged

Add close to conditions processors#46653
leehinman merged 4 commits intoelastic:mainfrom
leehinman:conditions_close

Conversation

@leehinman
Copy link
Contributor

@leehinman leehinman commented Sep 15, 2025

Proposed commit message

Add Close method to the conditionals processors if any of the underlying processors have a Close method. Without a Close method, processor definitions like the following would not have their Close method called.

processors:
  - add_host_metadata:
     when.not.contains.tags: "forwarded"

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

none

Author's Checklist

  • [ ]

How to test this PR locally

cd libbeat/processors
go test .

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 15, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Sep 15, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b conditions_close upstream/conditions_close
git merge upstream/main
git push upstream conditions_close
@mergify
Copy link
Contributor

mergify bot commented Sep 15, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @leehinman? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@leehinman leehinman added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team bugfix labels Sep 15, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 15, 2025
@leehinman leehinman added backport-8.x Automated backport to the 8.x branch with mergify backport-9.1 Automated backport to the 9.1 branch labels Sep 15, 2025
@leehinman leehinman marked this pull request as ready for review September 16, 2025 01:48
@leehinman leehinman requested a review from a team as a code owner September 16, 2025 01:48
@leehinman leehinman requested review from faec and mauri870 September 16, 2025 01:48
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@swiatekm
Copy link
Contributor

Here's an issue I filed for this problem: #46575. I assigned it to you @leehinman given that you're already solving this.

@leehinman leehinman marked this pull request as draft September 16, 2025 17:48
@leehinman
Copy link
Contributor Author

Putting in Draft because we have to figure out the conditionals inside the script processor

@mergify
Copy link
Contributor

mergify bot commented Sep 23, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b conditions_close upstream/conditions_close
git merge upstream/main
git push upstream conditions_close
@leehinman leehinman marked this pull request as ready for review October 20, 2025 22:14
@leehinman leehinman requested review from belimawr and faec October 20, 2025 22:15
@leehinman leehinman merged commit 9da0f31 into elastic:main Oct 22, 2025
208 checks passed
@github-actions
Copy link
Contributor

@Mergifyio backport 8.19 9.0 9.1 9.2

@mergify
Copy link
Contributor

mergify bot commented Oct 22, 2025

backport 8.19 9.0 9.1 9.2

✅ Backports have been created

Details
mergify bot pushed a commit that referenced this pull request Oct 22, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.

(cherry picked from commit 9da0f31)
mergify bot pushed a commit that referenced this pull request Oct 22, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.

(cherry picked from commit 9da0f31)

# Conflicts:
#	libbeat/processors/conditionals.go
mergify bot pushed a commit that referenced this pull request Oct 22, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.

(cherry picked from commit 9da0f31)
mergify bot pushed a commit that referenced this pull request Oct 22, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.

(cherry picked from commit 9da0f31)
pierrehilbert pushed a commit that referenced this pull request Oct 27, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.

(cherry picked from commit 9da0f31)

Co-authored-by: Lee E Hinman <57081003+leehinman@users.noreply.github.com>
pierrehilbert pushed a commit that referenced this pull request Oct 27, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.

(cherry picked from commit 9da0f31)

Co-authored-by: Lee E Hinman <57081003+leehinman@users.noreply.github.com>
pierrehilbert pushed a commit that referenced this pull request Oct 29, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.

(cherry picked from commit 9da0f31)

Co-authored-by: Lee E Hinman <57081003+leehinman@users.noreply.github.com>
orestisfl added a commit to orestisfl/beats that referenced this pull request Nov 7, 2025
Missed check for `.els` that is nil-able.

Not including a changelog because it was introduced in unreleased elastic#46653.
orestisfl added a commit to orestisfl/beats that referenced this pull request Nov 7, 2025
Missed check for `.els` that is nil-able.

Not including changelog because elastic#46653 is not released.
orestisfl added a commit that referenced this pull request Nov 10, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because #46653 is not released.

## Related issues

- Follow-up after #46653
- Related to #46575
mergify bot pushed a commit that referenced this pull request Nov 10, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because #46653 is not released.

## Related issues

- Follow-up after #46653
- Related to #46575

(cherry picked from commit 850555f)
mergify bot pushed a commit that referenced this pull request Nov 10, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because #46653 is not released.

## Related issues

- Follow-up after #46653
- Related to #46575

(cherry picked from commit 850555f)
mergify bot pushed a commit that referenced this pull request Nov 10, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because #46653 is not released.

## Related issues

- Follow-up after #46653
- Related to #46575

(cherry picked from commit 850555f)
orestisfl added a commit that referenced this pull request Nov 10, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because #46653 is not released.

## Related issues

- Follow-up after #46653
- Related to #46575

(cherry picked from commit 850555f)

Co-authored-by: Orestis Floros <orestis.floros@elastic.co>
orestisfl added a commit that referenced this pull request Nov 10, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because #46653 is not released.

## Related issues

- Follow-up after #46653
- Related to #46575

(cherry picked from commit 850555f)

Co-authored-by: Orestis Floros <orestis.floros@elastic.co>
orestisfl added a commit that referenced this pull request Nov 10, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because #46653 is not released.

## Related issues

- Follow-up after #46653
- Related to #46575

(cherry picked from commit 850555f)

Co-authored-by: Orestis Floros <orestis.floros@elastic.co>
andrzej-stencel pushed a commit to andrzej-stencel/beats that referenced this pull request Dec 1, 2025
Add Close method to the conditionals processors if any of the underlying processors have a Close method, but do not add the Close method if they do not.
andrzej-stencel pushed a commit to andrzej-stencel/beats that referenced this pull request Dec 1, 2025
## Proposed commit message

Missed check for `.els` that is nil-able.

Not including changelog because elastic#46653 is not released.

## Related issues

- Follow-up after elastic#46653
- Related to elastic#46575
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.x Automated backport to the 8.x branch with mergify backport-9.1 Automated backport to the 9.1 branch backport-active-all Automated backport with mergify to all the active branches bugfix Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

5 participants