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

Add initial skeleton of filestream input #21427

Merged
merged 3 commits into from
Oct 1, 2020

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Sep 30, 2020

What does this PR do?

This PR adds the skeleton of the new filestream input. The name of the input can be changed. The input was renamed from logfile because we are not going to provide the same options as the current log input. As logfile is already used by Agent for the log input, it is easier to adopt a new input with a different name.

The PR seems big, but the contents of filebeat/input/filestream/internal/input-logfile is basically the same as filebeat/input/v2/input-cursor. It is separated into a different folder because when the time comes, we would like to unify the two input types. The main difference between the two inputs is that the configure function of input-logfile returns a Prospector which finds inputs dynamically. Whereas input-cursor requires a list of paths without globbing.

The following files need review:

The others are the same as input-cursor.

Also, updated tests are coming in a new PR.

Why is it important?

This is the first step toward the new input which collects log lines.

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

First step #20243

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 30, 2020
@kvch kvch added Team:Services (Deprecated) Label for the former Integrations-Services team and removed needs_team Indicates that the issue/PR needs a Team:* label labels Sep 30, 2020
@kvch kvch requested review from faec and ruflin September 30, 2020 15:36
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 30, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #21427 updated]

  • Start Time: 2020-09-30T16:08:21.196+0000

  • Duration: 58 min 26 sec

Test stats 🧪

Test Results
Failed 0
Passed 3545
Skipped 552
Total 4097

Steps errors

Expand to view the steps failures

  • Name: mage build test

    • Description: mage build test

    • Duration: 10 min 18 sec

    • Start Time: 2020-09-30T16:34:34.393+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

    • Description: script returned exit code 1

    • Duration: 0 min 1 sec

    • Start Time: 2020-09-30T16:45:05.944+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-09-30T17:05:07.332Z] c1e54eec4b57: Download complete
[2020-09-30T17:05:07.604Z] c1e54eec4b57: Pull complete
[2020-09-30T17:05:07.604Z] Digest: sha256:b733d4a32c4da6a00a84df2ca32791bb03df95400243648d8c539e7b4cce329c
[2020-09-30T17:05:07.604Z] Status: Downloaded newer image for alpine:3.4
[2020-09-30T17:05:09.828Z] + python .ci/scripts/pre_archive_test.py
[2020-09-30T17:05:11.226Z] Copy ./x-pack/filebeat/build into build/x-pack/filebeat/build
[2020-09-30T17:05:11.239Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats/build
[2020-09-30T17:05:11.291Z] WARNING: Unknown parameter(s) found for class type 'hudson.tasks.junit.pipeline.JUnitResultsStep': id,stashedTestReports
[2020-09-30T17:05:11.429Z] Recording test results
[2020-09-30T17:05:15.008Z] Stashed 4 file(s)
[2020-09-30T17:05:15.025Z] Archiving artifacts
[2020-09-30T17:05:15.762Z] + python .ci/scripts/search_system_tests.py
[2020-09-30T17:05:15.780Z] [INFO] system-tests='build/x-pack/filebeat/build/system-tests'. If no empty then let's create a tarball
[2020-09-30T17:05:16.128Z] + tar --version
[2020-09-30T17:05:16.514Z] + tar --exclude=x-pack-filebeat--system-tests-linux.tgz -czf x-pack-filebeat--system-tests-linux.tgz build/x-pack/filebeat/build/system-tests
[2020-09-30T17:05:43.124Z] Archiving artifacts
[2020-09-30T17:05:54.604Z] Client: Docker Engine - Community
[2020-09-30T17:05:54.604Z]  Version:           19.03.13
[2020-09-30T17:05:54.604Z]  API version:       1.40
[2020-09-30T17:05:54.604Z]  Go version:        go1.13.15
[2020-09-30T17:05:54.604Z]  Git commit:        4484c46d9d
[2020-09-30T17:05:54.604Z]  Built:             Wed Sep 16 17:02:36 2020
[2020-09-30T17:05:54.604Z]  OS/Arch:           linux/amd64
[2020-09-30T17:05:54.604Z]  Experimental:      false
[2020-09-30T17:05:54.604Z] 
[2020-09-30T17:05:54.604Z] Server: Docker Engine - Community
[2020-09-30T17:05:54.604Z]  Engine:
[2020-09-30T17:05:54.604Z]   Version:          19.03.13
[2020-09-30T17:05:54.604Z]   API version:      1.40 (minimum version 1.12)
[2020-09-30T17:05:54.604Z]   Go version:       go1.13.15
[2020-09-30T17:05:54.604Z]   Git commit:       4484c46d9d
[2020-09-30T17:05:54.604Z]   Built:            Wed Sep 16 17:01:06 2020
[2020-09-30T17:05:54.604Z]   OS/Arch:          linux/amd64
[2020-09-30T17:05:54.604Z]   Experimental:     false
[2020-09-30T17:05:54.604Z]  containerd:
[2020-09-30T17:05:54.604Z]   Version:          1.3.7
[2020-09-30T17:05:54.604Z]   GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
[2020-09-30T17:05:54.604Z]  runc:
[2020-09-30T17:05:54.604Z]   Version:          1.0.0-rc10
[2020-09-30T17:05:54.604Z]   GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
[2020-09-30T17:05:54.604Z]  docker-init:
[2020-09-30T17:05:54.604Z]   Version:          0.18.0
[2020-09-30T17:05:54.604Z]   GitCommit:        fec3683
[2020-09-30T17:06:06.333Z] [INFO] unstashV2: JOB_GCS_BUCKET is set. bucket param got precedency instead.
[2020-09-30T17:06:06.343Z] [INFO] unstashV2: JOB_GCS_CREDENTIALS is set. credentialsId param got precedency instead.
[2020-09-30T17:06:06.412Z] [Google Cloud Storage Plugin] Found 1 files to download from pattern: gs://beats-ci-temp/Beats/beats/PR-21427-3/source/source.tgz
[2020-09-30T17:06:06.437Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-21427-3/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-21427/source.tgz
[2020-09-30T17:06:15.853Z] + tar --version
[2020-09-30T17:06:16.146Z] + tar -xpf source.tgz
[2020-09-30T17:06:26.458Z] + rm source.tgz
[2020-09-30T17:06:26.562Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats
[2020-09-30T17:06:26.571Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats/uncategorized-1601483444982
[2020-09-30T17:06:26.618Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats/filebeat-build-1601484296932
[2020-09-30T17:06:26.658Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats/filebeat-windows-windows-2019-1601484297230
[2020-09-30T17:06:26.694Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats/x-pack-filebeat-windows-windows-2019-1601484399204
[2020-09-30T17:06:26.729Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats/x-pack-filebeat-build-1601485514513
[2020-09-30T17:06:27.062Z] + cat
[2020-09-30T17:06:27.062Z] + /usr/local/bin/runbld ./runbld-test-reports --job-name elastic+beats+pull-request
[2020-09-30T17:06:27.062Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-09-30T17:06:33.649Z] runbld>>> runbld started
[2020-09-30T17:06:33.649Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-09-30T17:06:34.599Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-09-30T17:06:34.599Z] runbld>>> Matches in the system config:
[2020-09-30T17:06:34.599Z] runbld>>> - Matched ^elastic\+beats
[2020-09-30T17:06:34.599Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-09-30T17:06:35.985Z] runbld>>> Debug logging enabled.
[2020-09-30T17:06:35.985Z] runbld>>> Storing result
[2020-09-30T17:06:35.985Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-09-30T17:06:35.985Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200930170635-D0B5BD79
[2020-09-30T17:06:35.985Z] runbld>>> Adding system facts.
[2020-09-30T17:06:37.369Z] runbld>>> Adding vcs info for the latest commit:  3b7ed7609ca7bf12f18a46c749d8b22044320ab8
[2020-09-30T17:06:37.369Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-09-30T17:06:37.369Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-09-30T17:06:37.369Z] Processing JUnit reports with runbld...
[2020-09-30T17:06:37.369Z] + echo 'Processing JUnit reports with runbld...'
[2020-09-30T17:06:37.629Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-09-30T17:06:37.629Z] runbld>>> DURATION: 39ms
[2020-09-30T17:06:37.629Z] runbld>>> STDOUT: 40 bytes
[2020-09-30T17:06:37.629Z] runbld>>> STDERR: 49 bytes
[2020-09-30T17:06:37.629Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-09-30T17:06:37.629Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-21427
[2020-09-30T17:06:38.591Z] runbld>>> Storing build metadata: 
[2020-09-30T17:06:38.591Z] runbld>>> Adding test report.
[2020-09-30T17:06:38.591Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-21427/src/github.com/elastic/beats
[2020-09-30T17:06:39.163Z] runbld>>> Found 10 test output files
[2020-09-30T17:06:40.546Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 4097 Skipped: 534
[2020-09-30T17:06:40.546Z] runbld>>> Storing result
[2020-09-30T17:06:40.546Z] runbld>>> FAILURES: 0
[2020-09-30T17:06:40.807Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-09-30T17:06:40.807Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200930170635-D0B5BD79
[2020-09-30T17:06:40.807Z] runbld>>> Email notification disabled by environment variable.
[2020-09-30T17:06:40.807Z] runbld>>> Slack notification disabled by environment variable.
[2020-09-30T17:06:46.418Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-21427
[2020-09-30T17:06:46.488Z] [INFO] getVaultSecret: Getting secrets
[2020-09-30T17:06:46.567Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-09-30T17:06:47.373Z] + chmod 755 generate-build-data.sh
[2020-09-30T17:06:47.373Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21427/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21427/runs/3 FAILURE 3505913
[2020-09-30T17:06:47.373Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21427/runs/3/steps/?limit=10000 -o steps-info.json
[2020-09-30T17:06:48.716Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21427/runs/3/tests/?status=FAILED -o tests-errors.json
[2020-09-30T17:06:48.967Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21427/runs/3/log/ -o pipeline-log.txt

@kvch kvch marked this pull request as ready for review September 30, 2020 15:46
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

Copy link
Contributor

@faec faec left a comment

Choose a reason for hiding this comment

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

looks nice!

@kvch kvch merged commit cb624cf into elastic:master Oct 1, 2020
@kvch kvch added the needs_backport PR is waiting to be backported to other branches. label Oct 1, 2020
kvch added a commit to kvch/beats that referenced this pull request Oct 1, 2020
## What does this PR do?

This PR adds the skeleton of the new `filestream` input. The name of the input can be changed. The input was renamed from `logfile` because we are not going to provide the same options as the current `log` input. As `logfile` is already used by Agent for the `log` input, it is easier to adopt a new input with a different name.

The PR seems big, but the contents of `filebeat/input/filestream/internal/input-logfile` is basically the same as `filebeat/input/v2/input-cursor`. It is separated into a different folder because when the time comes, we would like to unify the two input types. The main difference between the two inputs is that the `configure` function of `input-logfile` returns a `Prospector` which finds inputs dynamically. Whereas `input-cursor` requires a list of paths without globbing.

The following files need review:

* filebeat/input/filestream/input.go
* filebeat/input/filestream/internal/input-logfile/fswatch.go
* filebeat/input/filestream/internal/input-logfile/harvester.go
* filebeat/input/filestream/internal/input-logfile/input.go
* filebeat/input/filestream/internal/input-logfile/prospector.go
* filebeat/input/filestream/prospector.go

The others are the same as `input-cursor`.

Also, updated tests are coming in a new PR.

## Related issues

First step elastic#20243

(cherry picked from commit cb624cf)
@kvch kvch added v7.10.0 and removed needs_backport PR is waiting to be backported to other branches. labels Oct 1, 2020
kvch added a commit that referenced this pull request Oct 2, 2020
## What does this PR do?

This PR adds the skeleton of the new `filestream` input. The name of the input can be changed. The input was renamed from `logfile` because we are not going to provide the same options as the current `log` input. As `logfile` is already used by Agent for the `log` input, it is easier to adopt a new input with a different name.

The PR seems big, but the contents of `filebeat/input/filestream/internal/input-logfile` is basically the same as `filebeat/input/v2/input-cursor`. It is separated into a different folder because when the time comes, we would like to unify the two input types. The main difference between the two inputs is that the `configure` function of `input-logfile` returns a `Prospector` which finds inputs dynamically. Whereas `input-cursor` requires a list of paths without globbing.

The following files need review:

* filebeat/input/filestream/input.go
* filebeat/input/filestream/internal/input-logfile/fswatch.go
* filebeat/input/filestream/internal/input-logfile/harvester.go
* filebeat/input/filestream/internal/input-logfile/input.go
* filebeat/input/filestream/internal/input-logfile/prospector.go
* filebeat/input/filestream/prospector.go

The others are the same as `input-cursor`.

Also, updated tests are coming in a new PR.

## Related issues

First step #20243

(cherry picked from commit cb624cf)
v1v added a commit to v1v/beats that referenced this pull request Oct 2, 2020
* upstream/master: (27 commits)
  [Ingest Manager] Split index restrictions into type,dataset, namespace parts (elastic#21406)
  Update Filebeat module expected logs files (elastic#21454)
  Edit SQL module docs and fix broken doc structure (elastic#21233)
  [Ingest Manager] Send snapshot flag together with metadata (elastic#21285)
  Revert "[JJBB] Set shallow cloning to 10 (elastic#21409)" (elastic#21447)
  [JJBB] Use reference repo for fast checkouts (elastic#21410)
  Add initial skeleton of filestream input (elastic#21427)
  Initial spec file for apm-server (elastic#21225)
  [Ingest Manager] Upgrade Action: make source URI optional (elastic#21372)
  Add field limit check for AWS Cloudtrail flattened fields (elastic#21388)
  [Winlogbeat] Move winlogbeat javascript processor to libbeat (elastic#21402)
  ci: pipeline to generate the changelog (elastic#21426)
  [JJBB] Set shallow cloning to 10 (elastic#21409)
  docs: add link to release notes for 7.9.2 (elastic#21405) (elastic#21419)
  docs: Prepare Changelog for 7.9.2 (elastic#21229) (elastic#21403)
  fix: mark flaky tests (elastic#21300)
  fix: use a fixed version of setuptools (elastic#21393)
  Move Kubernetes events metricset to its own block in reference config (elastic#21407)
  [libbeat] Enable WriteAheadLimit in the disk queue (elastic#21391)
  docs: fix apt/yum formatting (elastic#21362)
  ...
v1v added a commit to v1v/beats that referenced this pull request Oct 2, 2020
…ne-2.0-arm

* upstream/master: (54 commits)
  [CI] Change x-pack/auditbeat build events (comments, labels) (elastic#21463)
  [CI] changeset from elastic#20603 was not added to CI2.0 (elastic#21464)
  Add new log file reader for filestream input (elastic#21450)
  [CI] Send slack message with build status (elastic#21428)
  Remove duplicated sources url in dependencies report (elastic#21462)
  Add implementation of FSWatcher and FSScanner for filestream (elastic#21444)
  [Ingest Manager] Split index restrictions into type,dataset, namespace parts (elastic#21406)
  Update Filebeat module expected logs files (elastic#21454)
  Edit SQL module docs and fix broken doc structure (elastic#21233)
  [Ingest Manager] Send snapshot flag together with metadata (elastic#21285)
  Revert "[JJBB] Set shallow cloning to 10 (elastic#21409)" (elastic#21447)
  [JJBB] Use reference repo for fast checkouts (elastic#21410)
  Add initial skeleton of filestream input (elastic#21427)
  Initial spec file for apm-server (elastic#21225)
  [Ingest Manager] Upgrade Action: make source URI optional (elastic#21372)
  Add field limit check for AWS Cloudtrail flattened fields (elastic#21388)
  [Winlogbeat] Move winlogbeat javascript processor to libbeat (elastic#21402)
  ci: pipeline to generate the changelog (elastic#21426)
  [JJBB] Set shallow cloning to 10 (elastic#21409)
  docs: add link to release notes for 7.9.2 (elastic#21405) (elastic#21419)
  ...
v1v added a commit to v1v/beats that referenced this pull request Oct 2, 2020
…ci-build-label-support

* upstream/master:
  [CI] Change x-pack/auditbeat build events (comments, labels) (elastic#21463)
  [CI] changeset from elastic#20603 was not added to CI2.0 (elastic#21464)
  Add new log file reader for filestream input (elastic#21450)
  [CI] Send slack message with build status (elastic#21428)
  Remove duplicated sources url in dependencies report (elastic#21462)
  Add implementation of FSWatcher and FSScanner for filestream (elastic#21444)
  [Ingest Manager] Split index restrictions into type,dataset, namespace parts (elastic#21406)
  Update Filebeat module expected logs files (elastic#21454)
  Edit SQL module docs and fix broken doc structure (elastic#21233)
  [Ingest Manager] Send snapshot flag together with metadata (elastic#21285)
  Revert "[JJBB] Set shallow cloning to 10 (elastic#21409)" (elastic#21447)
  [JJBB] Use reference repo for fast checkouts (elastic#21410)
  Add initial skeleton of filestream input (elastic#21427)
  Initial spec file for apm-server (elastic#21225)
  [Ingest Manager] Upgrade Action: make source URI optional (elastic#21372)
  Add field limit check for AWS Cloudtrail flattened fields (elastic#21388)
  [Winlogbeat] Move winlogbeat javascript processor to libbeat (elastic#21402)
  ci: pipeline to generate the changelog (elastic#21426)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Services (Deprecated) Label for the former Integrations-Services team v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants