Documentation
¶
Index ¶
- Constants
- Variables
- func GetCEFExtensions(sourceType string, extraLabels map[string]string) map[string]string
- func GetLokiLabels(sourceType string, extraLabels map[string]string) map[string]string
- func GetSplunkLabels(sourceType string, extraLabels map[string]string) map[string]string
- func SortedMapKeys(m map[string]string) []string
Constants ¶
const ( K8sLabelPod = "pod" K8sLabelPodLabels = "pod_labels" K8sLabelPodIP = "pod_ip" K8sLabelNamespace = "namespace" K8sLabelImage = "image" K8sLabelContainer = "container" K8sLabelNode = "node" K8sLabelPodOwner = "pod_owner" K8sLabelNodeLabels = "node_labels" )
Kubernetes label field names used in kubernetes_logs source annotation_fields.
Variables ¶
var FilesLabels = map[string]string{
"host": "{{ .host }}",
"host_ip": "{{ .host_ip }}",
"file": "{{ file }}",
}
FilesLabels contains default file labels for log destinations.
var K8sLabels = map[string]string{ K8sLabelNamespace: "{{ namespace }}", K8sLabelContainer: "{{ container }}", K8sLabelImage: "{{ image }}", K8sLabelPod: "{{ pod }}", K8sLabelNode: "{{ node }}", K8sLabelPodIP: "{{ pod_ip }}", "stream": "{{ stream }}", "node_group": "{{ node_group }}", K8sLabelPodOwner: "{{ pod_owner }}", }
K8sLabels contains default Kubernetes labels for log destinations.
var K8sLabelsWithPodLabels = func() map[string]string { result := make(map[string]string, len(K8sLabels)+1) maps.Copy(result, K8sLabels) result[podLabelsStar] = "{{ pod_labels }}" return result }()
K8sLabelsWithPodLabels contains K8sLabels plus pod_labels_*.
Functions ¶
func GetCEFExtensions ¶
GetCEFExtensions returns CEF extensions map: source labels (K8s without pod_labels) + extraLabels, with message/timestamp.
func GetLokiLabels ¶
GetLokiLabels returns labels for Loki: source labels (with pod_labels for K8s) + extraLabels.
func GetSplunkLabels ¶
GetSplunkLabels returns indexed fields for Splunk: datetime + source labels (K8s without pod_labels) + extraLabels.
func SortedMapKeys ¶
SortedMapKeys returns sorted keys from a map for deterministic order.
Types ¶
This section is empty.