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

[logtash] align logstash logs ingestion #4206

Merged
merged 13 commits into from
Sep 21, 2022

Conversation

klacabane
Copy link
Contributor

@klacabane klacabane commented Sep 13, 2022

Summary

Closes #4048

  • Added pipeline and static tests to the logstash logs
  • Added log4j2 configuration to output to file instead of stdout and logstash configuration to trigger slowlogs
  • Updated saved search filters to look for data_stream.dataset property instead of the outdated prefix filter. Since dashboard and visualizations rely on the saved search it is the only asset that was updated functionally, but I also re-generated the other ones so we have them in the latest format

The service is set to output the logs in json, I've also verified that plaintext logs were successfully ingested and added test cases for both json and plain. You can comment this line to test plaintext.

Notes

  • When building the package we get the following warning, does this mean that references are deprecated ?

    Warning: references found in dashboard kibana/dashboard/logstash-Logs-Logstash-Log-Dashboard.json: logstash-0b1dace0-cbdb-11e7-9852-73e0a9df1bb6 (visualization), logstash-e90b7240-cbda-11e7-9852-73e0a9df1bb6 (visualization)

  • The dashboards look for fields that don't exist or are renamed. We'll need input from logstash team to know whether we need to replace or remove them

Testing

  • build logstash package (cd packages/logstash && elastic-package build -v)
  • start elastic stack elastic-package stack up -v -d --version 8.5.0-SNAPSHOT
  • start logstash service (cd packages/logstash && elastic-package service up -v)
  • launch kibana at https://localhost:5601 and add the logstash integration. The logs are located at /tmp/service_logs/logstash/logstash-json.log and /tmp/service_logs/logstash/logstash-slowlog-json.log.
  • navigate to Discover and verify both logstash.log and logstash.slowlog datasets are ingested
  • navigate to the Logstash integration Assets and verify every asset is working

Screenshot 2022-09-14 at 22 43 09

@elasticmachine
Copy link

elasticmachine commented Sep 13, 2022

💚 Build Succeeded

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

Expand to view the summary

Build stats

  • Start Time: 2022-09-21T11:06:16.637+0000

  • Duration: 12 min 28 sec

Test stats 🧪

Test Results
Failed 0
Passed 21
Skipped 0
Total 21

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Sep 13, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (2/2) 💚
Files 100.0% (6/6) 💚 2.679
Classes 100.0% (6/6) 💚 2.679
Methods 91.304% (42/46) 👍 1.552
Lines 87.558% (190/217) 👎 -3.773
Conditionals 100.0% (0/0) 💚

@klacabane klacabane added the Team:Infra Monitoring UI - DEPRECATED Label for the Infrastructure Monitoring UI team. - DEPRECATED - Use Team:obs-ux-infra_services label Sep 14, 2022
@klacabane klacabane marked this pull request as ready for review September 14, 2022 20:45
@klacabane klacabane requested a review from a team as a code owner September 14, 2022 20:45
@klacabane
Copy link
Contributor Author

/test

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

Had some thoughts from initial visual review.

packages/logstash/data_stream/log/manifest.yml Outdated Show resolved Hide resolved
@@ -39,6 +43,6 @@
- name: text
type: text
- name: plugin_params_object
type: object
type: flattened
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@klacabane klacabane Sep 15, 2022

Choose a reason for hiding this comment

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

Good catch. For context, I caught that with the system tests (they run locally but fail in CI, we'll investigate it in #4008) which fail when ingested documents have properties undefined in the mappings and in that case it was the nested properties under plugin_params_object. Because the properties are not fixed (they're dependent on the slow plugin) I thought flattened type would be a good use case here. We can try to map each potential nested property but that does not scale

"timeRestore": false,
"title": "[Logs Logstash] Logstash Logs",
"version": 1
},
"coreMigrationVersion": "7.15.0",
"coreMigrationVersion": "8.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

This has me questioning what happens when we start to mix kibana & package versions. Since we're kibana.version: ^8.5.0 though it should be fine here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you clarify the concern ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm imagining we might re-export dashboards from something later, say 8.9, but forget to bump the manifest version. Then it'll allow installation on 8.5 even though the dashboards probably won't import.

Copy link
Contributor Author

@klacabane klacabane Sep 16, 2022

Choose a reason for hiding this comment

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

The toolchain runs a test suite that ensures the assets can be installed so that will be caught by CI

Failure example

Error: error running package asset tests: could not complete test run: can't install the package: can't install the package: could not install package; API status code = 422; response body = {"statusCode":422,"error":"Unprocessable Entity","message":"Document "logstash-Logs-Logstash-Log-Dashboard" has property "dashboard" which belongs to a more recent version of Kibana [8.6.0]. The last known version is [8.5.0]"}

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

Assets are all looking good after import/setup

Screen Shot 2022-09-15 at 17 11 00

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

I've noticed that on the readme, it still says that logstash is compatible with 7.3 or later. Should we change this here or on a follow-up PR?

@klacabane
Copy link
Contributor Author

Should we change this here or on a follow-up PR?

I've updated the support version for now but we should review the readme separately

@elasticmachine
Copy link

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM!

@klacabane klacabane merged commit e0853b5 into elastic:main Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:logstash Logstash Team:Infra Monitoring UI - DEPRECATED Label for the Infrastructure Monitoring UI team. - DEPRECATED - Use Team:obs-ux-infra_services v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[logstash] Verify logs mappings and pipelines
4 participants