You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Configuration for Kubernetes metadata filtering in the logging agent
75
+
76
+
You can configure the logging agent to filter log lines according to the Kubernetes resources metadata by setting the exclusion and inclusion parameters.
77
+
78
+
For example, to set the agent to return all log lines coming from the `default` Kubernetes namespace and exclude anything with a label `app.kubernetes.io/name` with value `sample-app` or an annotation `annotation.user` with value `sample-user`, include these parameters:
For more information, see [Configuration for Kubernetes Metadata Filtering](https://github.com/logdna/logdna-agent-v2/blob/3.8/docs/KUBERNETES.md#configuration-for-kubernetes-metadata-filtering).
95
+
73
96
## Required IAM access policies
74
97
You need the following permissions to run this module.
75
98
@@ -125,6 +148,8 @@ No modules.
125
148
| <aname="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id)| Cluster id to add to agents to |`string`| n/a | yes |
126
149
| <aname="input_cluster_resource_group_id"></a> [cluster\_resource\_group\_id](#input\_cluster\_resource\_group\_id)| Resource group of the cluster |`string`| n/a | yes |
127
150
| <aname="input_logdna_add_cluster_name"></a> [logdna\_add\_cluster\_name](#input\_logdna\_add\_cluster\_name)| If true, configure the logdna agent to attach a tag containing the cluster name to all log messages. |`bool`|`true`| no |
151
+
| <aname="input_logdna_agent_custom_line_exclusion"></a> [logdna\_agent\_custom\_line\_exclusion](#input\_logdna\_agent\_custom\_line\_exclusion)| LogDNA agent custom configuration for line exclusion setting LOGDNA\_K8S\_METADATA\_LINE\_EXCLUSION. |`string`|`null`| no |
152
+
| <aname="input_logdna_agent_custom_line_inclusion"></a> [logdna\_agent\_custom\_line\_inclusion](#input\_logdna\_agent\_custom\_line\_inclusion)| LogDNA agent custom configuration for line inclusion setting LOGDNA\_K8S\_METADATA\_LINE\_INCLUSION. |`string`|`null`| no |
128
153
| <aname="input_logdna_agent_tags"></a> [logdna\_agent\_tags](#input\_logdna\_agent\_tags)| array of tags to group the host logs pushed by the logdna agent |`list(string)`|`[]`| no |
129
154
| <aname="input_logdna_agent_version"></a> [logdna\_agent\_version](#input\_logdna\_agent\_version)| Version of the agent to deploy. To lookup version run: `ibmcloud cr images --restrict ext/logdna-agent`. If null, the default value is used. |`string`|`"3.8.9-20231113.3d09f4dc47c1f590"`| no |
130
155
| <aname="input_logdna_enabled"></a> [logdna\_enabled](#input\_logdna\_enabled)| Deploy IBM Cloud Logging agent |`bool`|`true`| no |
An end to end example using the module's default variable values.
3
+
An end-to-end example that uses the module's default variable values.
4
+
5
+
The example sets up the logging agent for [Kubernetes metadata filtering](https://github.com/logdna/logdna-agent-v2/blob/3.8/docs/KUBERNETES.md#configuration-for-kubernetes-metadata-filtering).
6
+
7
+
The example configures the agent to include all log lines coming from the `default` Kubernetes namespace and excludes anything with a label `app.kubernetes.io/name` and value `sample-app` or an annotation `annotation.user` with the value `sample-user`.
# example of how to include / exclude metrics - more info https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_log_metrics
116
116
sysdig_metrics_filter=[{ type ="exclude", name ="metricA.*" }, { type ="include", name ="metricB.*" }]
117
117
sysdig_agent_tags=var.resource_tags
118
+
# LogDNA agent custom settings to setup Kubernetes metadata logs filtering by setting
119
+
# LOGDNA_K8S_METADATA_LINE_INCLUSION and LOGDNA_K8S_METADATA_LINE_EXCLUSION in the agent daemonset definition
0 commit comments