-
Couldn't load subscription status.
- Fork 128
Add logstash to serverless provider #1646
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f89a505
Add logstash to serverless provider
bhapas b87d4af
Fix pr comments
bhapas b744397
Fix ES host and credentials for serverless
bhapas b687352
move config check to projectsettings
bhapas cad9fb7
Add connections between agent logstash and es
bhapas 283ab98
Enable ssl in agent for local stack
bhapas 74abca7
Enable ssl communication between logstash and agent
bhapas ed6160e
Create clients when a project already exists during boot up
bhapas f8680bc
fix PR comments
bhapas 9ef0ad3
fix pr comments
bhapas 5456fd6
Refactor and add code comment
bhapas 2419b43
fix pr comments
bhapas f284dbe
Merge remote-tracking branch 'upstream/main' into logstash-serverless
bhapas 7cfd60b
change variable and add comment
bhapas 3b5256c
fix pr comments
bhapas 35161e2
fix pr comments
bhapas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| version: '2.3' | ||
| services: | ||
| elastic-agent: | ||
| image: "{{ fact "agent_image" }}" | ||
| healthcheck: | ||
| test: "elastic-agent status" | ||
| timeout: 2s | ||
| start_period: 360s | ||
| retries: 180 | ||
| interval: 5s | ||
| hostname: docker-fleet-agent | ||
| env_file: "./elastic-agent.env" | ||
| volumes: | ||
| - type: bind | ||
| source: ../../../tmp/service_logs/ | ||
| target: /tmp/service_logs/ | ||
| # Mount service_logs under /run too as a testing workaround for the journald input (see elastic-package#1235). | ||
| - type: bind | ||
| source: ../../../tmp/service_logs/ | ||
| target: /run/service_logs/ | ||
| - "../certs/ca-cert.pem:/etc/ssl/certs/elastic-package.pem" | ||
|
|
||
| elastic-agent_is_ready: | ||
| image: tianon/true | ||
| depends_on: | ||
| elastic-agent: | ||
| condition: service_healthy | ||
|
|
||
| {{ $logstash_enabled := fact "logstash_enabled" }} | ||
| {{ if eq $logstash_enabled "true" }} | ||
| logstash: | ||
| image: "{{ fact "logstash_image" }}" | ||
| healthcheck: | ||
| test: bin/logstash -t | ||
| interval: 60s | ||
| timeout: 50s | ||
| retries: 5 | ||
| # logstash expects the key in pkcs8 format. Hence converting the key.pem to pkcs8 format using openssl. | ||
| # Also logstash-filter-elastic_integration plugin is installed by default to run ingest pipelines in logstash. | ||
| # elastic-package#1637 made improvements to enable logstash stats through port 9600. | ||
| command: bash -c 'openssl pkcs8 -inform PEM -in /usr/share/logstash/config/certs/key.pem -topk8 -nocrypt -outform PEM -out /usr/share/logstash/config/certs/logstash.pkcs8.key && chmod 777 /usr/share/logstash/config/certs/logstash.pkcs8.key && 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 && bin/logstash -f /usr/share/logstash/pipeline/logstash.conf' | ||
bhapas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| volumes: | ||
| - "../certs/logstash:/usr/share/logstash/config/certs" | ||
| - "./logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro" | ||
| ports: | ||
| - "127.0.0.1:5044:5044" | ||
| - "127.0.0.1:9600:9600" | ||
| environment: | ||
| - xpack.monitoring.enabled=false | ||
| - ELASTIC_USER={{ fact "username" }} | ||
| - ELASTIC_PASSWORD={{ fact "password" }} | ||
| - ELASTIC_HOSTS={{ fact "elasticsearch_host" }} | ||
|
|
||
| logstash_is_ready: | ||
| image: tianon/true | ||
| depends_on: | ||
| logstash: | ||
| condition: service_healthy | ||
| {{ end }} | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| input { | ||
| elastic_agent { | ||
| port => 5044 | ||
| ssl_enabled => true | ||
mrodm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca-cert.pem"] | ||
| ssl_certificate => "/usr/share/logstash/config/certs/cert.pem" | ||
| ssl_key => "/usr/share/logstash/config/certs/logstash.pkcs8.key" | ||
| } | ||
| } | ||
|
|
||
|
|
||
| filter { | ||
| elastic_integration { | ||
| remove_field => ['@version'] | ||
| hosts => ["{{ fact "elasticsearch_host" }}"] | ||
| username => '{{ fact "username" }}' | ||
| password => '{{ fact "password" }}' | ||
| ssl_enabled => true | ||
| ssl_verification_mode => "full" | ||
| } | ||
| } | ||
|
|
||
|
|
||
| output { | ||
| elasticsearch { | ||
| hosts => ["{{ fact "elasticsearch_host" }}"] | ||
| user => '{{ fact "username" }}' | ||
| password => '{{ fact "password" }}' | ||
| ssl_enabled => true | ||
| data_stream => "true" | ||
bhapas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.