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 #19464 to 7.x: Dissect: Support trimming captured values and other configuration options #19685

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

adriansr
Copy link
Contributor

@adriansr adriansr commented Jul 6, 2020

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

What does this PR do?

This adds 4 new configuration parameters for the dissect processor:

  • ignore_failure, so that it doesn't return an error when the tokenizer doesn't match the input. This is useful for chaining multiple processors together.
  • overwrite_keys, so that existing keys are overwritten if they already exist.
  • trim_values, to enable trimming blank space (left,(leading) right(trailing) or all) in captured values.
  • trim_chars is the set of characters that are trimmed by the above option (default is the ascii space character).

The default values for these new flags have been chosen so that the default behavior of the processor is unchanged.

Why is it important?

These new flags are necessary to make dissect more useful and easy to use when used in chains of processors, for example a cascade of processors when only one of them is expected to match the input.

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.

…ions (elastic#19464)

This adds 4 new configuration parameters for the dissect processor:

- ignore_failure, so that it doesn't return an error when the tokenizer doesn't match the input. This is useful for chaining multiple processors together.
- overwrite_keys, so that existing keys are overwritten if they already exist.
- trim_values, to enable trimming blank space (left,(leading) right(trailing) or all) in captured values.
- trim_chars is the set of characters that are trimmed by the above option (default is the ascii space character).

The default values for these new flags have been chosen so that the default behavior of the processor is unchanged.

(cherry picked from commit a57e390)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 6, 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 Jul 6, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 13, 2020

❕ Build Aborted

Either there was a build timeout or someone aborted the build.'}

Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: [Started by user Adrian Serrano, Replayed #1]

  • Start Time: 2020-07-13T14:08:46.944+0000

  • Duration: 156 min 52 sec

Test stats 🧪

Test Results
Failed 1
Passed 8946
Skipped 1571
Total 10518

Test errors

Expand to view the tests failures

  • Name: Build and Test / Filebeat Mac OS X / test_rotating_file_inode – test_registrar.Test

    • Age: 1
    • Duration: 4.124
    • Error Details:

Steps errors

Expand to view the steps failures

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-13T15:03:38.737+0000

    • log

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 3 min 51 sec

    • Start Time: 2020-07-13T15:12:11.974+0000

    • log

  • Name: Make -C filebeat testsuite

    • Description: make -C filebeat testsuite

    • Duration: 7 min 55 sec

    • Start Time: 2020-07-13T15:08:05.632+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-13T15:15:01.631+0000

    • log

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 6 min 17 sec

    • Start Time: 2020-07-13T16:03:22.614+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 1 min 28 sec

    • Start Time: 2020-07-13T16:09:41.737+0000

    • log

  • Name: Recursively delete the current directory from the workspace

    • Description: script returned exit code 1

    • Duration: 0 min 10 sec

    • Start Time: 2020-07-13T16:11:15.183+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-13T15:57:36.809+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-13T16:07:20.288+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-13T15:12:20.440+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-13T16:44:02.801Z] Failed in branch Filebeat x-pack
[2020-07-13T16:44:05.361Z] Failed in branch Heartbeat
[2020-07-13T16:44:05.893Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats
[2020-07-13T16:44:06.387Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-13T16:44:06.436Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Lint
[2020-07-13T16:44:06.943Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-13T16:44:07.428Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-13T16:44:07.659Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-13T16:44:07.887Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-13T16:44:08.208Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-13T16:44:08.496Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-13T16:44:08.756Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-13T16:44:08.987Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Filebeat-oss
[2020-07-13T16:44:09.955Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-13T16:44:10.321Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-13T16:44:10.793Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-13T16:44:11.095Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-13T16:44:11.391Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-13T16:44:11.622Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-13T16:44:11.898Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-13T16:44:12.130Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-13T16:44:12.291Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-13T16:44:12.455Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-13T16:44:12.651Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-13T16:44:12.783Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Packetbeat-oss
[2020-07-13T16:44:12.890Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-13T16:44:13.004Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-07-13T16:44:13.103Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-07-13T16:44:13.220Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-13T16:44:13.330Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-13T16:44:13.537Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-13T16:44:13.783Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Libbeat-oss
[2020-07-13T16:44:13.919Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-07-13T16:44:14.067Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-07-13T16:44:14.184Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-07-13T16:44:14.317Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-13T16:44:14.482Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-13T16:44:14.730Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-07-13T16:44:14.992Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-07-13T16:44:15.356Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-07-13T16:44:15.546Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-13T16:44:15.758Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-07-13T16:44:15.929Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-13T16:44:16.103Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-07-13T16:44:16.238Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-07-13T16:44:16.358Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-07-13T16:44:16.478Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Functionbeat-Windows
[2020-07-13T16:44:16.634Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-13T16:44:16.848Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Heartbeat-Windows
[2020-07-13T16:44:17.420Z] + cat
[2020-07-13T16:44:17.420Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-13T16:44:17.420Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-13T16:44:24.226Z] runbld>>> runbld started
[2020-07-13T16:44:24.226Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-13T16:44:26.143Z] runbld>>> The following profiles matched the job 'Beats/beats/PR-19685' in order of occurrence in the config (last value wins).
[2020-07-13T16:44:27.532Z] runbld>>> Debug logging enabled.
[2020-07-13T16:44:27.532Z] runbld>>> Storing result
[2020-07-13T16:44:27.532Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-13T16:44:27.532Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200713164427-F6AF7A74
[2020-07-13T16:44:27.793Z] runbld>>> Adding system facts.
[2020-07-13T16:44:28.754Z] runbld>>> Adding vcs info for the latest commit:  ece52343b6a7e42e40b940bcd15475ceb29108d4
[2020-07-13T16:44:28.754Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-13T16:44:28.754Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-13T16:44:28.754Z] Processing JUnit reports with runbld...
[2020-07-13T16:44:28.754Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-13T16:44:29.017Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-13T16:44:29.018Z] runbld>>> DURATION: 21ms
[2020-07-13T16:44:29.018Z] runbld>>> STDOUT: 40 bytes
[2020-07-13T16:44:29.018Z] runbld>>> STDERR: 49 bytes
[2020-07-13T16:44:29.018Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-13T16:44:29.018Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats
[2020-07-13T16:44:30.403Z] runbld>>> Storing build metadata: 
[2020-07-13T16:44:30.403Z] runbld>>> Adding test report.
[2020-07-13T16:44:30.403Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats
[2020-07-13T16:44:30.973Z] runbld>>> Found 111 test output files
[2020-07-13T16:44:31.549Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-07-13T16:44:31.549Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-07-13T16:44:31.549Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-07-13T16:44:31.550Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-07-13T16:44:31.550Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-07-13T16:44:33.009Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-07-13T16:44:33.009Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19685/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-07-13T16:44:33.009Z] runbld>>> Test output logs contained: Errors: 0 Failures: 1 Tests: 10372 Skipped: 1334
[2020-07-13T16:44:33.288Z] runbld>>> Storing result
[2020-07-13T16:44:33.288Z] runbld>>> FAILURES: 1
[2020-07-13T16:44:33.555Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-13T16:44:33.555Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200713164427-F6AF7A74
[2020-07-13T16:44:33.824Z] runbld>>> Email notification disabled by environment variable.
[2020-07-13T16:44:33.824Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-13T16:44:36.203Z] Body did not finish within grace period; terminating with extreme prejudice
[2020-07-13T16:44:36.358Z] ERROR: runbld post build action failed.
[2020-07-13T16:44:36.358Z] Timeout has been exceeded
[2020-07-13T16:44:37.445Z] Running on worker-395930 in /var/lib/jenkins/workspace/Beats_beats_PR-19685
[2020-07-13T16:44:37.776Z] [INFO] getVaultSecret: Getting secrets
[2020-07-13T16:44:38.023Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-13T16:44:40.753Z] + chmod 755 generate-build-data.sh
[2020-07-13T16:44:40.753Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19685/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19685/runs/2 ABORTED 9352387
[2020-07-13T16:44:40.753Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19685/runs/2/steps/?limit=10000 -o steps-info.json
[2020-07-13T16:44:46.115Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19685/runs/2/tests/?status=FAILED -o tests-errors.json
[2020-07-13T16:44:47.637Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19685/runs/2/log/ -o pipeline-log.txt

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.

3 participants