Hi! I'm trying to rename some fields from kubernetes annotations based on an when conditions, due to not finding any good resources, I was wondering if someone of you could help me with this.
My goal is to rename events which contain kubernetes.annotations.myapp/sidecar = 'true' and when kubernetes.annotations.myapp/sidecar.type = kubernetes.container.name. If none of these conditions go through, I want to rename as a default (in the other when).
Is this possible? I did not find any good examples on how to do, if possible more than one condition under one processor (global).
- rename: when: equals: kubernetes.annotations.myapp/sidecar.source: kubernetes.container.type fields: - from: "kubernetes.labels.myapp-service" to: "_service" - from: "kubernetes.labels.myapp-token" to: "_token" - from: "kubernetes.annotations.myapp/sidecar.type" to: "type" when: or: - not.has_fields: ['kubernetes.annotations.myapp/sidecar'] - not.equals: kubernetes.annotations.myapp/sidecar: 'true' - from: "kubernetes.labels.myapp-service" to: "_service" - from: "kubernetes.labels.myapp-token" to: "_token" - from: "kubernetes.labels.myapp-type" to: "type"