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

[Filebeat] Fix fileset field namespacing #20170

Merged

Conversation

andrewkroh
Copy link
Member

What does this PR do?

When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in #19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Why is it important?

Reduces the number of fields in the Filebeat mapping and allows Kibana to generate a smaller index pattern.

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.

How to test this PR locally

  • Build filebeat.
  • Run filebeat setup
  • Verify that the index pattern exists.
  • Verify that you can view the index pattern.
  • Verify that discover works.

Related issues

When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in elastic#19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Fixes elastic#19965
@andrewkroh andrewkroh added bug Filebeat Filebeat needs_backport PR is waiting to be backported to other branches. Team:SIEM labels Jul 22, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

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

elasticmachine commented Jul 22, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20170 opened, Started by user Victor Martinez, Rebuilds build #1]

  • Start Time: 2020-07-23T07:47:08.189+0000

  • Duration: 63 min 8 sec

Test stats 🧪

Test Results
Failed 0
Passed 4689
Skipped 822
Total 5511

Steps errors

Expand to view the steps failures

  • Name: Mage build test
    • Description: mage build test

    • Duration: 9 min 38 sec

    • Start Time: 2020-07-23T08:12:02.780+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-23T08:49:38.814Z] + '[' -f filebeat/build/coverage/full.cov ']'
[2020-07-23T08:49:38.814Z] + for i in '"$@"'
[2020-07-23T08:49:38.814Z] + FILE=heartbeat/build/coverage/full.cov
[2020-07-23T08:49:38.814Z] + '[' -f heartbeat/build/coverage/full.cov ']'
[2020-07-23T08:49:38.814Z] + for i in '"$@"'
[2020-07-23T08:49:38.814Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-23T08:49:38.814Z] + '[' -f journalbeat/build/coverage/full.cov ']'
[2020-07-23T08:49:38.814Z] + for i in '"$@"'
[2020-07-23T08:49:38.814Z] + FILE=libbeat/build/coverage/full.cov
[2020-07-23T08:49:38.814Z] + '[' -f libbeat/build/coverage/full.cov ']'
[2020-07-23T08:49:38.814Z] + for i in '"$@"'
[2020-07-23T08:49:38.814Z] + FILE=metricbeat/build/coverage/full.cov
[2020-07-23T08:49:38.814Z] + '[' -f metricbeat/build/coverage/full.cov ']'
[2020-07-23T08:49:38.814Z] + for i in '"$@"'
[2020-07-23T08:49:38.814Z] + FILE=packetbeat/build/coverage/full.cov
[2020-07-23T08:49:38.814Z] + '[' -f packetbeat/build/coverage/full.cov ']'
[2020-07-23T08:49:38.814Z] + for i in '"$@"'
[2020-07-23T08:49:38.814Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-23T08:49:38.814Z] + '[' -f winlogbeat/build/coverage/full.cov ']'
[2020-07-23T08:49:40.359Z] Post stage
[2020-07-23T08:49:40.367Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats
[2020-07-23T08:49:41.184Z] Starting "default"...
[2020-07-23T08:49:41.184Z] Machine "default" is already running.
[2020-07-23T08:49:41.628Z] Client:
[2020-07-23T08:49:41.628Z]  Version:           18.06.1-ce
[2020-07-23T08:49:41.628Z]  API version:       1.38
[2020-07-23T08:49:41.628Z]  Go version:        go1.10.3
[2020-07-23T08:49:41.628Z]  Git commit:        e68fc7a
[2020-07-23T08:49:41.628Z]  Built:             Tue Aug 21 17:21:31 2018
[2020-07-23T08:49:41.628Z]  OS/Arch:           darwin/amd64
[2020-07-23T08:49:41.628Z]  Experimental:      false
[2020-07-23T08:49:41.628Z] 
[2020-07-23T08:49:41.628Z] Server: Docker Engine - Community
[2020-07-23T08:49:41.628Z]  Engine:
[2020-07-23T08:49:41.628Z]   Version:          19.03.5
[2020-07-23T08:49:41.628Z]   API version:      1.40 (minimum version 1.12)
[2020-07-23T08:49:41.628Z]   Go version:       go1.12.12
[2020-07-23T08:49:41.628Z]   Git commit:       633a0ea838
[2020-07-23T08:49:41.628Z]   Built:            Wed Nov 13 07:28:45 2019
[2020-07-23T08:49:41.628Z]   OS/Arch:          linux/amd64
[2020-07-23T08:49:41.628Z]   Experimental:     false
[2020-07-23T08:49:41.628Z]  containerd:
[2020-07-23T08:49:41.628Z]   Version:          v1.2.10
[2020-07-23T08:49:41.628Z]   GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
[2020-07-23T08:49:41.628Z]  runc:
[2020-07-23T08:49:41.628Z]   Version:          1.0.0-rc8+dev
[2020-07-23T08:49:41.628Z]   GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
[2020-07-23T08:49:41.628Z]  docker-init:
[2020-07-23T08:49:41.628Z]   Version:          0.18.0
[2020-07-23T08:49:41.628Z]   GitCommit:        fec3683
[2020-07-23T08:49:52.028Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats
[2020-07-23T08:49:52.340Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-23T08:49:52.351Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats/Lint
[2020-07-23T08:49:52.438Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats/Filebeat-oss
[2020-07-23T08:49:52.519Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-23T08:49:52.592Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-23T08:49:52.671Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-23T08:49:52.760Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-07-23T08:49:52.835Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-07-23T08:49:53.195Z] + cat
[2020-07-23T08:49:53.195Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-23T08:49:53.195Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-23T08:49:59.812Z] runbld>>> runbld started
[2020-07-23T08:49:59.812Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-23T08:50:02.345Z] runbld>>> The following profiles matched the job 'Beats/beats/PR-20170' in order of occurrence in the config (last value wins).
[2020-07-23T08:50:03.281Z] runbld>>> Debug logging enabled.
[2020-07-23T08:50:03.281Z] runbld>>> Storing result
[2020-07-23T08:50:03.540Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-23T08:50:03.540Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200723085003-3303AB00
[2020-07-23T08:50:03.540Z] runbld>>> Adding system facts.
[2020-07-23T08:50:04.920Z] runbld>>> Adding vcs info for the latest commit:  a2cdbd80fa2b60dc5aa5c883485b0334ecba2fc5
[2020-07-23T08:50:04.920Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-23T08:50:04.920Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-23T08:50:04.920Z] Processing JUnit reports with runbld...
[2020-07-23T08:50:04.920Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-23T08:50:05.182Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-23T08:50:05.182Z] runbld>>> DURATION: 24ms
[2020-07-23T08:50:05.182Z] runbld>>> STDOUT: 40 bytes
[2020-07-23T08:50:05.182Z] runbld>>> STDERR: 49 bytes
[2020-07-23T08:50:05.182Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-23T08:50:05.182Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats
[2020-07-23T08:50:06.119Z] runbld>>> Storing build metadata: 
[2020-07-23T08:50:06.119Z] runbld>>> Adding test report.
[2020-07-23T08:50:06.119Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20170/src/github.com/elastic/beats
[2020-07-23T08:50:07.055Z] runbld>>> Found 14 test output files
[2020-07-23T08:50:08.903Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 5511 Skipped: 797
[2020-07-23T08:50:08.903Z] runbld>>> Storing result
[2020-07-23T08:50:08.903Z] runbld>>> FAILURES: 0
[2020-07-23T08:50:08.903Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-23T08:50:08.903Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200723085003-3303AB00
[2020-07-23T08:50:09.162Z] runbld>>> Email notification disabled by environment variable.
[2020-07-23T08:50:09.162Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-23T08:50:15.412Z] Running on worker-395930 in /var/lib/jenkins/workspace/Beats_beats_PR-20170
[2020-07-23T08:50:15.506Z] [INFO] getVaultSecret: Getting secrets
[2020-07-23T08:50:15.588Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-23T08:50:17.756Z] + chmod 755 generate-build-data.sh
[2020-07-23T08:50:17.757Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20170/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20170/runs/2 FAILURE 3788086
[2020-07-23T08:50:17.757Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20170/runs/2/steps/?limit=10000 -o steps-info.json
[2020-07-23T08:50:19.226Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20170/runs/2/tests/?status=FAILED -o tests-errors.json
[2020-07-23T08:50:19.935Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20170/runs/2/log/ -o pipeline-log.txt

Copy link
Contributor

@adriansr adriansr left a comment

Choose a reason for hiding this comment

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

Thanks for fixing

@andrewkroh andrewkroh merged commit ea7c05f into elastic:master Jul 23, 2020
andrewkroh added a commit to andrewkroh/beats that referenced this pull request Jul 23, 2020
When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in elastic#19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Fixes elastic#19965

(cherry picked from commit ea7c05f)
@andrewkroh andrewkroh added v7.9.0 and removed needs_backport PR is waiting to be backported to other branches. labels Jul 23, 2020
andrewkroh added a commit to andrewkroh/beats that referenced this pull request Jul 23, 2020
When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in elastic#19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Fixes elastic#19965

(cherry picked from commit ea7c05f)
andrewkroh added a commit that referenced this pull request Jul 23, 2020
When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in #19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Fixes #19965

(cherry picked from commit ea7c05f)
andrewkroh added a commit that referenced this pull request Jul 23, 2020
When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in #19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Fixes #19965

(cherry picked from commit ea7c05f)
v1v added a commit to v1v/beats that referenced this pull request Jul 27, 2020
…ne-2.0

* upstream/master: (41 commits)
  adding possibility to override content-type checks, it was breaking certain webhooks that is not able to set content-headers at all. Still defaults to application/json (elastic#20232)
  fix: use a fixed worker type for tests (elastic#20130)
  [Ingest Manager] Prepare packaging for endpoint and asc files (elastic#20186)
  [Packetbeat] HTTP: Improve support for 100-continue elastic#15830 (elastic#19349)
  Increase index.max_docvalue_fields_search to 200 (elastic#20218)
  [Ingest Manager] Prevent closing closed reader (elastic#20214)
  [Metricbeat] Use MySQL Host Parser in Query metricset (elastic#20191)
  Testing: Ignore timestamp from cylance/protect dataset (elastic#20211)
  [Filebeat] Ignore cylance.protect timestamps while testing (elastic#20207)
  [CI] remove codecov step (elastic#20102)
  [docs] Indicate that SYSTEM user is required on Windows to use Endpoint (elastic#20172)
  Remove f5/firepass rsa2elk fileset (elastic#20160)
  [Elastic Agent] Improve GRPC stop to be more relaxed. (elastic#20118)
  Fix fileset field prefixing (elastic#20170)
  Fix terminating pod autodiscover issue (elastic#20084)
  Call host parser only once when building light metricsets (elastic#20149)
  [CI] fix null string with contains (elastic#20182)
  [Ingest Manager] Fix failing unit tests on windows (elastic#20127)
  [Filebeat] Update crowdstrike module (elastic#20138)
  [docs] Add x-pack role to relevant metricsets (elastic#20167)
  ...
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in elastic#19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Fixes elastic#19965
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
When the fields.yml file is constructed it is done by appending files together and adding some indenting.
In the case of Filebeat, a fileset's fields.yml is appended with an indent of 8 spaces to the module's fields.yml.
This generally allows for all of the filesets fields to become children of the module.

The problem we had was that the new filesets added in elastic#19713 expected that their fields would be root fields
(not children to the module namespace). In cases where the module already existed and had declared
a module namespace field in its fields.yml this resulted in unexpectedly namespaced fieldset fields
(e.g. microsoft.rsa.* instead of rsa.*).

The size of the x-pack/filebeat index-pattern is still large (915885 bytes), but not so large that it goes beyond the Kibana
request payload limit.

Fixes elastic#19965

(cherry picked from commit 84a227a)
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.

Filebeat setup is not creating index pattern in kibana
3 participants