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

Cherry-pick #20540 to 7.x: Fix Winlogbeat export index-pattern with migration.6_to_7.enabled #20574

Merged
merged 4 commits into from
Aug 17, 2020

Conversation

adriansr
Copy link
Contributor

@adriansr adriansr commented Aug 12, 2020

Cherry-pick of PR #20540 #20156 and #20016 to 7.x branch. Original message:

What does this PR do?

  • Fixes a duplicated field in Winlogbeat's index pattern when migration.6_to_7.enabled is true.

  • Updates the common system/tests for all Beats to test that the command below works:

beatname export index-pattern -E migration.6_to_7.enabled=true

  • Also cherrypicks the export tests which weren't backported out of master for some reason.

Why is it important?

To catch cases where migration aliases cause field duplication or other issues.

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.

Related issues

@adriansr adriansr requested a review from a team as a code owner August 12, 2020 13:56
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 12, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

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

elasticmachine commented Aug 12, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20574 updated]

  • Start Time: 2020-08-14T08:20:34.836+0000

  • Duration: 79 min 6 sec

Test stats 🧪

Test Results
Failed 0
Passed 17949
Skipped 1853
Total 19802

Steps errors

Expand to view the steps failures

  • Name: Make test
    • Description: make -C generator/_templates/metricbeat test

    • Duration: 2 min 27 sec

    • Start Time: 2020-08-14T08:46:19.561+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-08-14T09:38:53.695Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-20574-3/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-20574/source.tgz
[2020-08-14T09:39:02.787Z] + tar --version
[2020-08-14T09:39:03.091Z] + tar -xpf source.tgz
[2020-08-14T09:39:13.431Z] + rm source.tgz
[2020-08-14T09:39:13.445Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats
[2020-08-14T09:39:13.468Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Lint
[2020-08-14T09:39:13.581Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Winlogbeat-oss
[2020-08-14T09:39:13.671Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-08-14T09:39:13.768Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-08-14T09:39:13.859Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-08-14T09:39:13.942Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Journalbeat-oss
[2020-08-14T09:39:14.026Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Dockerlogbeat
[2020-08-14T09:39:14.113Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-08-14T09:39:14.195Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-08-14T09:39:14.277Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-08-14T09:39:14.367Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-08-14T09:39:14.447Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-08-14T09:39:14.531Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-08-14T09:39:14.615Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Packetbeat-Linux
[2020-08-14T09:39:14.698Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-08-14T09:39:14.798Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Heartbeat-oss
[2020-08-14T09:39:14.892Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-08-14T09:39:15.094Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-08-14T09:39:15.185Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-08-14T09:39:15.307Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-08-14T09:39:15.405Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-08-14T09:39:15.487Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-08-14T09:39:15.570Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Libbeat-x-pack
[2020-08-14T09:39:15.660Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-08-14T09:39:15.741Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-08-14T09:39:15.826Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-08-14T09:39:15.908Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Filebeat-Windows
[2020-08-14T09:39:15.996Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-08-14T09:39:16.077Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-08-14T09:39:16.154Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-Windows
[2020-08-14T09:39:16.234Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-08-14T09:39:16.315Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-08-14T09:39:16.397Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-08-14T09:39:16.478Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Filebeat-oss
[2020-08-14T09:39:16.559Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Filebeat-x-pack
[2020-08-14T09:39:16.638Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Functionbeat-Windows
[2020-08-14T09:39:16.721Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Libbeat-oss
[2020-08-14T09:39:16.813Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests
[2020-08-14T09:39:16.913Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-OSS-Python-Integration-tests
[2020-08-14T09:39:17.000Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-08-14T09:39:17.091Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Packetbeat-Mac-OS-X
[2020-08-14T09:39:17.169Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-08-14T09:39:17.252Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Heartbeat-Windows
[2020-08-14T09:39:17.335Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-08-14T09:39:17.415Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Packetbeat-Windows
[2020-08-14T09:39:17.845Z] + cat
[2020-08-14T09:39:17.845Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-08-14T09:39:17.845Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-08-14T09:39:24.458Z] runbld>>> runbld started
[2020-08-14T09:39:24.458Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-08-14T09:39:26.379Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-08-14T09:39:26.379Z] runbld>>> Matches in the system config:
[2020-08-14T09:39:26.379Z] runbld>>> - Matched ^elastic\+beats
[2020-08-14T09:39:26.379Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-08-14T09:39:27.770Z] runbld>>> Debug logging enabled.
[2020-08-14T09:39:27.770Z] runbld>>> Storing result
[2020-08-14T09:39:28.032Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-08-14T09:39:28.032Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200814093927-F321FF52
[2020-08-14T09:39:28.032Z] runbld>>> Adding system facts.
[2020-08-14T09:39:28.980Z] runbld>>> Adding vcs info for the latest commit:  00a65acfad9ea01d7472acd6f5d7d8f01fc9aca5
[2020-08-14T09:39:28.980Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-08-14T09:39:28.980Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-08-14T09:39:28.980Z] + echo 'Processing JUnit reports with runbld...'
[2020-08-14T09:39:28.980Z] Processing JUnit reports with runbld...
[2020-08-14T09:39:29.242Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-08-14T09:39:29.243Z] runbld>>> DURATION: 29ms
[2020-08-14T09:39:29.243Z] runbld>>> STDOUT: 40 bytes
[2020-08-14T09:39:29.243Z] runbld>>> STDERR: 49 bytes
[2020-08-14T09:39:29.243Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-08-14T09:39:29.243Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20574
[2020-08-14T09:39:30.194Z] runbld>>> Storing build metadata: 
[2020-08-14T09:39:30.194Z] runbld>>> Adding test report.
[2020-08-14T09:39:30.194Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats
[2020-08-14T09:39:31.139Z] runbld>>> Found 136 test output files
[2020-08-14T09:39:32.532Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-08-14T09:39:32.532Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-08-14T09:39:32.532Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-08-14T09:39:32.532Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-08-14T09:39:32.532Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-08-14T09:39:32.532Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-08-14T09:39:32.794Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20574/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-08-14T09:39:34.183Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 19651 Skipped: 1575
[2020-08-14T09:39:34.183Z] runbld>>> Storing result
[2020-08-14T09:39:34.183Z] runbld>>> FAILURES: 0
[2020-08-14T09:39:34.444Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-08-14T09:39:34.444Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200814093927-F321FF52
[2020-08-14T09:39:34.444Z] runbld>>> Email notification disabled by environment variable.
[2020-08-14T09:39:34.444Z] runbld>>> Slack notification disabled by environment variable.
[2020-08-14T09:39:40.222Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20574
[2020-08-14T09:39:40.458Z] [INFO] getVaultSecret: Getting secrets
[2020-08-14T09:39:40.540Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-08-14T09:39:41.519Z] + chmod 755 generate-build-data.sh
[2020-08-14T09:39:41.519Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20574/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20574/runs/3 FAILURE 4746423
[2020-08-14T09:39:41.519Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20574/runs/3/steps/?limit=10000 -o steps-info.json
[2020-08-14T09:39:44.002Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20574/runs/3/tests/?status=FAILED -o tests-errors.json

adriansr and others added 4 commits August 14, 2020 10:16
This adds 4 new integration tests to all Beats that test export commands:

> beatname export ilm-policy
> beatname export template
> beatname export index-pattern
> beatname export config
* Add export tests to x-pack/filebeat

Add export sub-command tests to x-pack/filebeat and add an assertion for the
size the Kibana index-pattern due to the Kibana API limiting payloads to 1 MiB.

* Assert size of index pattern document is less than 1 MiB
…astic#20540)

- Test export index-pattern with migration.6_to_7.enabled=true
- Always run these tests, not only when integration testing
- Remove conflicting Winlogbeat alias
Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

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

LGTM

@adriansr adriansr merged commit 9ec7549 into elastic:7.x Aug 17, 2020
adriansr added a commit to adriansr/beats that referenced this pull request Aug 17, 2020
… with migration.6_to_7.enabled (elastic#20574)

* Test export commands in all Beats (elastic#20016)

This adds 4 new integration tests to all Beats that test export commands:

> beatname export ilm-policy
> beatname export template
> beatname export index-pattern
> beatname export config

* [Filebeat] Add export tests to x-pack/filebeat (elastic#20156)

* Add export tests to x-pack/filebeat

Add export sub-command tests to x-pack/filebeat and add an assertion for the
size the Kibana index-pattern due to the Kibana API limiting payloads to 1 MiB.

* Assert size of index pattern document is less than 1 MiB

* Fix Winlogbeat export index-pattern with migration.6_to_7.enabled (elastic#20540)

- Test export index-pattern with migration.6_to_7.enabled=true
- Always run these tests, not only when integration testing
- Remove conflicting Winlogbeat alias

* Changelog entry

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
(cherry picked from commit 9ec7549)
adriansr added a commit that referenced this pull request Aug 17, 2020
…igration.6_to_7.enabled (#20628)

* Cherry-pick #20540 to 7.x: Fix Winlogbeat export index-pattern with migration.6_to_7.enabled (#20574)

* Test export commands in all Beats (#20016)

This adds 4 new integration tests to all Beats that test export commands:

> beatname export ilm-policy
> beatname export template
> beatname export index-pattern
> beatname export config

* [Filebeat] Add export tests to x-pack/filebeat (#20156)

* Add export tests to x-pack/filebeat

Add export sub-command tests to x-pack/filebeat and add an assertion for the
size the Kibana index-pattern due to the Kibana API limiting payloads to 1 MiB.

* Assert size of index pattern document is less than 1 MiB

* Fix Winlogbeat export index-pattern with migration.6_to_7.enabled (#20540)

- Test export index-pattern with migration.6_to_7.enabled=true
- Always run these tests, not only when integration testing
- Remove conflicting Winlogbeat alias

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
(cherry picked from commit 9ec7549)
@zube zube bot removed the [zube]: Done label Nov 15, 2020
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
… with migration.6_to_7.enabled (elastic#20628)

* Cherry-pick elastic#20540 to 7.x: Fix Winlogbeat export index-pattern with migration.6_to_7.enabled (elastic#20574)

* Test export commands in all Beats (elastic#20016)

This adds 4 new integration tests to all Beats that test export commands:

> beatname export ilm-policy
> beatname export template
> beatname export index-pattern
> beatname export config

* [Filebeat] Add export tests to x-pack/filebeat (elastic#20156)

* Add export tests to x-pack/filebeat

Add export sub-command tests to x-pack/filebeat and add an assertion for the
size the Kibana index-pattern due to the Kibana API limiting payloads to 1 MiB.

* Assert size of index pattern document is less than 1 MiB

* Fix Winlogbeat export index-pattern with migration.6_to_7.enabled (elastic#20540)

- Test export index-pattern with migration.6_to_7.enabled=true
- Always run these tests, not only when integration testing
- Remove conflicting Winlogbeat alias

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
(cherry picked from commit 66cfa25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants