Send hostname instead of IP address when logging #7618
-
HI! |
Beta Was this translation helpful? Give feedback.
Answered by
frezbo
Aug 16, 2023
Replies: 1 comment 1 reply
-
This was my old vecotr config: role: Agent
dnsPolicy: ClusterFirstWithHostNet
customConfig:
data_dir: /vector-data-dir
sources:
vector_metrics:
type: internal_metrics
host_metrics:
type: host_metrics
k8s_logs:
type: kubernetes_logs
k8s_api_server_audit_logs:
type: file
host_key: ${VECTOR_SELF_NODE_NAME}
include:
- /var/log/audit/kube/*.log
talos_kernel_logs:
type: socket
mode: tcp
address: 127.0.0.1:9301
decoding:
codec: json
talos_service_logs:
type: socket
mode: tcp
address: 127.0.0.1:9302
decoding:
codec: json
sinks:
k8s:
type: loki
inputs:
- k8s_logs
endpoint: http://loki-distributed-gateway
out_of_order_action: rewrite_timestamp
batch:
max_bytes: 2049000
labels:
# forwarder: vector
# event: "{{ event_field }}"
# key: value
# pod_labels_*: "{{ kubernetes.pod_labels }}"
container: "{{`{{ kubernetes.container_name }}`}}"
namespace: "{{`{{ kubernetes.pod_namespace }}`}}"
node: "{{`{{ kubernetes.pod_node_name }}`}}"
encoding:
codec: json
talos_kernel:
type: loki
inputs:
- talos_kernel_logs
endpoint: http://loki-distributed-gateway
out_of_order_action: rewrite_timestamp
batch:
max_bytes: 1048576
encoding:
codec: json
labels:
job: talos-kernel-logs
facility: "{{`{{ facility }}`}}"
hostname: ${VECTOR_SELF_NODE_NAME}
talos_service:
type: loki
inputs:
- talos_service_logs
endpoint: http://loki-distributed-gateway
out_of_order_action: rewrite_timestamp
batch:
max_bytes: 1048576
encoding:
codec: json
labels:
job: talos-service-logs
service: "{{`{{ \"talos-service\" }}`}}"
hostname: ${VECTOR_SELF_NODE_NAME}
extraVolumes:
- name: audit-logs
hostPath:
path: /var/log/audit/kube
extraVolumeMounts:
- name: audit-logs
mountPath: /var/log/audit/kube
readOnly: true also needs to run the vector daemonset as HostNetwork, I believe the helm chart has that option now |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
aivanov-citc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was my old vecotr config: