Skip to content

Commit

Permalink
Merge pull request #477 from logzio/logzio-logs-collector-1.0.3
Browse files Browse the repository at this point in the history
Logzio logs collector 1.0.3
  • Loading branch information
yotamloe authored Apr 30, 2024
2 parents 0bd7811 + 9184030 commit f41d150
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 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.2
version: 1.0.3
description: kubernetes logs collection agent for logz.io based on opentelemetry collector
type: application
home: https://logz.io/
Expand Down
4 changes: 4 additions & 0 deletions charts/logzio-logs-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ 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.3
- Replace dots (".") with underscores ("_") in log attributes keys:
- Added `transform/dedot` proccesor.
- Edited `k8sattributes`, `transform/log_type`, `transform/log_level` proccesors.
* 1.0.2
- Change template function name `baseConfig` -> `baseLoggingConfig` to avoid conflicts with other charts deployed
- Refactor tempaltes function names `opentelemetry-collector` -> `logs-collector` to avoid conflicts with other charts templates
Expand Down
35 changes: 21 additions & 14 deletions charts/logzio-logs-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,39 @@ config:
- context: log
statements:
# set log_level
- set(attributes["log.level"], "INFO")
- set(attributes["log.level"], "DEBUG") where (IsMatch(body, ".*\\b(?i:debug)\\b.*"))
- set(attributes["log.level"], "WARNING") where (IsMatch(body, ".*\\b(?i:warning|warn)\\b.*"))
- set(attributes["log.level"], "ERROR") where (IsMatch(body, ".*(?i:(?:error|fail|failure|exception|panic)).*"))
- set(attributes["log_level"], "INFO")
- set(attributes["log_level"], "DEBUG") where (IsMatch(body, ".*\\b(?i:debug)\\b.*"))
- set(attributes["log_level"], "WARNING") where (IsMatch(body, ".*\\b(?i:warning|warn)\\b.*"))
- set(attributes["log_level"], "ERROR") where (IsMatch(body, ".*(?i:(?:error|fail|failure|exception|panic)).*"))
transform/log_type:
error_mode: ignore
log_statements:
- context: resource
statements:
# Set type based on Kubernetes annotation or default
- set(attributes["type"], attributes["k8s.annotations.logz.io/application_type"]) where attributes["k8s.annotations.logz.io/application_type"] != nil
- set(attributes["type"], attributes["k8s.annotations.log_type"]) where attributes["k8s.annotations.log_type"] != nil and attributes["k8s.annotations.logz.io/application_type"] == nil
- set(attributes["type"], "${env:LOG_TYPE}") where attributes["k8s.annotations.log_type"] == nil and attributes["k8s.annotations.logz.io/application_type"] == nil
- set(attributes["type"], attributes["k8s_annotations_logz.io/application_type"]) where attributes["k8s_annotations_logz.io/application_type"] != nil
- set(attributes["type"], attributes["k8s_annotations_log_type"]) where attributes["k8s_annotations_log_type"] != nil and attributes["k8s_annotations_logz.io/application_type"] == nil
- set(attributes["type"], "${env:LOG_TYPE}") where attributes["k8s_annotations_log_type"] == nil and attributes["k8s_annotations_logz.io/application_type"] == nil
transform/dedot:
error_mode: ignore
log_statements:
- context: resource
statements:
- replace_all_patterns(attributes, "key", "\\.", "_")
- context: log
statements:
- replace_all_patterns(attributes, "key", "\\.", "_")
batch: {}
k8sattributes:
extract:
annotations:
- from: pod
key_regex: (.*)
tag_name: k8s.annotations.$$1
tag_name: k8s_annotations_$$1
labels:
- from: pod
key_regex: (.*)
tag_name: k8s.labels.$$1
tag_name: k8s_labels_$$1
metadata:
- "k8s.namespace.name"
- "k8s.deployment.name"
Expand All @@ -100,9 +109,6 @@ config:
node_from_env_var: K8S_NODE_NAME
passthrough: false
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.uid
Expand All @@ -126,8 +132,8 @@ config:
start_at: end
# Add common attributes
attributes:
env.id: ${env:ENV_ID}
logzio.logs.collector.version: "{{ .Chart.Version }}"
env_id: ${env:ENV_ID}
logzio_logs_collector_version: "{{ .Chart.Version }}"
operators:
# Find out which format is used by kubernetes
- id: get-format
Expand Down Expand Up @@ -244,6 +250,7 @@ config:
- k8sattributes
- transform/log_level
- transform/log_type
- transform/dedot
- batch
receivers:
- otlp
Expand Down

0 comments on commit f41d150

Please sign in to comment.