-
Notifications
You must be signed in to change notification settings - Fork 127
Pre-build logstash image with plugin and configuration #1687
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
Conversation
| command: bash /usr/share/logstash/startup.sh | ||
| volumes: | ||
| - "../certs/logstash:/usr/share/logstash/config/certs" | ||
| - "../certs/elasticsearch/cert.pem:/usr/share/logstash/config/certs/elasticsearch.pem:ro" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was creating a file owned by root in the user profile, we should avoid writing there.
|
It breaks serverless now, I will fix it. |
| Mode: resource.FileMode(0755), | ||
| Path: "Dockerfile.logstash", | ||
| Content: staticSource.File("_static/Dockerfile.logstash"), | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also another reference to this file in serverlessresources.go
Trying to creaste a serverless Elastic stack raised this error:
2024/02/15 18:41:48 INFO Starting local services
Error: booting up the stack failed: failed to start local services: could not initialize compose files for local services: there where errors: template: pattern matches no files: `_static/logstash_startup.sh`
| Content: staticSource.Template("_static/logstash_startup.sh"), |
| user => '{{ fact "username" }}' | ||
| password => '{{ fact "password" }}' | ||
| ssl_enabled => true | ||
| data_stream => "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should confirm this removal with @bhapas there is document_id => "%{[@metadata][_ingest_document][id]}" in on-prems... That was a reason I leaved it as duplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The document_id was to avoid duplicate events to get ingested. It can be applied to serverless too.
| ARG IMAGE | ||
| FROM ${IMAGE} | ||
|
|
||
| RUN bin/logstash-plugin install logstash-filter-elastic_integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will pull new version of the plugin, the expectation to use as it is if plugin is bundled with current Logstash version. Wouldn't be problem with other plugins but this one is tightly coupled with ES.
| RUN bin/logstash-plugin install logstash-filter-elastic_integration | |
| RUN if [ ! "$(bin/logstash-plugin list)" = *logstash-filter-elastic_integration* ]; then \ | |
| echo "Missing plugin logstash-filter-elastic_integration, installing now."; \ | |
| bin/logstash-plugin install logstash-filter-elastic_integration; \ | |
| fi |
FYI: couldn't test if this works...
Updated the suggestion, will work I think...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change applied, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @jsoriano for a quality of work here. This is the best design.
I have pulled and tested both on-prems and serverless with Logstash. Put one comment to install the elastic_integration plugin IFF only not bundled/installed.
|
I've tried to create a This is an example of the error that I get from EDIT: the cluster created was a Serverless project. |
@mrodm I think for time series index mode cannot use the generated One way is to remove the |
I am removing it from serverless as it was before this change. In local it is not failing for me or for CI. |
💚 Build Succeeded
History
cc @jsoriano |
Polish some things in the logstash scenario:
Part of #1682.