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 #18683 to 7.x: LIBBEAT: Enhancement Convert dissected values from String to other basic data types and IP #19838

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Jul 13, 2020

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

What does this PR do?

This PR enhances dissect processor to convert string values to integer, long, float, double, boolean or IP. Key and convert data type are separated by | separator.

Why is it important?

It will save CPU cycles converting data from string to other data type using Convert processor

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

Added unit and benchmark test cases.

Related issues

Closes elastic/dissect-specification#10

@sayden sayden added [zube]: In Review backport Team:Integrations Label for the Integrations team Team:Services (Deprecated) Label for the former Integrations-Services team labels Jul 13, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 13, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@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 Jul 13, 2020
@sayden sayden self-assigned this Jul 13, 2020
- Add the `ignore_failure` configuration option to the dissect processor. {pull}19464[19464]
- Add the `overwrite_keys` configuration option to the dissect processor. {pull}19464[19464]
- Add support to trim captured values in the dissect processor. {pull}19464[19464]
- Added the `max_cached_sessions` option to the script processor. {pull}19562[19562]
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra entries :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh please, sorry

@@ -232,3 +232,179 @@ func TestErrorFlagging(t *testing.T) {
assert.Error(t, err)
})
}

func TestIgnoreFailure(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These lines are coming from #19685. Maybe we should get that merged first (ping @adriansr) so this backport PR here becomes cleaner?

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh sorry I missed this before approving...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woaw! Good catch! You really impressed me 😃

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm, now it seems like we are completely missing TestProcessorConvert in this backport?

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 13, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19838 updated]

  • Start Time: 2020-07-14T08:24:14.179+0000

  • Duration: 122 min 17 sec

Test stats 🧪

Test Results
Failed 2
Passed 9216
Skipped 1401
Total 10619

Test errors

Expand to view the tests failures

  • Name: Build and Test / Metricbeat Mac OS X / TestFetch – filesystem

    • Age: 2
    • Duration: 0
    • Error Details: Failed
  • Name: Build and Test / Metricbeat Mac OS X / TestFetch – fsstat

    • Age: 2
    • Duration: 0
    • Error Details: Failed

Steps errors

Expand to view the steps failures

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 3 min 49 sec

    • Start Time: 2020-07-14T08:50:41.443+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-14T09:00:38.690+0000

    • log

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 4 min 25 sec

    • Start Time: 2020-07-14T08:50:20.886+0000

    • log

  • Name: Make -C generator/_templates/metricbeat test-package

    • Description: make -C generator/_templates/metricbeat test-package

    • Duration: 7 min 27 sec

    • Start Time: 2020-07-14T08:50:27.146+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-14T10:26:04.572Z] + FILE=packetbeat/build/coverage/full.cov
[2020-07-14T10:26:04.572Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-07-14T10:26:04.572Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-14T10:26:04.572Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-07-14T10:26:04.572Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-14T10:26:04.572Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-07-14T10:26:05.867Z] Failed in branch Filebeat oss
[2020-07-14T10:26:05.986Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats
[2020-07-14T10:26:06.289Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-14T10:26:06.301Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Lint
[2020-07-14T10:26:06.391Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-07-14T10:26:06.466Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-07-14T10:26:06.537Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-14T10:26:06.608Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-14T10:26:06.678Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-14T10:26:06.749Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-14T10:26:06.820Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-07-14T10:26:06.890Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-14T10:26:06.961Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-14T10:26:07.031Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-07-14T10:26:07.104Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-14T10:26:07.177Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-07-14T10:26:07.247Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-14T10:26:07.317Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-14T10:26:07.387Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-14T10:26:07.460Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-14T10:26:07.542Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-14T10:26:07.615Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-14T10:26:07.685Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-14T10:26:07.756Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-14T10:26:07.826Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-14T10:26:07.898Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-07-14T10:26:07.968Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-14T10:26:08.039Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-14T10:26:08.111Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-14T10:26:08.182Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-14T10:26:08.286Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-07-14T10:26:08.366Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-14T10:26:08.438Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Packetbeat-oss
[2020-07-14T10:26:08.510Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-07-14T10:26:08.590Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-14T10:26:08.661Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-14T10:26:08.730Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Functionbeat-Windows
[2020-07-14T10:26:08.802Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Heartbeat-Windows
[2020-07-14T10:26:08.877Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-14T10:26:08.947Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Libbeat-oss
[2020-07-14T10:26:09.017Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-07-14T10:26:09.096Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-07-14T10:26:09.166Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-14T10:26:09.241Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-14T10:26:09.322Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-14T10:26:09.398Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Filebeat-oss
[2020-07-14T10:26:09.745Z] + cat
[2020-07-14T10:26:09.745Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-14T10:26:09.745Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-14T10:26:16.335Z] runbld>>> runbld started
[2020-07-14T10:26:16.335Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-14T10:26:17.716Z] runbld>>> The following profiles matched the job 'Beats/beats/PR-19838' in order of occurrence in the config (last value wins).
[2020-07-14T10:26:19.096Z] runbld>>> Debug logging enabled.
[2020-07-14T10:26:19.096Z] runbld>>> Storing result
[2020-07-14T10:26:19.096Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-14T10:26:19.096Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200714102618-B560893A
[2020-07-14T10:26:19.096Z] runbld>>> Adding system facts.
[2020-07-14T10:26:20.036Z] runbld>>> Adding vcs info for the latest commit:  8273de03ffe1a0ddd321213344816840b1cdcad4
[2020-07-14T10:26:20.036Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-14T10:26:20.036Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-14T10:26:20.036Z] Processing JUnit reports with runbld...
[2020-07-14T10:26:20.036Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-14T10:26:20.298Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-14T10:26:20.298Z] runbld>>> DURATION: 37ms
[2020-07-14T10:26:20.298Z] runbld>>> STDOUT: 40 bytes
[2020-07-14T10:26:20.298Z] runbld>>> STDERR: 49 bytes
[2020-07-14T10:26:20.298Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-14T10:26:20.298Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats
[2020-07-14T10:26:21.240Z] runbld>>> Storing build metadata: 
[2020-07-14T10:26:21.240Z] runbld>>> Adding test report.
[2020-07-14T10:26:21.240Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats
[2020-07-14T10:26:22.176Z] runbld>>> Found 112 test output files
[2020-07-14T10:26:22.436Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-07-14T10:26:22.436Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-07-14T10:26:22.696Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-07-14T10:26:22.696Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-07-14T10:26:22.696Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-07-14T10:26:23.634Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-07-14T10:26:23.895Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19838/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-07-14T10:26:24.155Z] runbld>>> Test output logs contained: Errors: 0 Failures: 2 Tests: 10473 Skipped: 1166
[2020-07-14T10:26:24.155Z] runbld>>> Storing result
[2020-07-14T10:26:24.155Z] runbld>>> FAILURES: 2
[2020-07-14T10:26:24.725Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-14T10:26:24.725Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200714102618-B560893A
[2020-07-14T10:26:24.985Z] runbld>>> Email notification disabled by environment variable.
[2020-07-14T10:26:24.985Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-14T10:26:30.478Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-19838
[2020-07-14T10:26:30.596Z] [INFO] getVaultSecret: Getting secrets
[2020-07-14T10:26:30.691Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-14T10:26:31.552Z] + chmod 755 generate-build-data.sh
[2020-07-14T10:26:31.552Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19838/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19838/runs/3 FAILURE 7337110
[2020-07-14T10:26:31.553Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19838/runs/3/steps/?limit=10000 -o steps-info.json
[2020-07-14T10:26:33.414Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19838/runs/3/tests/?status=FAILED -o tests-errors.json
[2020-07-14T10:26:34.325Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19838/runs/3/log/ -o pipeline-log.txt

Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

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

LGTM.

@sayden sayden merged commit d26d033 into elastic:7.x Jul 14, 2020
@sayden sayden deleted the backport_18683_7.x branch October 29, 2021 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Integrations Label for the Integrations team Team:Services (Deprecated) Label for the former Integrations-Services team [zube]: Done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants