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 filestream input reader #21481

Merged
merged 7 commits into from
Oct 5, 2020
Merged

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Oct 2, 2020

What does this PR do?

This PR adds the event reader and publisher functionality. This is mostly the refactoring of Harvester from filebeat/input/log. Two things are missing: metrics and special readers e.g. multiline.

Why is it important?

New step.

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

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 2, 2020
@kvch kvch added the Team:Services (Deprecated) Label for the former Integrations-Services team label Oct 2, 2020
@elasticmachine
Copy link
Collaborator

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

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

elasticmachine commented Oct 2, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #21481 updated]

  • Start Time: 2020-10-05T15:15:36.884+0000

  • Duration: 18 min 20 sec

Steps errors

Expand to view the steps failures

  • Name: make check
    • Description: make check

    • Duration: 6 min 9 sec

    • Start Time: 2020-10-05T15:26:44.361+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-10-05T15:32:55.450Z] c1e54eec4b57: Pull complete
[2020-10-05T15:32:55.450Z] Digest: sha256:b733d4a32c4da6a00a84df2ca32791bb03df95400243648d8c539e7b4cce329c
[2020-10-05T15:32:55.450Z] Status: Downloaded newer image for alpine:3.4
[2020-10-05T15:32:57.679Z] + python .ci/scripts/pre_archive_test.py
[2020-10-05T15:32:57.679Z] Copy ./metricbeat/build into build/metricbeat/build
[2020-10-05T15:32:57.679Z] Copy ./filebeat/build into build/filebeat/build
[2020-10-05T15:32:57.679Z] Copy ./auditbeat/build into build/auditbeat/build
[2020-10-05T15:32:57.690Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21481/src/github.com/elastic/beats/build
[2020-10-05T15:32:57.726Z] WARNING: Unknown parameter(s) found for class type 'hudson.tasks.junit.pipeline.JUnitResultsStep': id,stashedTestReports
[2020-10-05T15:32:57.729Z] Recording test results
[2020-10-05T15:32:57.962Z] None of the test reports contained any result
[2020-10-05T15:32:58.011Z] Stashed 0 file(s)
[2020-10-05T15:32:58.022Z] Archiving artifacts
[2020-10-05T15:32:58.129Z] ‘**/build/TEST*.out’ doesn’t match anything: ‘**’ exists but not ‘**/build/TEST*.out’
[2020-10-05T15:32:58.130Z] No artifacts found that match the file pattern "**/build/TEST*.out". Configuration error?
[2020-10-05T15:32:58.446Z] + python .ci/scripts/search_system_tests.py
[2020-10-05T15:32:58.467Z] [INFO] system-tests=''. If no empty then let's create a tarball
[2020-10-05T15:32:58.811Z] Client: Docker Engine - Community
[2020-10-05T15:32:58.811Z]  Version:           19.03.13
[2020-10-05T15:32:58.811Z]  API version:       1.40
[2020-10-05T15:32:58.811Z]  Go version:        go1.13.15
[2020-10-05T15:32:58.811Z]  Git commit:        4484c46d9d
[2020-10-05T15:32:58.811Z]  Built:             Wed Sep 16 17:02:36 2020
[2020-10-05T15:32:58.811Z]  OS/Arch:           linux/amd64
[2020-10-05T15:32:58.811Z]  Experimental:      false
[2020-10-05T15:32:58.811Z] 
[2020-10-05T15:32:58.811Z] Server: Docker Engine - Community
[2020-10-05T15:32:58.811Z]  Engine:
[2020-10-05T15:32:58.811Z]   Version:          19.03.13
[2020-10-05T15:32:58.811Z]   API version:      1.40 (minimum version 1.12)
[2020-10-05T15:32:58.811Z]   Go version:       go1.13.15
[2020-10-05T15:32:58.811Z]   Git commit:       4484c46d9d
[2020-10-05T15:32:58.811Z]   Built:            Wed Sep 16 17:01:06 2020
[2020-10-05T15:32:58.811Z]   OS/Arch:          linux/amd64
[2020-10-05T15:32:58.811Z]   Experimental:     false
[2020-10-05T15:32:58.811Z]  containerd:
[2020-10-05T15:32:58.811Z]   Version:          1.3.7
[2020-10-05T15:32:58.811Z]   GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
[2020-10-05T15:32:58.811Z]  runc:
[2020-10-05T15:32:58.811Z]   Version:          1.0.0-rc10
[2020-10-05T15:32:58.811Z]   GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
[2020-10-05T15:32:58.811Z]  docker-init:
[2020-10-05T15:32:58.811Z]   Version:          0.18.0
[2020-10-05T15:32:58.811Z]   GitCommit:        fec3683
[2020-10-05T15:33:03.668Z] Stage "Build&Test" skipped due to earlier failure(s)
[2020-10-05T15:33:08.100Z] [INFO] unstashV2: JOB_GCS_BUCKET is set. bucket param got precedency instead.
[2020-10-05T15:33:08.115Z] [INFO] unstashV2: JOB_GCS_CREDENTIALS is set. credentialsId param got precedency instead.
[2020-10-05T15:33:08.186Z] [Google Cloud Storage Plugin] Found 1 files to download from pattern: gs://beats-ci-temp/Beats/beats/PR-21481-10/source/source.tgz
[2020-10-05T15:33:08.205Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-21481-10/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-21481/source.tgz
[2020-10-05T15:33:22.799Z] + tar --version
[2020-10-05T15:33:23.101Z] + tar -xpf source.tgz
[2020-10-05T15:33:35.651Z] + rm source.tgz
[2020-10-05T15:33:35.766Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21481/src/github.com/elastic/beats
[2020-10-05T15:33:35.776Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21481/src/github.com/elastic/beats/uncategorized-1601911977962
[2020-10-05T15:33:36.125Z] + cat
[2020-10-05T15:33:36.125Z] + /usr/local/bin/runbld ./runbld-test-reports --job-name elastic+beats+pull-request
[2020-10-05T15:33:36.125Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-10-05T15:33:42.739Z] runbld>>> runbld started
[2020-10-05T15:33:42.739Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-10-05T15:33:44.670Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-10-05T15:33:44.670Z] runbld>>> Matches in the system config:
[2020-10-05T15:33:44.671Z] runbld>>> - Matched ^elastic\+beats
[2020-10-05T15:33:44.671Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-10-05T15:33:46.056Z] runbld>>> Debug logging enabled.
[2020-10-05T15:33:46.057Z] runbld>>> Storing result
[2020-10-05T15:33:46.319Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-10-05T15:33:46.319Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20201005153345-29BA6A1A
[2020-10-05T15:33:46.319Z] runbld>>> Adding system facts.
[2020-10-05T15:33:47.265Z] runbld>>> Adding vcs info for the latest commit:  052b4730be26257abea921e2f18b31759c30115f
[2020-10-05T15:33:47.265Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-10-05T15:33:47.265Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-10-05T15:33:47.527Z] + echo 'Processing JUnit reports with runbld...'
[2020-10-05T15:33:47.527Z] Processing JUnit reports with runbld...
[2020-10-05T15:33:47.788Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-10-05T15:33:47.788Z] runbld>>> DURATION: 18ms
[2020-10-05T15:33:47.788Z] runbld>>> STDOUT: 40 bytes
[2020-10-05T15:33:47.789Z] runbld>>> STDERR: 49 bytes
[2020-10-05T15:33:47.789Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-10-05T15:33:47.789Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-21481
[2020-10-05T15:33:48.734Z] runbld>>> Storing build metadata: 
[2020-10-05T15:33:48.734Z] runbld>>> Adding test report.
[2020-10-05T15:33:48.734Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-21481/src/github.com/elastic/beats
[2020-10-05T15:33:49.680Z] runbld>>> Found 0 test output files
[2020-10-05T15:33:49.680Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 0 Skipped: 0
[2020-10-05T15:33:49.680Z] runbld>>> Storing result
[2020-10-05T15:33:49.941Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-10-05T15:33:49.941Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20201005153345-29BA6A1A
[2020-10-05T15:33:50.202Z] runbld>>> Email notification disabled by environment variable.
[2020-10-05T15:33:50.202Z] runbld>>> Slack notification disabled by environment variable.
[2020-10-05T15:33:55.765Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-21481
[2020-10-05T15:33:55.983Z] [INFO] getVaultSecret: Getting secrets
[2020-10-05T15:33:56.056Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-10-05T15:33:56.687Z] + chmod 755 generate-build-data.sh
[2020-10-05T15:33:56.687Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21481/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21481/runs/10 FAILURE 1099542
[2020-10-05T15:33:56.687Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21481/runs/10/steps/?limit=10000 -o steps-info.json
[2020-10-05T15:33:57.237Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21481/runs/10/tests/?status=FAILED -o tests-errors.json
[2020-10-05T15:33:57.488Z] Retry 1/3 exited 22, retrying in 1 seconds...
[2020-10-05T15:33:58.831Z] Retry 2/3 exited 22, retrying in 2 seconds...
[2020-10-05T15:34:00.693Z] Retry 3/3 exited 22, no more retries left.
[2020-10-05T15:34:00.693Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21481/runs/10/log/ -o pipeline-log.txt

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.

one minor comment

return err
}

_, err := file.Seek(0, os.SEEK_CUR)
Copy link
Contributor

Choose a reason for hiding this comment

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

This second Seek looks like a no-op. Is it testing whether the given file can support seeking in general? (If so, why do we need to know that here?) If this check is necessary please add an explanatory comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment.

@kvch kvch force-pushed the feature-filebeat-logfile-reader branch 5 times, most recently from 9ba92cc to 052b473 Compare October 5, 2020 15:14
@kvch kvch mentioned this pull request Oct 5, 2020
@kvch kvch force-pushed the feature-filebeat-logfile-reader branch from 052b473 to a1510fa Compare October 5, 2020 16:01
@kvch kvch added the needs_backport PR is waiting to be backported to other branches. label Oct 5, 2020
@kvch kvch merged commit 40b24dd into elastic:master Oct 5, 2020
@kvch kvch added v7.10.0 and removed needs_backport PR is waiting to be backported to other branches. labels Oct 5, 2020
kvch added a commit to kvch/beats that referenced this pull request Oct 5, 2020
This PR adds the event reader and publisher functionality. This is mostly the refactoring of `Harvester` from `filebeat/input/log`. Two things are missing: metrics and special readers e.g. `multiline`.

(cherry picked from commit 40b24dd)
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #21481 updated]

  • Start Time: 2020-10-05T16:02:12.388+0000

  • Duration: 62 min 24 sec

Test stats 🧪

Test Results
Failed 0
Passed 4410
Skipped 564
Total 4974

kvch added a commit that referenced this pull request Oct 6, 2020
This PR adds the event reader and publisher functionality. This is mostly the refactoring of `Harvester` from `filebeat/input/log`. Two things are missing: metrics and special readers e.g. `multiline`.

(cherry picked from commit 40b24dd)
v1v added a commit to v1v/beats that referenced this pull request Oct 6, 2020
* upstream/master:
  [CI] Setup git config globally (elastic#21562)
  docs: update generate_fields_docs.py (elastic#21359)
  Add support for additional fields from V2 ALB logs (elastic#21540)
  Move Prometheus query & remote_write to GA (elastic#21507)
  feat: add a new step to run the e2e tests for certain parts of Beats (elastic#21100)
  [Elastic Agent] Add elastic agent ID and version to events from filebeat and metricbeat. (elastic#21543)
  Release cloudfoundry input and processor as GA (elastic#21525)
  [Packetbeat] New SIP protocol (elastic#21221)
  [Filebeat][New Module] Add support for Microsoft MTP / 365 Defender (elastic#21446)
  [Beats][pytest] Asserting if filebeat logs include errors (elastic#20999)
  junipersrx-module initial release (elastic#20017)
  Add a persistent cache for cloudfoundry metadata based on badger (elastic#20775)
  Add missing changelog entry for cisco umbrella (elastic#21550)
  [Elastic Agent] Add upgrade CLI to initiate upgrade of Agent locally (elastic#21425)
  Enable filestream input (elastic#21533)
  Add filestream input reader (elastic#21481)
  [CI] fix 'no matches found within 10000' (elastic#21466)
  Fix billing.go aws.GetStartTimeEndTime (elastic#21531)
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