diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 4609bf52f7a0..a5a3c8e98316 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -124,7 +124,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Update a few elasticsearch.* fields to map to ECS. {pull}10350[10350] - Update a few logstash.* fields to map to ECS. {pull}10350[10350] - Update a few kibana.* fields to map to ECS. {pull}10350[10350] -- Update haproxy.* fields to map to ECS. {pull}10558[10558] +- Update haproxy.* fields to map to ECS. {pull}10558[10558] {pull}10568[10568] *Packetbeat* diff --git a/dev-tools/ecs-migration.yml b/dev-tools/ecs-migration.yml index 0d227f304f50..39c08d640918 100644 --- a/dev-tools/ecs-migration.yml +++ b/dev-tools/ecs-migration.yml @@ -1666,6 +1666,11 @@ alias: true beat: metricbeat +- from: haproxy.info.pid + to: process.pid + alias: true + beat: metricbeat + ### Mongodb - from: mongodb.status.version diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 9925b80e3040..59024912a927 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -9410,7 +9410,9 @@ Process number. *`haproxy.info.pid`*:: + -- -type: long +type: alias + +alias to: process.pid Process ID. diff --git a/metricbeat/module/haproxy/fields.go b/metricbeat/module/haproxy/fields.go index e37c9e38a2cb..314c1ef52c73 100644 --- a/metricbeat/module/haproxy/fields.go +++ b/metricbeat/module/haproxy/fields.go @@ -32,5 +32,5 @@ func init() { // AssetHaproxy returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/haproxy. func AssetHaproxy() string { - return "eJzsXNtu27jTv+9TDHqzzsJxD5ttgQAt0Ka73xZNkyB2sJcGLY0jIhSpJak43qf/QFIny9TBseXsxV83bSxp5sfhcM72KTzg+hwikkjxtH4FoKlmeA6v//pyYz55/QogRBVImmgq+Dl8fgUAkN2FnyJMGb4CUJGQeh4IvqT357AkTJlP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B3MeF5RTFTWY2h6puX18Yl4dxhtMXREoZbrZI/SGuSB0iBpoGVEZBhg6WH3CW3KPXLdLb4/fvbPghk067MKdkmWyWEaUYX08KE36HAi/y94f2mIgrhyC8zfaq+PAXpqVjlxJKq9hro0HwxyNbzdrG5tUIrLhNvHHJrUp4ipta/lIEOWNro4Y0bVXswKxN1jcceYwJJo0V63r7d2uvNssadeQ1l29c/KNEbQu0fQQD2SjuCjt1HHK6U/bC1A0RCBuRK1PRdi/b3sC2HcP845qtavhLwhnzY7QuJy1PkXuvrN2cp+V25bm0Auv9XSd/SISi1nRGAm3nWdzQ0e4Mne9RJ2nWdnp8YDwvAPmGXlggoQwJ4zwoPH8Qu0bcN7awmFE4di3fHHBb3iy3w7aCPKGzlAbBtGhy4G0TX+3oKteG23nLGZ1Pxi1cLMg1ioWwumx/U1z7NBDAwZfFMZ2IKcw99ssbL5y2c0vsF9uMVblc1R2PXbJ5aJgdH599/rLv67u1GvOIjd8L7/GWrHcLnaJsty0zrno6o8xruMf8DgP5PzunEu2S2r+Gb8qEs9XdWA/qY77PqKh39e6Nv+k4HA7seffhqhelYquXVlW1x3F5Mn+fVybLMi+w6EjO9a/aIzOizHSnJAJ5d/AKPfqXPQ/yZ3TBTtJwGS7JBsycEifPXHu+c//BwAA//88Xa9f" } diff --git a/metricbeat/module/haproxy/info/_meta/data.json b/metricbeat/module/haproxy/info/_meta/data.json index 8cbaae98bc10..552202e0fff2 100644 --- a/metricbeat/module/haproxy/info/_meta/data.json +++ b/metricbeat/module/haproxy/info/_meta/data.json @@ -32,7 +32,7 @@ "max": 0, "total": 0 }, - "total": 223 + "total": 30 }, "idle": { "pct": 1 @@ -42,7 +42,6 @@ "bytes": 0 } }, - "pid": 8, "pipes": { "free": 0, "max": 0, @@ -51,7 +50,7 @@ "process_num": 1, "processes": 1, "requests": { - "total": 223 + "total": 30 }, "run_queue": 0, "session": { @@ -91,7 +90,7 @@ "tasks": 7, "ulimit_n": 8034, "uptime": { - "sec": 236 + "sec": 30 }, "zlib_mem_usage": { "max": 0, @@ -102,6 +101,9 @@ "metricset": { "name": "info" }, + "process": { + "pid": 7 + }, "service": { "address": "127.0.0.1:14567", "type": "haproxy" diff --git a/metricbeat/module/haproxy/info/_meta/fields.yml b/metricbeat/module/haproxy/info/_meta/fields.yml index 5363469753f6..f023cdd3efcb 100644 --- a/metricbeat/module/haproxy/info/_meta/fields.yml +++ b/metricbeat/module/haproxy/info/_meta/fields.yml @@ -15,7 +15,9 @@ Process number. - name: pid - type: long + type: alias + path: process.pid + migration: true description: > Process ID. diff --git a/metricbeat/module/haproxy/info/data.go b/metricbeat/module/haproxy/info/data.go index 7325040338f0..8ebd6378c749 100644 --- a/metricbeat/module/haproxy/info/data.go +++ b/metricbeat/module/haproxy/info/data.go @@ -18,6 +18,7 @@ package info import ( + "github.com/elastic/beats/libbeat/common" s "github.com/elastic/beats/libbeat/common/schema" c "github.com/elastic/beats/libbeat/common/schema/mapstrstr" "github.com/elastic/beats/metricbeat/mb" @@ -163,7 +164,16 @@ func eventMapping(info *haproxy.Info, r mb.ReporterV2) { } - event := mb.Event{} - event.MetricSetFields, _ = schema.Apply(source) + event := mb.Event{ + RootFields: common.MapStr{}, + } + + fields, _ := schema.Apply(source) + if processID, err := fields.GetValue("pid"); err == nil { + event.RootFields.Put("process.pid", processID) + fields.Delete("pid") + } + + event.MetricSetFields = fields r.Event(event) } diff --git a/metricbeat/tests/system/test_haproxy.py b/metricbeat/tests/system/test_haproxy.py index aa349b1b3684..cf3510db71cb 100644 --- a/metricbeat/tests/system/test_haproxy.py +++ b/metricbeat/tests/system/test_haproxy.py @@ -20,7 +20,7 @@ def _test_info(self): self.assertEqual(len(output), 1) evt = output[0] - self.assertItemsEqual(self.de_dot(HAPROXY_FIELDS), evt.keys(), evt) + self.assertItemsEqual(self.de_dot(HAPROXY_FIELDS + ["process"]), evt.keys(), evt) self.assert_fields_are_documented(evt)