The Delete Empty Values processor can be used to delete null and other empty values from telemetry resource attributes, telemetry attributes, or a log record’s body.
Metrics | Logs | Traces |
---|---|---|
✓ | ✓ | ✓ |
Parameter | Type | Default | Description |
---|---|---|---|
telemetry_types | telemetrySelector |
["Logs", "Metrics", "Traces"] |
The list of telemetry types the processor will act on. |
deleted_values | enums |
["Null Values"] |
List of values types to delete. May include “Null Values”, “Empty Lists”, and “Empty Maps”. Enabling “Null Values” will remove both empty (zero-length) strings and entirely empty values. Enabling “Empty Lists” will delete empty (no element) list values. Enabling “Empty Maps” will delete empty (no key) map values. |
exclude_resource_keys | strings |
[] |
List of resource keys to exclude from deletion. |
exclude_attribute_keys | strings |
[] |
List of attribute keys to exclude from deletion. |
exclude_body_keys | string |
[] |
List of body keys to exclude from deletion. |
empty_string_values | strings |
[] |
List of string values that are considered “empty”. String fields will be deleted if they match any of the strings in this list. |
This example configuration removes empty values from NGINX logs, where “-” is used to denote an empty field.
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
id: remove-empty-attributes
name: remove-empty-attributes
spec:
type: remove_empty_values
parameters:
- name: telemetry_types
value:
- Logs
- Metrics
- Traces
- name: empty_string_values
value:
- '-'
apiVersion: bindplane.observiq.com/v1
kind: Configuration
metadata:
id: remove-empty-attributes
name: remove-empty-attributes
labels:
platform: linux
spec:
sources:
- type: nginx
parameters:
- name: telemetry_types
value:
- Logs
- Metrics
- name: endpoint
value: http://localhost:80/status
- name: disable_metrics
value: []
- name: enable_tls
value: false
- name: insecure_skip_verify
value: false
- name: ca_file
value: ''
- name: cert_file
value: ''
- name: key_file
value: ''
- name: collection_interval
value: 60
- name: data_flow
value: high
- name: log_format
value: default
- name: access_log_paths
value:
- /var/log/nginx/access.log*
- name: error_log_paths
value:
- /var/log/nginx/error.log*
- name: start_at
value: end
processors:
- type: delete_empty_values
parameters:
- name: telemetry_types
value:
- Logs
- Metrics
- Traces
- name: deleted_values
value:
- Null Values
- name: exclude_resource_keys
value: []
- name: exclude_attribute_keys
value: []
- name: exclude_body_keys
value: []
- name: empty_string_values
value:
- '-'
disabled: false
disabled: false
selector:
matchLabels:
configuration: remove-empty-attributes