# How can I use ECS with custom JSON input?

**URL:** <https://discuss.elastic.co/t/how-can-i-use-ecs-with-custom-json-input/206753>\
**Category:** Logstash\
**Created:** [November 6, 2019, 8:56am UTC](https://discuss.elastic.co/t/how-can-i-use-ecs-with-custom-json-input/206753 "2019-11-06T08:56:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![janoliver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/janoliver/32/57246_2.png) [@janoliver](https://discuss.elastic.co/u/janoliver)\
**Post date:** [November 6, 2019, 8:56am UTC](https://discuss.elastic.co/t/how-can-i-use-ecs-with-custom-json-input/206753/1 "2019-11-06T08:56:46Z")

</div>

Hi there!

I have a server that collects metrics (such as CPU, memory, etc.) from other servers and I'd like to send that _already collected data_ via logstash to elastic. At the moment, I have a TCP input with JSON encoding set up, to which I send a JSON array with each element being the metrics of one of the servers:

```
[
    {"message": "...", "host": {"name": "my_host1"}, ...},
    {"message": "...", "host": {"name": "my_host2"}, ...},
    ...
]

```

How do I have to shape the JSON objects, so that the hosts and their metrics appear in Kibana's _Infrastructure App_ (i.e., similar to if they were collected by _metricbeat_ on the individual hosts). Running additional services such as metricbeat on all the hosts is currently not an option for me.

I found the ECS schema, but system metrics are not defined there. I tried using something similar to metricbeat, but the hosts don't appear in the infrastructure app's overview.

```
{
	"message": "metric",
	"system": {
		"cpu": {
			"user": {
				"pct": ...
			},
			"cores": 8,
		},
		"memory": {
			"actual": {
				"used": {
					"pct": ...
				}
			}
		},
		"load": {
			"5": ...
		}
	},
	"host": {
		"name": "..."
	}
}

```

How do I best shape my data?

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 4, 2019, 8:59am UTC](https://discuss.elastic.co/t/how-can-i-use-ecs-with-custom-json-input/206753/2 "2019-12-04T08:59:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
