Skip to content
This repository was archived by the owner on Feb 5, 2021. It is now read-only.

Commit 00a04f4

Browse files
committed
rewrite docs for metadata_reduce
1 parent b2b1ebc commit 00a04f4

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

README.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Environment | Variable Description
100100
`FLUENTD_USER_CONFIG_DIR`|A directory of user-defined fluentd configuration files, which must be in the `*.conf` directory in the container.
101101
`FLUSH_INTERVAL` |How frequently to push logs to Sumo.<br/><br/>Default: `5s`
102102
`KUBERNETES_META`|Include or exclude Kubernetes metadata such as `namespace` and `pod_name` if using JSON log format. <br/><br/>Default: `true`
103-
`KUBERNETES_META_REDUCE`| Reduces Kubernetes metadata, check [Reducing Kubernetes Metadata](#####reduce-kubernetes-metadata-using-annotations). <br></br>Default: `false`
103+
`KUBERNETES_META_REDUCE`| Reduces redundant Kubernetes metadata, see [_Reducing Kubernetes Metadata_](#reducing-kubernetes-metadata). <br></br>Default: `false`
104104
`LOG_FORMAT`|Format in which to post logs to Sumo. Allowable values:<br/><br/>`text`—Logs will appear in SumoLogic in text format.<br/>`json`—Logs will appear in SumoLogic in json format.<br/>`json_merge`—Same as json but if the container logs in json format to stdout it will merge in the container json log at the root level and remove the log field.<br/><br/>Default: `json`
105105
`MULTILINE_START_REGEXP`|The regular expression for the `concat` plugin to use when merging multi-line messages. Defaults to Julian dates, for example, Jul 29, 2017.
106106
`NUM_THREADS`|Set the number of HTTP threads to Sumo. It might be necessary to do so in heavy-logging clusters. <br/><br/>Default: `1`
@@ -147,10 +147,29 @@ The following table show which environment variables affect which Fluentd sourc
147147
### FluentD stops processing logs
148148
When dealing with large volumes of data (TB's from what we have seen), FluentD may stop processing logs, but continue to run. This issue seems to be caused by the [scalability of the inotify process](https://github.com/fluent/fluentd/issues/1630) that is packaged with the FluentD in_tail plugin. If you encounter this situation, setting the `ENABLE_STAT_WATCHER` to `false` should resolve this issue.
149149

150-
### Override environment variables using annotations
151-
You can override the `LOG_FORMAT`, `KUBERNETES_META_REDUCE`, `SOURCE_CATEGORY` and `SOURCE_NAME` environment variables, per pod, using [Kubernetes annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/). For example:
150+
### Reducing Kubernetes metadata
152151

153-
```
152+
You can use the `KUBERNETES_META_REDUCE` environment variable (global) or the `sumologic.com/kubernetes_meta_reduce` annotation (per pod) to reduce the amount of Kubernetes metadata included with each log line under the `kubernetes` field.
153+
154+
When set, FluentD will remove the following properties:
155+
156+
* `pod_id`
157+
* `container_id`
158+
* `namespace_id`
159+
* `master_url`
160+
* `labels`
161+
* `annotations`
162+
163+
Logs will still include:
164+
165+
* `pod_name`
166+
* `container_name`
167+
* `namespace_name`
168+
* `host`
169+
170+
These fields still allow you to uniquely identify a pod and look up additional details with the Kubernetes API.
171+
172+
```yaml
154173
apiVersion: v1
155174
kind: ReplicationController
156175
metadata:
@@ -165,10 +184,7 @@ spec:
165184
labels:
166185
app: mywebsite
167186
annotations:
168-
sumologic.com/format: "text"
169187
sumologic.com/kubernetes_meta_reduce: "true"
170-
sumologic.com/sourceCategory: "mywebsite/nginx"
171-
sumologic.com/sourceName: "mywebsite_nginx"
172188
spec:
173189
containers:
174190
- name: nginx
@@ -177,9 +193,10 @@ spec:
177193
- containerPort: 80
178194
```
179195
180-
### Reduce Kubernetes Metadata using annotations
181-
You can also use the "sumologic.com/kubernetes_meta_reduce" annotation to exclude `pod_id`,
182-
`container_id`, `namespace_id`, `namespace_name`, `master_url` and `labels` from Kubernetes Metadata.
196+
197+
### Override environment variables using annotations
198+
You can override the `LOG_FORMAT`, `KUBERNETES_META_REDUCE`, `SOURCE_CATEGORY` and `SOURCE_NAME` environment variables, per pod, using [Kubernetes annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/). For example:
199+
183200
```
184201
apiVersion: v1
185202
kind: ReplicationController
@@ -195,7 +212,10 @@ spec:
195212
labels:
196213
app: mywebsite
197214
annotations:
215+
sumologic.com/format: "text"
198216
sumologic.com/kubernetes_meta_reduce: "true"
217+
sumologic.com/sourceCategory: "mywebsite/nginx"
218+
sumologic.com/sourceName: "mywebsite_nginx"
199219
spec:
200220
containers:
201221
- name: nginx

0 commit comments

Comments
 (0)