Skip to content

Commit

Permalink
Update kubernetes namespace field. (#1792)
Browse files Browse the repository at this point in the history
* Use pipeline to rename fileds in cases of agents 7.x and stack ^8.x
  • Loading branch information
MichaelKatsoulis authored Oct 25, 2021
1 parent 559bc03 commit b1ee043
Show file tree
Hide file tree
Showing 54 changed files with 1,201 additions and 95 deletions.
5 changes: 5 additions & 0 deletions packages/kubernetes/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.2.0"
changes:
- description: Update Kubernetes namespace field
type: enhancement
link: https://github.com/elastic/integrations/pull/1792
- version: "1.1.1"
changes:
- description: Update Kubernetes integration Readme
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Pipeline for parsing kubernetes container metrics.
processors:
- rename:
field: kubernetes.namespace
target_field: kubernetes.namespace.name
ignore_missing: true
- rename:
field: kubernetes.namespace_labels
target_field: kubernetes.namespace.labels
ignore_missing: true
- rename:
field: kubernetes.namespace_annotations
target_field: kubernetes.namespace.annotations
ignore_missing: true
- rename:
field: kubernetes.namespace_uid
target_field: kubernetes.namespace.uid
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
28 changes: 25 additions & 3 deletions packages/kubernetes/data_stream/container/fields/base-fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,31 @@
Kubernetes pod IP
- name: namespace
type: keyword
description: >
Kubernetes namespace
type: group
fields:
- name: name
type: keyword
description: >
Kubernetes namespace name
- name: uid
type: keyword
description: >
Kubernetes namespace uid
- name: labels.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace labels map
- name: annotations.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace annotations map
- name: node.name
type: keyword
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Pipeline for parsing kubernetes container logs.
processors:
- rename:
field: kubernetes.namespace
target_field: kubernetes.namespace.name
ignore_missing: true
- rename:
field: kubernetes.namespace_labels
target_field: kubernetes.namespace.labels
ignore_missing: true
- rename:
field: kubernetes.namespace_annotations
target_field: kubernetes.namespace.annotations
ignore_missing: true
- rename:
field: kubernetes.namespace_uid
target_field: kubernetes.namespace.uid
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,31 @@
Kubernetes pod IP
- name: namespace
type: keyword
description: >
Kubernetes namespace
type: group
fields:
- name: name
type: keyword
description: >
Kubernetes namespace name
- name: uid
type: keyword
description: >
Kubernetes namespace uid
- name: labels.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace labels map
- name: annotations.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace annotations map
- name: node.name
type: keyword
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Pipeline for parsing kubernetes controllermanager metrics.
processors:
- rename:
field: kubernetes.namespace
target_field: kubernetes.namespace.name
ignore_missing: true
- rename:
field: kubernetes.namespace_labels
target_field: kubernetes.namespace.labels
ignore_missing: true
- rename:
field: kubernetes.namespace_annotations
target_field: kubernetes.namespace.annotations
ignore_missing: true
- rename:
field: kubernetes.namespace_uid
target_field: kubernetes.namespace.uid
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,31 @@
Kubernetes pod IP
- name: namespace
type: keyword
description: >
Kubernetes namespace
type: group
fields:
- name: name
type: keyword
description: >
Kubernetes namespace name
- name: uid
type: keyword
description: >
Kubernetes namespace uid
- name: labels.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace labels map
- name: annotations.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace annotations map
- name: node.name
type: keyword
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Pipeline for parsing kubernetes event metrics.
processors:
- rename:
field: kubernetes.namespace
target_field: kubernetes.namespace.name
ignore_missing: true
- rename:
field: kubernetes.namespace_labels
target_field: kubernetes.namespace.labels
ignore_missing: true
- rename:
field: kubernetes.namespace_annotations
target_field: kubernetes.namespace.annotations
ignore_missing: true
- rename:
field: kubernetes.namespace_uid
target_field: kubernetes.namespace.uid
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
28 changes: 25 additions & 3 deletions packages/kubernetes/data_stream/event/fields/base-fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,31 @@
Kubernetes pod IP
- name: namespace
type: keyword
description: >
Kubernetes namespace
type: group
fields:
- name: name
type: keyword
description: >
Kubernetes namespace name
- name: uid
type: keyword
description: >
Kubernetes namespace uid
- name: labels.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace labels map
- name: annotations.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace annotations map
- name: node.name
type: keyword
Expand Down
2 changes: 1 addition & 1 deletion packages/kubernetes/data_stream/event/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
- name: uid
type: keyword
description: |
UUID version of the object
uid version of the object
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Pipeline for parsing kubernetes node metrics.
processors:
- rename:
field: kubernetes.namespace
target_field: kubernetes.namespace.name
ignore_missing: true
- rename:
field: kubernetes.namespace_labels
target_field: kubernetes.namespace.labels
ignore_missing: true
- rename:
field: kubernetes.namespace_annotations
target_field: kubernetes.namespace.annotations
ignore_missing: true
- rename:
field: kubernetes.namespace_uid
target_field: kubernetes.namespace.uid
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
28 changes: 25 additions & 3 deletions packages/kubernetes/data_stream/node/fields/base-fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,31 @@
Kubernetes pod IP
- name: namespace
type: keyword
description: >
Kubernetes namespace
type: group
fields:
- name: name
type: keyword
description: >
Kubernetes namespace name
- name: uid
type: keyword
description: >
Kubernetes namespace uid
- name: labels.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace labels map
- name: annotations.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace annotations map
- name: node.name
type: keyword
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Pipeline for parsing kubernetes pod metrics.
processors:
- rename:
field: kubernetes.namespace
target_field: kubernetes.namespace.name
ignore_missing: true
- rename:
field: kubernetes.namespace_labels
target_field: kubernetes.namespace.labels
ignore_missing: true
- rename:
field: kubernetes.namespace_annotations
target_field: kubernetes.namespace.annotations
ignore_missing: true
- rename:
field: kubernetes.namespace_uid
target_field: kubernetes.namespace.uid
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
28 changes: 25 additions & 3 deletions packages/kubernetes/data_stream/pod/fields/base-fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,31 @@
Kubernetes pod IP
- name: namespace
type: keyword
description: >
Kubernetes namespace
type: group
fields:
- name: name
type: keyword
description: >
Kubernetes namespace name
- name: uid
type: keyword
description: >
Kubernetes namespace uid
- name: labels.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace labels map
- name: annotations.*
type: object
object_type: keyword
object_type_mapping_type: "*"
description: >
Kubernetes namespace annotations map
- name: node.name
type: keyword
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description: Pipeline for parsing kubernetes scheduler metrics.
processors:
- rename:
field: kubernetes.namespace
target_field: kubernetes.namespace.name
ignore_missing: true
- rename:
field: kubernetes.namespace_labels
target_field: kubernetes.namespace.labels
ignore_missing: true
- rename:
field: kubernetes.namespace_annotations
target_field: kubernetes.namespace.annotations
ignore_missing: true
- rename:
field: kubernetes.namespace_uid
target_field: kubernetes.namespace.uid
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
Loading

0 comments on commit b1ee043

Please sign in to comment.