-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add filebeat module envoyproxy for Envoy access logs
- Loading branch information
Ray Qiu
authored
Apr 17, 2019
1 parent
872d7fc
commit 03e316e
Showing
27 changed files
with
1,875 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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.