-
Notifications
You must be signed in to change notification settings - Fork 5k
Filebeat envoyproxy module #11700
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
Filebeat envoyproxy module #11700
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c882ffa
Add filebeat module envoyproxy
09be695
Add filebeat module envoyproxy
6dd025a
Add both json and plaintext processing pipelines
c40e8d9
Make upstream_service_time nanoseconds
9cf4911
Update envoy tcp proxy case
c2d3b09
Fix a typo in docs
b7304ef
Fix a typo in docs
7817fb3
Update README.md
236bf8f
Fix references
5de2679
Update CHANGELOG.next.asciidoc
cfba046
Remove dashboard reference
8c1e3cf
Remove dashboard reference
ebd78c0
Consolidate and simplify pipelines
f470730
Add proxy_type field. Add overview dashboard
3386ecc
Regenerate test result files
e80bb01
Change back to /var/log/envoy.log
5fc0df9
Fix some documentation related issues
98c9aab
Update README
d754d9b
Fix a typo
0515d2f
Merge branch 'master' into filebeat-envoy
0f2ee2a
Update CHANGELOG.next.asciidoc
b15ed7b
Fix documentation
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,35 @@ | ||
| //// | ||
| This file is generated! See scripts/docs_collector.py | ||
| //// | ||
|
|
||
| [[filebeat-module-envoyproxy]] | ||
| [role="xpack"] | ||
|
|
||
| :modulename: envoyproxy | ||
| :has-dashboards: true | ||
|
|
||
| == Envoyproxy Module | ||
|
|
||
| This is a filebeat module for Envoy proxy access log (https://www.envoyproxy.io/docs/envoy/v1.10.0/configuration/access_log). It supports both standalone deployment and Envoy proxy deployment in Kubernetes. | ||
|
|
||
| [float] | ||
| === Compatibility | ||
|
|
||
| Although this module has been developed against Envoy proxy 1.10.0 and Kubernetes v1.13.x, it is expected to work | ||
| with other versions of Envoy proxy and Kubernetes. | ||
|
|
||
| [float] | ||
| === Example dashboard | ||
|
|
||
| This module comes with a sample dashboard. | ||
|
|
||
| [role="screenshot"] | ||
| image::./images/kibana-envoyproxy.jpg[] | ||
|
|
||
|
|
||
| [float] | ||
| === Fields | ||
|
|
||
| For a description of each field in the module, see the | ||
| <<exported-fields-envoyproxy,exported fields>> section. | ||
|
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,124 @@ | ||
| # Envoyproxy Module | ||
|
|
||
| This is a filebeat module for Envoy proxy access log. | ||
|
|
||
| ## Caveats | ||
|
|
||
| * Module is to be considered _beta_. | ||
|
|
||
| ## Download and install Filebeat | ||
|
|
||
| Grab the filebeat binary from elastic.co, and install it by following the instructions. | ||
|
|
||
| ## Deployment Scenario #1: envoy native deployment | ||
|
|
||
| This module assumes that envoy log entries will be written to /var/log/envoy.log. Should it be not the case, please point the module log path to the path of the log file. | ||
|
|
||
| Update filebeat.yml to point to Elasticsearch and Kibana. | ||
| Setup Filebeat. | ||
| ``` | ||
| ./filebeat setup --modules envoyproxy -e | ||
| ``` | ||
|
|
||
| Enable the Filebeat envoyproxy module | ||
| ``` | ||
| ./filebeat modules enable envoyproxy | ||
| ``` | ||
|
|
||
| Start Filebeat | ||
| ``` | ||
| ./filebeat -e | ||
| ``` | ||
|
|
||
| Now, the Envoy logs and dashboard should appear in Kibana. | ||
|
|
||
|
|
||
| ## Deployment Scenario #2: envoy for kubernetes | ||
|
|
||
| For Kubernetes deployment, the filebeat daemon-set yaml file needs to be deployed to the Kubernetes cluster. Sample configuration files is provided under the `beats/deploy/filebeat` directory (https://github.com/elastic/beats/tree/master/deploy/kubernetes/filebeat), and can be deployed by doing the following: | ||
| ``` | ||
| kubectl apply -f filebeat | ||
| ``` | ||
|
|
||
| #### Note the following section in the ConfigMap, make changes to the yaml file if necessary | ||
| ``` | ||
| filebeat.autodiscover: | ||
| providers: | ||
| - type: kubernetes | ||
| hints.enabled: true | ||
| default.disable: true | ||
|
|
||
| processors: | ||
| - add_kubernetes_metadata: | ||
| in_cluster: true | ||
| ``` | ||
|
|
||
| This enables auto-discovery and hints for filebeat. When default.disable is set to true (default value is false), it will disable log harvesting for the pod/container, unless it has specific annotations enabled. This gives users more granular control on kubernetes log ingestion. The `add_kubernetes_metadata` processor will add enrichment data for Kubernetes to the ingest logs. | ||
|
|
||
| #### Note the following section in the DaemonSet, make changes to the yaml file if necessary | ||
| ``` | ||
| apiVersion: extensions/v1beta1 | ||
| kind: DaemonSet | ||
| metadata: | ||
| name: filebeat | ||
| namespace: kube-system | ||
| labels: | ||
| k8s-app: filebeat | ||
| spec: | ||
| template: | ||
| metadata: | ||
| labels: | ||
| k8s-app: filebeat | ||
| spec: | ||
| serviceAccountName: filebeat | ||
| terminationGracePeriodSeconds: 30 | ||
| containers: | ||
| - name: filebeat | ||
| image: docker.elastic.co/beats/filebeat:%VERSION% | ||
| args: [ | ||
| "sh", "-c", "filebeat setup -e --modules envoyproxy -c /etc/filebeat.yml && filebeat -e -c /etc/filebeat.yml" | ||
| ] | ||
| env: | ||
| # Edit the following values to reflect your setup accordingly | ||
| - name: ELASTICSEARCH_HOST | ||
| value: 192.168.99.1 | ||
| - name: ELASTICSEARCH_USERNAME | ||
| value: elastic | ||
| - name: ELASTICSEARCH_PASSWORD | ||
| value: changeme | ||
| - name: KIBANA_HOST | ||
| value: 192.168.99.1 | ||
| ``` | ||
|
|
||
| The module setup step can also be done separately without Kubernetes if applicable, and in that case, the args can be simplified to: | ||
| ``` | ||
| args: [ | ||
| "sh", "-c", "filebeat -e -c /etc/filebeat.yml" | ||
| ] | ||
| ``` | ||
|
|
||
| #### Sample Deployment for envoy, using ambassador as an example. Note the annotations. | ||
|
|
||
| ``` | ||
| apiVersion: extensions/v1beta1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: ambassador | ||
| spec: | ||
| replicas: 3 | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| "co.elastic.logs/module": "envoyproxy" | ||
| "co.elastic.logs/fileset": "log" | ||
| "co.elastic.logs/disable": "false" | ||
| labels: | ||
| service: ambassador | ||
| spec: | ||
| serviceAccountName: ambassador | ||
| containers: | ||
| - name: ambassador | ||
| image: quay.io/datawire/ambassador:0.50.0 | ||
| <snipped> | ||
| ``` | ||
|
|
||
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,8 @@ | ||
| - module: envoyproxy | ||
| # Fileset for native deployment | ||
| log: | ||
| enabled: true | ||
|
|
||
| # Set custom paths for the log files. If left empty, | ||
| # Filebeat will choose the paths depending on your OS. | ||
| #var.paths: |
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,22 @@ | ||
| [role="xpack"] | ||
|
|
||
| :modulename: envoyproxy | ||
| :has-dashboards: true | ||
|
|
||
| == Envoyproxy Module | ||
|
|
||
| This is a filebeat module for Envoy proxy access log (https://www.envoyproxy.io/docs/envoy/v1.10.0/configuration/access_log). It supports both standalone deployment and Envoy proxy deployment in Kubernetes. | ||
|
|
||
| [float] | ||
| === Compatibility | ||
|
|
||
| Although this module has been developed against Envoy proxy 1.10.0 and Kubernetes v1.13.x, it is expected to work | ||
| with other versions of Envoy proxy and Kubernetes. | ||
|
|
||
| [float] | ||
| === Example dashboard | ||
|
|
||
| This module comes with a sample dashboard. | ||
|
|
||
| [role="screenshot"] | ||
| image::./images/kibana-envoyproxy.jpg[] |
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,45 @@ | ||
| - key: envoyproxy | ||
| title: Envoyproxy | ||
| description: > | ||
| Module for handling logs produced by envoy | ||
| fields: | ||
| - name: envoyproxy | ||
| type: group | ||
| description: > | ||
| Fields from envoy proxy logs after normalization | ||
| fields: | ||
| - name: log_type | ||
| type: keyword | ||
| description: > | ||
| Envoy log type, normally ACCESS | ||
|
|
||
| - name: response_flags | ||
| type: keyword | ||
| description: > | ||
| Response flags | ||
|
|
||
| - name: upstream_service_time | ||
| type: long | ||
| format: duration | ||
| input_format: nanoseconds | ||
| description: > | ||
| Upstream service time in nanoseconds | ||
|
|
||
| - name: request_id | ||
| type: keyword | ||
| description: > | ||
| ID of the request | ||
|
|
||
| - name: authority | ||
| type: keyword | ||
| description: > | ||
| Envoy proxy authority field | ||
|
|
||
| - name: proxy_type | ||
| type: keyword | ||
| description: > | ||
| Envoy proxy type, tcp or http | ||
|
|
||
|
|
||
|
|
||
|
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.