Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] fix bug with empty filter values returning no results in system/service #19812

Merged

Conversation

fearful-symmetry
Copy link
Contributor

@fearful-symmetry fearful-symmetry commented Jul 9, 2020

What does this PR do?

This fixes a bug where if the system/service module is running on an OS with an older version of systemd, and a user hasn't configured pattern_filter, the metricset will return no results. When using the systemd ListUnitsFiltered API call, we don't bypass the pattern_filter in cases where the filter is empty.

Why is it important?

It's a bug, the metricset won't return any data.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • 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.

How to test this PR locally

  • Build and Run on CentOS 7, which uses a sufficiently old version of systemd.
  • Enable the system/service metricset
  • make sure service.pattern_filter isn't configured.
  • Make sure we get data.

@fearful-symmetry fearful-symmetry requested a review from a team July 9, 2020 19:40
@fearful-symmetry fearful-symmetry self-assigned this Jul 9, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 9, 2020
@fearful-symmetry fearful-symmetry changed the title fix bug with empty filter values returning no results [Bug] fix bug with empty filter values returning no results in system/service Jul 9, 2020
@fearful-symmetry fearful-symmetry added the Team:Integrations Label for the Integrations team label Jul 9, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 9, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 9, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19812 updated]

  • Start Time: 2020-07-14T14:21:20.950+0000

  • Duration: 82 min 31 sec

Test stats 🧪

Test Results
Failed 0
Passed 3089
Skipped 705
Total 3794

Steps errors

Expand to view the steps failures

  • Name: Install Go 1.14.4

    • Description: .ci/scripts/install-go.sh

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-14T14:45:47.039+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-14T14:54:20.272+0000

    • log

  • Name: Install Go 1.14.4

    • Description: .ci/scripts/install-go.sh

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-14T14:45:46.142+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-14T15:39:09.927+0000

    • log

@fearful-symmetry fearful-symmetry merged commit a1dd2ec into elastic:master Jul 14, 2020
fearful-symmetry added a commit to fearful-symmetry/beats that referenced this pull request Jul 14, 2020
…/service (elastic#19812)

* fix bug with empty filter values returning no results

* add changelog entry

(cherry picked from commit a1dd2ec)
fearful-symmetry added a commit to fearful-symmetry/beats that referenced this pull request Jul 14, 2020
…/service (elastic#19812)

* fix bug with empty filter values returning no results

* add changelog entry

(cherry picked from commit a1dd2ec)
fearful-symmetry added a commit that referenced this pull request Jul 14, 2020
…/service (#19812) (#19914)

* fix bug with empty filter values returning no results

* add changelog entry

(cherry picked from commit a1dd2ec)
fearful-symmetry added a commit that referenced this pull request Jul 14, 2020
…/service (#19812) (#19912)

* fix bug with empty filter values returning no results

* add changelog entry

(cherry picked from commit a1dd2ec)
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
…/service (elastic#19812)

* fix bug with empty filter values returning no results

* add changelog entry
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…/service (elastic#19812) (elastic#19914)

* fix bug with empty filter values returning no results

* add changelog entry

(cherry picked from commit 1e531b1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants