Closed ALNBAND closed 2 years ago
You can achieve that using annotations, checkout https://github.com/splunk/splunk-connect-for-kubernetes#managing-sck-log-ingestion-by-using-annotations
- So by default it doesn't send any data? I need explicitly configure from which pods to send the data? or there is option to disable all and one by one explicitly ?
By default it will send logs from all the container. You can exclude log from any container by adding splunk.com/exclude annotation.
- Does the tool have buffering on a disk, e.g. if Splunk is down to prevent a data loss ?
Yes, it'll buffer data in memory. Here you can modify the configuration from here (https://github.com/splunk/splunk-connect-for-kubernetes/blob/develop/helm-chart/splunk-connect-for-kubernetes/values.yaml#L418-L427)
You can also add customFilter to only allow from only specific pod. For example,
splunk-kubernetes-logging:
customFilters:
includeOnlyFilter:
tag: tail.containers.**
type: grep
body: |
<regexp>
key pod
pattern /^etcd-.*$/
</regexp>
@harshit-splunk - thanks, ok the customFilter looks promising, can I disable all the pods logs with simple config? and then add the fiter
@ALNBAND, there is no direct way to disable log collection from all pods unless you modify template file. By applying previous filter, fluend will capture and drop all other logs except from etcd pod
@ALNBAND should I close the issue?
you can also set the path value to focus in on specifc regex or comma separated values:
By default we scoop up everything. With a bit of thought you could scope the path we watch down to just a specific namespace or pod by examining the path to the pod on the node and adjusting the path value as necessary....k8s puts pod_namespace_container-name-container-id in the path. So you can use that to scope down to just what you want.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Hi,
Is there a way to send logs from only one pod? e.g. fluent is reading all cluster/nodes pod logs, if there is a way to configure it to send to splunk only one pod logs ?