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
| `exclude_truncated` | When present, it excludes truncated logs and does not send to Datadog. |
278
-
279
-
For example, to **filter out** truncated logs:
280
-
281
-
{{< tabs >}}
282
-
{{% tab "Configuration file" %}}
283
-
284
-
```yaml
285
-
logs:
286
-
- type: file
287
-
path: /my/test/file.log
288
-
service: cardpayment
289
-
source: java
290
-
log_processing_rules:
291
-
- type: exclude_truncated
292
-
```
293
-
294
-
{{% /tab %}}
295
-
{{% tab "Docker" %}}
296
-
297
-
In a Docker environment, use the label `com.datadoghq.ad.logs` on the container that is sending the logs you want to filter, to specify the `log_processing_rules`. For example:
298
-
299
-
```yaml
300
-
labels:
301
-
com.datadoghq.ad.logs: >-
302
-
[{
303
-
"source": "java",
304
-
"service": "cardpayment",
305
-
"log_processing_rules": [{
306
-
"type": "exclude_truncated"
307
-
}]
308
-
}]
309
-
```
310
-
311
-
**Note**: The label value must follow JSON syntax, which means you should not include any trailing commas or comments.
312
-
313
-
{{% /tab %}}
314
-
{{% tab "Kubernetes" %}}
315
-
316
-
In a Kubernetes environment, use the pod annotation `ad.datadoghq.com` on your pod to specify the `log_processing_rules`. For example:
317
-
318
-
```yaml
319
-
apiVersion: apps/v1
320
-
metadata:
321
-
name: cardpayment
322
-
spec:
323
-
selector:
324
-
matchLabels:
325
-
app: cardpayment
326
-
template:
327
-
metadata:
328
-
annotations:
329
-
ad.datadoghq.com/<CONTAINER_NAME>.logs: >-
330
-
[{
331
-
"source": "java",
332
-
"service": "cardpayment",
333
-
"log_processing_rules": [{
334
-
"type": "exclude_truncated"
335
-
}]
336
-
}]
337
-
labels:
338
-
app: cardpayment
339
-
name: cardpayment
340
-
spec:
341
-
containers:
342
-
- name: '<CONTAINER_NAME>'
343
-
image: cardpayment:latest
344
-
```
345
-
346
-
**Note**: The annotation value must follow JSON syntax, which means you should not include any trailing commas or comments.
347
-
348
-
{{% /tab %}}
349
-
{{< /tabs >}}
350
-
351
272
## Scrub sensitive data from your logs
352
273
353
274
If your logs contain sensitive information that need redacting, configure the Datadog Agent to scrub sensitive sequences by using the `log_processing_rules` parameter in your configuration file with the `mask_sequences` type.
0 commit comments