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.9: Fix Winlogbeat export index-pattern with migration.6_to_7.enabled #20628

Merged
merged 2 commits into from
Aug 17, 2020

Conversation

adriansr
Copy link
Contributor

@adriansr adriansr commented Aug 17, 2020

Cherry-pick of PR #20540 #20156 and #20016 to 7.9 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

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

… 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 adriansr requested a review from a team as a code owner August 17, 2020 08:36
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 17, 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 17, 2020
@adriansr adriansr requested a review from a team August 17, 2020 08:41
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 17, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20628 updated]

  • Start Time: 2020-08-17T08:41:13.092+0000

  • Duration: 86 min 20 sec

Test stats 🧪

Test Results
Failed 1
Passed 17831
Skipped 1838
Total 19670

Test errors

Expand to view the tests failures

  • Name: Build and Test / Auditbeat x-pack Mac OS X / test_metricset_host – test_metricsets.Test

    • Age: 1
    • Duration: 10.134
    • Error Details: Timeout waiting for 'cond' to be true. Waited 10 seconds.

Steps errors

Expand to view the steps failures

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 5 min 54 sec

    • Start Time: 2020-08-17T09:11:23.621+0000

    • log

  • Name: Make test

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

    • Duration: 1 min 56 sec

    • Start Time: 2020-08-17T09:05:46.498+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-08-17T10:06:45.801Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-20628-2/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-20628/source.tgz
[2020-08-17T10:06:54.751Z] + tar --version
[2020-08-17T10:06:55.049Z] + tar -xpf source.tgz
[2020-08-17T10:07:05.368Z] + rm source.tgz
[2020-08-17T10:07:05.381Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats
[2020-08-17T10:07:05.404Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Lint
[2020-08-17T10:07:05.496Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-08-17T10:07:05.583Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Winlogbeat-oss
[2020-08-17T10:07:05.667Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-08-17T10:07:05.762Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-08-17T10:07:05.850Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-08-17T10:07:05.937Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Journalbeat-oss
[2020-08-17T10:07:06.022Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Dockerlogbeat
[2020-08-17T10:07:06.099Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-08-17T10:07:06.180Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-08-17T10:07:06.259Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-08-17T10:07:06.338Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-08-17T10:07:06.446Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Packetbeat-Linux
[2020-08-17T10:07:06.524Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-08-17T10:07:06.605Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-08-17T10:07:06.690Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Heartbeat-oss
[2020-08-17T10:07:06.782Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-08-17T10:07:06.864Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-08-17T10:07:06.952Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-08-17T10:07:07.037Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-08-17T10:07:07.119Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-08-17T10:07:07.198Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-08-17T10:07:07.277Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-08-17T10:07:07.363Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-08-17T10:07:07.452Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Libbeat-x-pack
[2020-08-17T10:07:07.530Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-08-17T10:07:07.611Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-08-17T10:07:07.692Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Filebeat-Windows
[2020-08-17T10:07:07.772Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Packetbeat-Mac-OS-X
[2020-08-17T10:07:07.854Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-08-17T10:07:07.936Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-08-17T10:07:08.013Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-Windows
[2020-08-17T10:07:08.101Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-08-17T10:07:08.187Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Filebeat-oss
[2020-08-17T10:07:08.267Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Filebeat-x-pack
[2020-08-17T10:07:08.360Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Packetbeat-Windows
[2020-08-17T10:07:08.442Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Libbeat-oss
[2020-08-17T10:07:08.538Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-08-17T10:07:08.625Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Heartbeat-Windows
[2020-08-17T10:07:08.714Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-08-17T10:07:08.797Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-08-17T10:07:08.877Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-08-17T10:07:08.959Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-08-17T10:07:09.039Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-08-17T10:07:09.123Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Functionbeat-Windows
[2020-08-17T10:07:09.587Z] + cat
[2020-08-17T10:07:09.587Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-08-17T10:07:09.587Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-08-17T10:07:16.179Z] runbld>>> runbld started
[2020-08-17T10:07:16.179Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-08-17T10:07:18.094Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-08-17T10:07:18.094Z] runbld>>> Matches in the system config:
[2020-08-17T10:07:18.094Z] runbld>>> - Matched ^elastic\+beats
[2020-08-17T10:07:18.094Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-08-17T10:07:19.480Z] runbld>>> Debug logging enabled.
[2020-08-17T10:07:19.480Z] runbld>>> Storing result
[2020-08-17T10:07:19.480Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-08-17T10:07:19.480Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200817100719-4743740D
[2020-08-17T10:07:19.480Z] runbld>>> Adding system facts.
[2020-08-17T10:07:20.424Z] runbld>>> Adding vcs info for the latest commit:  fdb2cf72db2b2fc43a47ae784d51c7083dc4ae59
[2020-08-17T10:07:20.424Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-08-17T10:07:20.424Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-08-17T10:07:20.424Z] Processing JUnit reports with runbld...
[2020-08-17T10:07:20.424Z] + echo 'Processing JUnit reports with runbld...'
[2020-08-17T10:07:20.997Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-08-17T10:07:20.997Z] runbld>>> DURATION: 24ms
[2020-08-17T10:07:20.997Z] runbld>>> STDOUT: 40 bytes
[2020-08-17T10:07:20.997Z] runbld>>> STDERR: 49 bytes
[2020-08-17T10:07:20.997Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-08-17T10:07:20.997Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20628
[2020-08-17T10:07:21.938Z] runbld>>> Storing build metadata: 
[2020-08-17T10:07:21.938Z] runbld>>> Adding test report.
[2020-08-17T10:07:21.938Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats
[2020-08-17T10:07:22.514Z] runbld>>> Found 136 test output files
[2020-08-17T10:07:24.431Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-08-17T10:07:24.431Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-08-17T10:07:24.431Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-08-17T10:07:24.431Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-08-17T10:07:24.431Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-08-17T10:07:24.431Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-08-17T10:07:24.431Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20628/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-08-17T10:07:25.815Z] runbld>>> Test output logs contained: Errors: 1 Failures: 0 Tests: 19519 Skipped: 1560
[2020-08-17T10:07:25.815Z] runbld>>> Storing result
[2020-08-17T10:07:25.815Z] runbld>>> FAILURES: 1
[2020-08-17T10:07:26.174Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-08-17T10:07:26.174Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200817100719-4743740D
[2020-08-17T10:07:26.436Z] runbld>>> Email notification disabled by environment variable.
[2020-08-17T10:07:26.436Z] runbld>>> Slack notification disabled by environment variable.
[2020-08-17T10:07:32.427Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20628
[2020-08-17T10:07:32.663Z] [INFO] getVaultSecret: Getting secrets
[2020-08-17T10:07:32.746Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-08-17T10:07:33.531Z] + chmod 755 generate-build-data.sh
[2020-08-17T10:07:33.532Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20628/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20628/runs/2 FAILURE 5180179
[2020-08-17T10:07:33.532Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20628/runs/2/steps/?limit=10000 -o steps-info.json
[2020-08-17T10:07:36.015Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20628/runs/2/tests/?status=FAILED -o tests-errors.json

@adriansr adriansr merged commit 7904748 into elastic:7.9 Aug 17, 2020
@zube zube bot removed the [zube]: Done label Nov 16, 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