Skip to content

Cherry-pick #25036 to 7.x: Initialize support for ignore_inactive in filestream input#25140

Merged
kvch merged 1 commit intoelastic:7.xfrom
kvch:backport_25036_7.x
Apr 19, 2021
Merged

Cherry-pick #25036 to 7.x: Initialize support for ignore_inactive in filestream input#25140
kvch merged 1 commit intoelastic:7.xfrom
kvch:backport_25036_7.x

Conversation

@kvch
Copy link
Copy Markdown
Contributor

@kvch kvch commented Apr 19, 2021

Cherry-pick of PR #25036 to 7.x branch. Original message:

What does this PR do?

This PR adds support for a more flexible file ignoring in filestream input. A new setting is introduced named ignore_inactive. At the moment it only supports two values: since_last_start and since_first_start.

If since_last_start is selected, the input ignores every file that has not been updated since Filebeat has been started. If since_first_start is chosen files that haven't been written since Filebeat has been started the first time on a given host are ignored.

I am submitting tests in a follow-up PR.

Why is it important?

It extends the existing ingore_older support of filestream.

Open question

Should we save the size of the files to the registry, so if they get updated the input can start with the new 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.

This PR adds support for a more flexible file ignoring in `filestream` input. A new setting is introduced named `ignore_inactive`. At the moment it only supports two values: `since_last_start` and `since_first_start`.

If `since_last_start` is selected, the input ignores every file that has not been updated since Filebeat has been started. If `since_first_start` is chosen files that haven't been written since Filebeat has been started the first time on a given host are ignored.

(cherry picked from commit 3f39dd8)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 19, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 19, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #25140 opened

  • Start Time: 2021-04-19T13:16:43.977+0000

  • Duration: 138 min 3 sec

  • Commit: 1cdbd60

Test stats 🧪

Test Results
Failed 0
Passed 46713
Skipped 5176
Total 51889

Trends 🧪

Image of Build Times

Image of Tests

Steps errors 5

Expand to view the steps failures

untar gsutil
  • Took 1 min 11 sec . View more details on here
  • Description: tar -xpf gsutil.tar.gz --strip-components=1
untar gsutil
  • Took 2 min 34 sec . View more details on here
  • Description: tar -xpf gsutil.tar.gz --strip-components=1
untar gsutil
  • Took 1 min 11 sec . View more details on here
  • Description: tar -xpf gsutil.tar.gz --strip-components=1
Print Message
  • Took 0 min 1 sec . View more details on here
  • Description: �[39;49m[INFO] getVaultSecret: Getting secrets�[0m
Print Message
  • Took 0 min 0 sec . View more details on here
  • Description: �[39;49m[INFO] getVaultSecret: Getting secrets�[0m

Log output

Expand to view the last 100 lines of log output

[2021-04-19T15:30:44.031Z]  Experimental:      true
[2021-04-19T15:30:44.031Z] 
[2021-04-19T15:30:44.031Z] Server: Docker Engine - Community
[2021-04-19T15:30:44.031Z]  Engine:
[2021-04-19T15:30:44.031Z]   Version:          20.10.3
[2021-04-19T15:30:44.031Z]   API version:      1.41 (minimum version 1.12)
[2021-04-19T15:30:44.031Z]   Go version:       go1.13.15
[2021-04-19T15:30:44.031Z]   Git commit:       46229ca
[2021-04-19T15:30:44.031Z]   Built:            Fri Jan 29 14:31:25 2021
[2021-04-19T15:30:44.031Z]   OS/Arch:          linux/amd64
[2021-04-19T15:30:44.032Z]   Experimental:     false
[2021-04-19T15:30:44.032Z]  containerd:
[2021-04-19T15:30:44.032Z]   Version:          1.4.4
[2021-04-19T15:30:44.032Z]   GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
[2021-04-19T15:30:44.032Z]  runc:
[2021-04-19T15:30:44.032Z]   Version:          1.0.0-rc93
[2021-04-19T15:30:44.032Z]   GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
[2021-04-19T15:30:44.032Z]  docker-init:
[2021-04-19T15:30:44.032Z]   Version:          0.19.0
[2021-04-19T15:30:44.032Z]   GitCommit:        de40ad0
[2021-04-19T15:30:44.032Z] Change ownership of all files inside the specific folder from root/root to current user/group
[2021-04-19T15:30:44.032Z] Unable to find image 'alpine:3.4' locally
[2021-04-19T15:30:44.706Z] 3.4: Pulling from library/alpine
[2021-04-19T15:30:45.076Z] c1e54eec4b57: Pulling fs layer
[2021-04-19T15:30:45.341Z] c1e54eec4b57: Download complete
[2021-04-19T15:30:45.624Z] c1e54eec4b57: Pull complete
[2021-04-19T15:30:50.966Z] Digest: sha256:b733d4a32c4da6a00a84df2ca32791bb03df95400243648d8c539e7b4cce329c
[2021-04-19T15:30:50.966Z] Status: Downloaded newer image for alpine:3.4
[2021-04-19T15:30:53.069Z] Change permissions with write access of all files inside the specific folder
[2021-04-19T15:30:54.824Z] Running in /var/lib/jenkins/workspace/PR-25140-1-04901970-3411-400e-950b-3708eeb67d5d/src/github.com/elastic/beats/build
[2021-04-19T15:30:55.199Z] + rm -rf ve
[2021-04-19T15:30:55.199Z] + find . -type d -name vendor -exec rm -r {} ;
[2021-04-19T15:30:55.667Z] + python .ci/scripts/pre_archive_test.py
[2021-04-19T15:31:13.826Z] Copy ./x-pack/heartbeat/build into build/x-pack/heartbeat/build
[2021-04-19T15:31:13.826Z] Copy ./x-pack/heartbeat/build/golang-crossbuild into build/x-pack/heartbeat/build/golang-crossbuild
[2021-04-19T15:31:13.826Z] Copy ./x-pack/elastic-agent/build into build/x-pack/elastic-agent/build
[2021-04-19T15:31:13.826Z] Copy ./x-pack/elastic-agent/build/package/elastic-agent-ubi8/elastic-agent-linux-amd64.docker/docker-build into build/x-pack/elastic-agent/build/package/elastic-agent-ubi8/elastic-agent-linux-amd64.docker/docker-build
[2021-04-19T15:31:13.826Z] Copy ./x-pack/elastic-agent/build/package/elastic-agent/elastic-agent-linux-amd64.docker/docker-build into build/x-pack/elastic-agent/build/package/elastic-agent/elastic-agent-linux-amd64.docker/docker-build
[2021-04-19T15:31:13.826Z] Copy ./x-pack/elastic-agent/build/golang-crossbuild into build/x-pack/elastic-agent/build/golang-crossbuild
[2021-04-19T15:31:13.826Z] Copy ./x-pack/filebeat/build into build/x-pack/filebeat/build
[2021-04-19T15:31:13.826Z] Copy ./x-pack/filebeat/build/package/filebeat-ubi8/filebeat-linux-amd64.docker/docker-build into build/x-pack/filebeat/build/package/filebeat-ubi8/filebeat-linux-amd64.docker/docker-build
[2021-04-19T15:31:13.827Z] Copy ./x-pack/filebeat/build/package/filebeat/filebeat-linux-amd64.docker/docker-build into build/x-pack/filebeat/build/package/filebeat/filebeat-linux-amd64.docker/docker-build
[2021-04-19T15:31:13.827Z] Copy ./x-pack/filebeat/build/golang-crossbuild into build/x-pack/filebeat/build/golang-crossbuild
[2021-04-19T15:31:13.827Z] Copy ./x-pack/metricbeat/build into build/x-pack/metricbeat/build
[2021-04-19T15:31:13.827Z] Copy ./x-pack/metricbeat/build/package/metricbeat-ubi8/metricbeat-linux-amd64.docker/docker-build into build/x-pack/metricbeat/build/package/metricbeat-ubi8/metricbeat-linux-amd64.docker/docker-build
[2021-04-19T15:31:13.827Z] Copy ./x-pack/metricbeat/build/package/metricbeat/metricbeat-linux-amd64.docker/docker-build into build/x-pack/metricbeat/build/package/metricbeat/metricbeat-linux-amd64.docker/docker-build
[2021-04-19T15:31:13.827Z] Copy ./x-pack/metricbeat/build/golang-crossbuild into build/x-pack/metricbeat/build/golang-crossbuild
[2021-04-19T15:31:13.933Z] Running in /var/lib/jenkins/workspace/PR-25140-1-04901970-3411-400e-950b-3708eeb67d5d/src/github.com/elastic/beats/build
[2021-04-19T15:31:14.029Z] Recording test results
[2021-04-19T15:31:18.535Z] None of the test reports contained any result
[2021-04-19T15:31:18.553Z] [Checks API] No suitable checks publisher found.
[2021-04-19T15:31:19.766Z] + go clean -modcache
[2021-04-19T15:31:25.474Z] Cleaning up /var/lib/jenkins/workspace/PR-25140-1-04901970-3411-400e-950b-3708eeb67d5d
[2021-04-19T15:31:25.474Z] Client: Docker Engine - Community
[2021-04-19T15:31:25.474Z]  Version:           20.10.3
[2021-04-19T15:31:25.474Z]  API version:       1.41
[2021-04-19T15:31:25.474Z]  Go version:        go1.13.15
[2021-04-19T15:31:25.474Z]  Git commit:        48d30b5
[2021-04-19T15:31:25.474Z]  Built:             Fri Jan 29 14:33:13 2021
[2021-04-19T15:31:25.474Z]  OS/Arch:           linux/amd64
[2021-04-19T15:31:25.474Z]  Context:           default
[2021-04-19T15:31:25.474Z]  Experimental:      true
[2021-04-19T15:31:25.474Z] 
[2021-04-19T15:31:25.474Z] Server: Docker Engine - Community
[2021-04-19T15:31:25.474Z]  Engine:
[2021-04-19T15:31:25.474Z]   Version:          20.10.3
[2021-04-19T15:31:25.474Z]   API version:      1.41 (minimum version 1.12)
[2021-04-19T15:31:25.474Z]   Go version:       go1.13.15
[2021-04-19T15:31:25.474Z]   Git commit:       46229ca
[2021-04-19T15:31:25.474Z]   Built:            Fri Jan 29 14:31:25 2021
[2021-04-19T15:31:25.474Z]   OS/Arch:          linux/amd64
[2021-04-19T15:31:25.474Z]   Experimental:     false
[2021-04-19T15:31:25.474Z]  containerd:
[2021-04-19T15:31:25.474Z]   Version:          1.4.4
[2021-04-19T15:31:25.474Z]   GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
[2021-04-19T15:31:25.474Z]  runc:
[2021-04-19T15:31:25.475Z]   Version:          1.0.0-rc93
[2021-04-19T15:31:25.475Z]   GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
[2021-04-19T15:31:25.475Z]  docker-init:
[2021-04-19T15:31:25.475Z]   Version:          0.19.0
[2021-04-19T15:31:25.475Z]   GitCommit:        de40ad0
[2021-04-19T15:31:25.475Z] Change ownership of all files inside the specific folder from root/root to current user/group
[2021-04-19T15:32:47.310Z] Change permissions with write access of all files inside the specific folder
[2021-04-19T15:32:47.477Z] Running in /var/lib/jenkins/workspace/PR-25140-1-04901970-3411-400e-950b-3708eeb67d5d
[2021-04-19T15:32:57.047Z] + gsutil --version
[2021-04-19T15:32:58.527Z] Masking supported pattern matches of $FILE_CREDENTIAL
[2021-04-19T15:32:59.334Z] + gcloud auth activate-service-account --key-file ****
[2021-04-19T15:32:59.917Z] Activated service account credentials for: [beats-ci-gcs-plugin@elastic-ci-prod.iam.gserviceaccount.com]
[2021-04-19T15:33:00.455Z] + gsutil -m -q cp -a public-read eC1wYWNrL2VsYXN0aWMtYWdlbnQtcGFja2FnaW5nLWxpbnV4MWNkYmQ2MDE3MDEyZTI2MGE5OTNlZDY4YjcyZDcxYzc2MmEyODYzNA gs://beats-ci-temp/ci/cache/
[2021-04-19T15:33:12.663Z] Stage "Packaging" skipped due to earlier failure(s)
[2021-04-19T15:33:12.971Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-25140/src/github.com/elastic/beats
[2021-04-19T15:33:48.437Z] Still waiting to schedule task
[2021-04-19T15:33:48.437Z] Waiting for next available executor on ‘master||metal||linux’
[2021-04-19T15:34:45.763Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-25140
[2021-04-19T15:34:45.872Z] [INFO] getVaultSecret: Getting secrets
[2021-04-19T15:34:46.035Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-04-19T15:34:47.653Z] + chmod 755 generate-build-data.sh
[2021-04-19T15:34:47.653Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25140/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25140/runs/1 FAILURE 8283382
[2021-04-19T15:34:47.904Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25140/runs/1/steps/?limit=10000 -o steps-info.json
[2021-04-19T15:35:02.765Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25140/runs/1/tests/?status=FAILED -o tests-errors.json

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 46713
Skipped 5176
Total 51889

@kvch kvch merged commit 927d53f into elastic:7.x Apr 19, 2021
@zube zube bot removed the [zube]: Done label Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Team:Elastic-Agent Label for the Agent team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants