Skip to content

Commit 35cd2cd

Browse files
committed
Update script example
1 parent 80f1f63 commit 35cd2cd

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

docs/send-data/kubernetes/collecting-logs.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,40 @@ It's possible to customize the built-in Sumo Logic metadata (like [source name][
301301

302302
```yaml
303303
sumologic:
304-
logs:
305-
container|systemd|kubelet:
306-
## Set the _sourceHost metadata field in Sumo Logic.
307-
sourceHost: ""
308-
## Set the _sourceName metadata field in Sumo Logic.
309-
sourceName: "%{namespace}.%{pod}.%{container}"
310-
## Set the _sourceCategory metadata field in Sumo Logic.
311-
sourceCategory: "%{namespace}/%{pod_name}"
312-
## Set the prefix, for _sourceCategory metadata.
313-
sourceCategoryPrefix: "kubernetes/"
314-
## Used to replace - with another character.
315-
sourceCategoryReplaceDash: "/"
304+
clusterName: my-k8s-cluster
305+
logs:
306+
container:
307+
enabled: true
308+
## Set the _sourceHost metadata field in Sumo Logic.
309+
sourceHost: "%{node}"
310+
## Set the _sourceName metadata field in Sumo Logic.
311+
sourceName: "%{namespace}.%{pod}.%{container}"
312+
## Set the _sourceCategory metadata field in Sumo Logic.
313+
sourceCategory: "%{cluster}/%{namespace}/%{pod_name}"
314+
## Set the prefix, for _sourceCategory metadata. Not able to use variables for prefix
315+
sourceCategoryPrefix: ""
316+
## Used to replace - with another character.
317+
sourceCategoryReplaceDash: "-"
318+
systemd:
319+
enabled: true
320+
## Set the _sourceName metadata field in Sumo Logic.
321+
sourceName: "k8s_systemd"
322+
## Set the _sourceCategory metadata field in Sumo Logic.
323+
sourceCategory: "%{cluster}/systemd"
324+
## Set the prefix, for _sourceCategory metadata.
325+
sourceCategoryPrefix: ""
326+
## Used to replace - with another character.
327+
sourceCategoryReplaceDash: "-"
328+
kubelet:
329+
enabled: true
330+
## Set the _sourceName metadata field in Sumo Logic.
331+
sourceName: "k8s_kubelet"
332+
## Set the _sourceCategory metadata field in Sumo Logic.
333+
sourceCategory: "%{cluster}/kubelet"
334+
## Set the prefix, for _sourceCategory metadata.
335+
sourceCategoryPrefix: ""
336+
## Used to replace - with another character.
337+
sourceCategoryReplaceDash: "-"
316338
```
317339

318340
As can be seen in the above example, these fields can contain templates of the form `%{field_name}`, where `field_name` is the name of a resource attribute. Available resource attributes include the values of `sumologic.logs.fields`, which by default are:

0 commit comments

Comments
 (0)