Skip to content

Commit 736eb8a

Browse files
committed
[kubernetes] adds beta support for rotated logs
Enables the collection of rotated log files, including GZIP-compressed files, for Kubernetes container logs. This enhancement introduces new configuration options to control the ingestion of rotated logs, including specifying paths for the rotated logs and enabling GZIP decompression.
1 parent 024c12d commit 736eb8a

File tree

4 files changed

+53
-12
lines changed

4 files changed

+53
-12
lines changed

packages/kubernetes/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.82.0"
3+
changes:
4+
- description: Add beta support to collect rotated (including GZIP) logs.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/99999
27
- version: "1.81.0"
38
changes:
49
- description: Support for collecting audit logs from cloud providers.

packages/kubernetes/data_stream/container_logs/agent/stream/stream.yml.hbs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ paths:
1414
{{#each paths}}
1515
- {{this}}
1616
{{/each}}
17+
{{#if rotated_logs}}
18+
{{#each rotated_logs_paths}}
19+
- {{this}}
20+
{{/each}}
21+
{{/if}}
22+
23+
{{#if rotated_logs}}
24+
gzip_experimental: true
25+
{{/if}}
1726
data_stream:
1827
dataset: {{data_stream.dataset}}
1928
prospector.scanner.symlinks: {{ symlinks }}

packages/kubernetes/data_stream/container_logs/manifest.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,62 @@ streams:
66
title: Collect Kubernetes container logs
77
description: Collect Kubernetes container logs
88
vars:
9+
- name: symlinks
10+
type: bool
11+
title: Use Symlinks
12+
multi: false
13+
required: true
14+
show_user: true
15+
default: true
16+
- name: data_stream.dataset
17+
required: true
18+
default: kubernetes.container_logs
19+
title: Dataset name
20+
description: >
21+
Set the name for your dataset. Changing the dataset will send the data to a different index. For more info look at [data_stream field](https://www.elastic.co/guide/en/ecs/master/ecs-data_stream.html).
22+
type: text
23+
924
- name: paths
1025
type: text
1126
required: true
27+
show_user: false
1228
title: Kubernetes container log path
1329
multi: true
1430
default:
15-
- /var/log/containers/*${kubernetes.container.id}.log
31+
- /var/log/containers/*${kubernetes.container.id}.log.*
1632
description: >-
1733
For every container the Elastic-Agent can see (usually every
1834
container on the node) an instance of the input will be
1935
created harvesting all paths defined here, even if
2036
the paths contain no variable! Refer to the [integration
2137
documentation](https://www.elastic.co/guide/en/integrations/current/kubernetes.html)
2238
for more details.
23-
- name: symlinks
39+
40+
- name: rotated_logs
2441
type: bool
25-
title: Use Symlinks
42+
title: Include rotated log files
2643
multi: false
27-
required: true
28-
show_user: true
44+
required: false
45+
show_user: false
2946
default: true
30-
- name: data_stream.dataset
47+
description: |
48+
When enabled, Elastic-Agent will also ingest the rotated log files for each pod, including GZIP-compressed files (.gz), decompressing them as they are read. This is beta feature. For full details, see the [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream#reading-gzip-files). Available for Elastic Agent 9.2.0 and newer.
49+
- name: rotated_logs_paths
50+
type: text
3151
required: true
32-
default: kubernetes.container_logs
33-
title: Dataset name
34-
description: >
35-
Set the name for your dataset. Changing the dataset will send the data to a different index. For more info look at [data_stream field](https://www.elastic.co/guide/en/ecs/master/ecs-data_stream.html).
52+
show_user: false
53+
title: Kubernetes container rotated log path
54+
multi: true
55+
default:
56+
- /var/log/pods/${kubernetes.namespace}_${kubernetes.pod.name}_${kubernetes.pod.uid}/${kubernetes.container.name}/*.log.*
57+
description: >-
58+
For every container the Elastic-Agent can see (usually every
59+
container on the node) an instance of the input will be
60+
created harvesting all paths defined here, even if
61+
the paths contain no variable! Refer to the [integration
62+
documentation](https://www.elastic.co/guide/en/integrations/current/kubernetes.html)
63+
for more details.
3664
37-
type: text
3865
- name: containerParserStream
3966
type: text
4067
title: Container parser's stream configuration

packages/kubernetes/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: 3.1.2
22
name: kubernetes
33
title: Kubernetes
4-
version: 1.81.0
4+
version: 1.82.0
55
description: Collect logs and metrics from Kubernetes clusters with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)