1
+ {{- $timestamp := generate "timestamp" }}
2
+ {{- $event_duration := generate "event_duration" }}
3
+ {{- $rangeofid := generate "rangeofid" -}}
4
+ {{- $nodeid := div $rangeofid 110 -}}
5
+ {{- $status_phase := generate "status_phase" }}
6
+ {{- $status_scheduled := generate "status_scheduled" }}
7
+ {
8
+ "@timestamp": "{{$timestamp.Format "2006-01-02T15:04:05.999999Z07:00"}}",
9
+ "kubernetes": {
10
+ "node": {
11
+ "uid": "host-{{ $nodeid }}",
12
+ "hostname": "host-{{ $nodeid }}",
13
+ "name": "host-{{ $nodeid }}",
14
+ "labels": {
15
+ "kubernetes_io/hostname": "kubernetes-scale-123456",
16
+ "beta_kubernetes_io/os": "linux",
17
+ "kubernetes_io/arch": "amd64",
18
+ "kubernetes_io/os": "linux",
19
+ "beta_kubernetes_io/arch": "amd64"
20
+ }
21
+ },
22
+ "pod": {
23
+ "uid": "demo-pod-{{ $rangeofid }}",
24
+ "host_ip": "{{generate `Ip`}}",
25
+ "ip": "{{generate `Ip`}}",
26
+ "name": "demo-pod-{{ $rangeofid }}",
27
+ "status": {
28
+ "phase": "{{ $status_phase }}",
29
+ {{- if eq $status_phase "running"}}
30
+ "ready": "true",
31
+ {{- else if eq $status_phase "pending"}}
32
+ "ready": "false",
33
+ {{- else if eq $status_phase "failed"}}
34
+ "ready": "false",
35
+ {{- else if eq $status_phase "succeeded"}}
36
+ "ready": "true",
37
+ {{- else if eq $status_phase "unknown"}}
38
+ "ready": "unknown",
39
+ {{- end}}
40
+ "scheduled": "{{ $status_scheduled }}"
41
+ }
42
+
43
+ },
44
+ "namespace": "demo-{{ $rangeofid }}",
45
+ "namespace_uid": "demo-{{ $rangeofid }}",
46
+ "replicaset": {
47
+ "name": "demo-deployment-{{ $rangeofid }}"
48
+ },
49
+ "namespace_labels": {
50
+ "kubernetes_io/metadata_name": "demo-{{ $rangeofid }}"
51
+ },
52
+ "labels": {
53
+ "app":"demo",
54
+ "pod-template-hash":"{{ $rangeofid }}",
55
+ "app-2":"demo-2",
56
+ "app-1":"demo-1"
57
+ },
58
+ "deployment": {
59
+ "name": "demo-deployment-{{ $rangeofid }}"
60
+ }
61
+ },
62
+ "agent": {
63
+ "name": "kubernetes-scale-123456",
64
+ "id": "de42127b-4db8-4471-824e-a7b14f478663",
65
+ "ephemeral_id": "22ed892c-43bd-408a-9121-65e2f5b6a56e",
66
+ "type": "metricbeat",
67
+ "version": "8.8.0"
68
+ },
69
+ "elastic_agent": {
70
+ "id": "de42127b-4db8-4471-824e-a7b14f478663",
71
+ "version": "8.8.0",
72
+ "snapshot": true
73
+ },
74
+ "cloud": {
75
+ "provider": "gcp",
76
+ "availability_zone": "europe-west1-d",
77
+ "instance":{
78
+ "name": "kubernetes-scale-123456" ,
79
+ "id": "de42127b-4db8-4471-824e-a7b14f478663"
80
+ },
81
+ "machine":{
82
+ "type":"e2-standard-4"
83
+ },
84
+ "service":{
85
+ "name":"GCE"
86
+ },
87
+ "project":{
88
+ "id":"elastic-obs-integrations-dev"
89
+ },
90
+ "account":{
91
+ "id":"elastic-obs-integrations-dev"
92
+ }
93
+ },
94
+ "orchestrator":{
95
+ "cluster":{
96
+ "name":"kubernetes-scale",
97
+ "url":"https://{{ generate `Ip` }}"
98
+ }
99
+ },
100
+ "ecs": {
101
+ "version": "8.0.0"
102
+ },
103
+ "data_stream": {
104
+ "namespace": "ep",
105
+ "type": "metrics",
106
+ "dataset": "kubernetes.state_pod"
107
+ },
108
+ "service": {
109
+ "address": "http://kubernetes-scale-123456:8080/metrics",
110
+ "type": "kubernetes"
111
+ },
112
+ "host": {
113
+ "hostname": "kubernetes-scale-123456",
114
+ "os": {
115
+ "kernel": "5.10.47-linuxkit",
116
+ "codename": "Core",
117
+ "name": "CentOS Linux",
118
+ "type": "linux",
119
+ "family": "redhat",
120
+ "version": "7 (Core)",
121
+ "platform": "centos"
122
+ },
123
+ "containerized": true,
124
+ "name": "kubernetes-scale-123456",
125
+ "id": "85e35c2b5e1b39ba72393a6baf6ee7cd",
126
+ "architecture": "x86_64"
127
+ },
128
+ "metricset": {
129
+ "period": 10000,
130
+ "name": "state_pod"
131
+ },
132
+ "event": {
133
+ "duration": {{ $event_duration }},
134
+ "agent_id_status": "verified",
135
+ "module": "kubernetes",
136
+ "dataset": "kubernetes.state_pod"
137
+ }
138
+ }
0 commit comments