Skip to content

Commit

Permalink
Merge pull request #522 from logzio/release/logzio-logs-collector-1.0.6
Browse files Browse the repository at this point in the history
Release/logzio logs collector 1.0.6
  • Loading branch information
yotamloe authored Aug 12, 2024
2 parents e767030 + 163d108 commit 2962551
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 80 deletions.
2 changes: 1 addition & 1 deletion charts/logzio-logs-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: logzio-logs-collector
version: 1.0.5
version: 1.0.6
description: kubernetes logs collection agent for logz.io based on opentelemetry collector
type: application
home: https://logz.io/
Expand Down
5 changes: 5 additions & 0 deletions charts/logzio-logs-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ Multi line logs configuration
The collector supports by default various log formats (including multiline logs) such as `CRI-O` `CRI-Containerd` `Docker` formats. You can configure the chart to parse custom multiline logs pattern according to your needs, please read [Customizing Multiline Log Handling](./examples/multiline.md) guide for more details.

## Change log
* 1.0.6
- Added `varlogcontainers` volume and volume mounts
- Added new `container` operator instead of complex operator sequence
- Remove default resources `limits`
- Add default resources `requests`
* 1.0.5
- Upgrade `otel/opentelemetry-collector-contrib` image to `v0.103.0`
* 1.0.4
Expand Down
6 changes: 6 additions & 0 deletions charts/logzio-logs-collector/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ containers:
readOnly: true
- name: varlibotelcol
mountPath: /var/lib/otelcol
- name: varlogcontainers
mountPath: /var/log/containers
readOnly: true
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 6 }}
{{- end }}
Expand Down Expand Up @@ -180,6 +183,9 @@ volumes:
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: varlogcontainers
hostPath:
path: /var/log/containers
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 2 }}
{{- end }}
Expand Down
84 changes: 5 additions & 79 deletions charts/logzio-logs-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,82 +141,8 @@ config:
env_id: ${env:ENV_ID}
logzio_logs_collector_version: "{{ .Chart.Version }}"
operators:
# Find out which format is used by kubernetes
- id: get-format
routes:
- expr: body matches "^{.*"
output: parser-docker
- expr: body matches "^[^ Z]+ "
output: parser-crio
- expr: body matches "^[^ Z]+Z"
output: parser-containerd
type: router
# Parse CRI-O format
- id: parser-crio
regex: ^(?P<time>[^ Z]+) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) ?(?P<log>.*)$
timestamp:
layout: 2006-01-02T15:04:05.999999999Z07:00
layout_type: gotime
parse_from: attributes.time
type: regex_parser
- combine_field: attributes.log
combine_with: ""
id: crio-recombine
is_last_entry: attributes.logtag == 'F'
max_log_size: 102400
output: extract_metadata_from_filepath
source_identifier: attributes["log.file.path"]
type: recombine
# Parse CRI-Containerd format
- id: parser-containerd
regex: ^(?P<time>[^ ^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) ?(?P<log>.*)$
timestamp:
layout: '%Y-%m-%dT%H:%M:%S.%LZ'
parse_from: attributes.time
type: regex_parser
- combine_field: attributes.log
combine_with: ""
id: containerd-recombine
is_last_entry: attributes.logtag == 'F'
max_log_size: 102400
output: extract_metadata_from_filepath
source_identifier: attributes["log.file.path"]
type: recombine
# Parse Docker format
- id: parser-docker
output: extract_metadata_from_filepath
timestamp:
layout: '%Y-%m-%dT%H:%M:%S.%LZ'
parse_from: attributes.time
type: json_parser
# Extract metadata from file path
- id: extract_metadata_from_filepath
parse_from: attributes["log.file.path"]
regex: ^.*\/(?P<namespace>[^_]+)_(?P<pod_name>[^_]+)_(?P<uid>[a-f0-9\-]+)\/(?P<container_name>[^\._]+)\/(?P<restart_count>\d+)\.log$
type: regex_parser
# Rename attributes
- from: attributes.stream
to: attributes["iostream"]
type: move
- from: attributes.container_name
to: resource["k8s.container.name"]
type: move
- from: attributes.namespace
to: resource["k8s.namespace.name"]
type: move
- from: attributes.pod_name
to: resource["k8s.pod.name"]
type: move
- from: attributes.restart_count
to: resource["k8s.container.restart_count"]
type: move
- from: attributes.uid
to: resource["k8s.pod.uid"]
type: move
# Update body field after finishing all parsing
- from: attributes.log
to: body
type: move
- id: container-parser
type: container
# conditional json parser
- type: json_parser
id: json
Expand Down Expand Up @@ -393,9 +319,9 @@ ports:
protocol: TCP

resources:
limits:
cpu: 250m
memory: 512Mi
requests:
cpu: 50m
memory: 70Mi

podAnnotations: {}

Expand Down

0 comments on commit 2962551

Please sign in to comment.