Allow setting extra fields from values
Opened this issue · 0 comments
mosheavni commented
Hi,
can you please adjust the templates to allow filebeat.yml to have additional fields as part of the regular helm values?
https://www.elastic.co/guide/en/beats/filebeat/current/add-fields.html
I'd like to set it like this:
helm install --namespace=kube-system \
--set secrets.logzioShippingToken='lzrBhFcnLQCGtdFPhpgRbnaLDKvnZhzw' \
--set secrets.logzioRegion='<<LISTENER-REGION>>' \
--set secrets.clusterName='<<CLUSTER-NAME>>' \
--set extraFields.environment='staging' \
--set extraFields.foo='bar' \
logzio-k8s-logs logzio-helm/logzio-k8s-logs
and it will generate the config like this:
filebeat.autodiscover:
providers:
- type: kubernetes
node: ${NODE_NAME}
hints.enabled: true
hints.default_config:
type: container
paths:
- /var/log/containers/*-${data.kubernetes.container.id}.log
include_annotations: '*'
processors:
- add_cloud_metadata: ~
- add_fields:
target: ''
fields:
foo: bar
environment: staging
fields:
logzio_codec: ${LOGZIO_CODEC}
token: ${LOGZIO_LOGS_SHIPPING_TOKEN}
cluster: ${CLUSTER_NAME}
type: ${LOGZIO_TYPE}
fields_under_root: ${FIELDS_UNDER_ROOT}
ignore_older: ${IGNORE_OLDER}
output:
logstash:
hosts: ["${LOGZIO_LOGS_LISTENER_HOST}:5015"]
ssl:
Thanks.