With the following defined datasource, I believe the problem is in the way we merge the configuration at the datasource's input level and the stream level to generate the metricbeat's input configuration.
2020-03-31T15:54:06.298-0400 INFO instance/beat.go:609 Home path: [/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64] Config path: [/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64] Data path: [/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/default/metricbeat--8.0.0] Logs path: [/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64/logs]
2020-03-31T15:54:06.339-0400 INFO instance/beat.go:617 Beat ID: 36f61016-0809-44a5-a30c-184411bea2a0
2020-03-31T15:54:06.340-0400 INFO [centralmgmt.fleet] fleet/manager.go:272 initiating fleet config manager
2020-03-31T15:54:06.413-0400 INFO [beat] instance/beat.go:945 Beat info {"system_info": {"beat": {"path": {"config": "/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64", "data": "/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/default/metricbeat--8.0.0", "home": "/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64", "logs": "/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64/logs"}, "type": "metricbeat", "uuid": "36f61016-0809-44a5-a30c-184411bea2a0"}}}
2020-03-31T15:54:06.413-0400 INFO [beat] instance/beat.go:954 Build info {"system_info": {"build": {"commit": "unknown", "libbeat": "8.0.0", "time": "1754-08-30T22:43:41.128Z", "version": "8.0.0"}}}
2020-03-31T15:54:06.413-0400 INFO [beat] instance/beat.go:957 Go runtime info {"system_info": {"go": {"os":"darwin","arch":"amd64","max_procs":16,"version":"go1.13.8"}}}
2020-03-31T15:54:06.445-0400 INFO [beat] instance/beat.go:961 Host info {"system_info": {"host": {"architecture":"x86_64","boot_time":"2020-03-31T11:01:44.826172-04:00","name":"Nicolass-MacBook-Pro.local","ip":["127.0.0.1/8","::1/128","fe80::1/64","fe80::aede:48ff:fe00:1122/64","fe80::c10:40a7:fb66:b576/64","192.168.0.10/24","fd00:688f:2ed3:7dd2:10a7:a049:d3f0:2787/64","fd00:688f:2ed3:7dd2:7158:416f:330f:58cc/64","fe80::444c:ff:fede:3ef5/64","fe80::444c:ff:fede:3ef5/64","fe80::e2df:ea9f:b034:ac0/64","fe80::1f2f:614d:8ff0:8e53/64","fe80::353a:ba8f:803d:1038/64","fe80::caae:2fa0:7559:3e79/64"],"kernel_version":"19.4.0","mac":["ac:de:48:00:11:22","82:46:af:c6:8c:01","a6:83:e7:4e:a2:42","a4:83:e7:4e:a2:42","82:46:af:c6:8c:00","82:46:af:c6:8c:01","82:46:af:c6:8c:05","82:46:af:c6:8c:04","06:83:e7:4e:a2:42","46:4c:00:de:3e:f5","46:4c:00:de:3e:f5"],"os":{"family":"darwin","platform":"darwin","name":"Mac OS X","version":"10.15.4","major":10,"minor":15,"patch":4,"build":"19E266"},"timezone":"EDT","timezone_offset_sec":-14400,"id":"A4D26E5E-1CCB-57BF-8AB6-39A955488947"}}}
2020-03-31T15:54:06.450-0400 INFO [beat] instance/beat.go:990 Process info {"system_info": {"process": {"cwd": "/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64", "exe": "/Users/nicolas/go/src/github.com/elastic/beats/x-pack/agent/build/distributions/agent-8.0.0-darwin-x86_64/data/install/metricbeat-8.0.0-darwin-x86_64/metricbeat", "name": "metricbeat", "pid": 89800, "ppid": 89610, "start_time": "2020-03-31T15:54:05.343-0400"}}}
2020-03-31T15:54:06.460-0400 INFO instance/beat.go:296 Setup Beat: metricbeat; Version: 8.0.0
2020-03-31T15:54:06.471-0400 INFO eslegclient/connection.go:84 elasticsearch url: http://localhost:9200
2020-03-31T15:54:06.482-0400 INFO [publisher] pipeline/module.go:110 Beat name: Nicolass-MacBook-Pro.local
2020-03-31T15:54:06.495-0400 INFO [monitoring] log/log.go:118 Starting metrics logging every 30s
2020-03-31T15:54:06.495-0400 INFO instance/beat.go:437 metricbeat start running.
2020-03-31T15:54:06.509-0400 WARN [cfgwarn] fleet/manager.go:105 BETA: Fleet management is enabled
2020-03-31T15:54:06.509-0400 INFO [centralmgmt.fleet] fleet/manager.go:106 Starting fleet management service
2020-03-31T15:54:06.510-0400 INFO cfgfile/reload.go:175 Config reloader started
2020-03-31T15:54:06.528-0400 INFO cfgfile/reload.go:235 Loading of config files completed.
2020-03-31T15:54:07.067-0400 INFO [centralmgmt.fleet] fleet/manager.go:190 Applying settings for metricbeat.modules
2020-03-31T15:54:07.071-0400 ERROR [centralmgmt] cfgfile/list.go:96 Error creating runner from config: 1 error: host parsing failed for nginx-stubstatus: error parsing URL: empty host
2020-03-31T15:54:07.079-0400 ERROR [centralmgmt.fleet] fleet/manager.go:226 1 error: Error creating runner from config: 1 error: host parsing failed for nginx-stubstatus: error parsing URL: empty host
2020-03-31T15:54:07.089-0400 INFO [centralmgmt.fleet] fleet/manager.go:190 Applying settings for output
2020-03-31T15:54:07.089-0400 INFO eslegclient/connection.go:84 elasticsearch url: http://localhost:9200
2020-03-31T15:54:07.099-0400 ERROR [centralmgmt.fleet] fleet/manager.go:147 Could not apply the configuration, error: [1 error: Error creating runner from config: 1 error: host parsing failed for nginx-stubstatus: error parsing URL: empty host]
2020-03-31T15:54:09.342-0400 INFO [add_cloud_metadata] add_cloud_metadata/add_cloud_metadata.go:89 add_cloud_metadata: hosting provider type not detected.
2020-03-31T15:54:10.346-0400 INFO [publisher_pipeline_output] pipeline/output.go:101 Connecting to backoff(elasticsearch(http://localhost:9200))
2020-03-31T15:54:10.349-0400 INFO [esclientleg] eslegclient/connection.go:263 Attempting to connect to Elasticsearch version 8.0.0-SNAPSHOT
2020-03-31T15:54:10.381-0400 INFO [license] licenser/check.go:35 License is active for Basic
2020-03-31T15:54:10.411-0400 INFO [license] licenser/check.go:22 Trial license active
2020-03-31T15:54:10.411-0400 INFO [license] licenser/es_callback.go:51 Elasticsearch license: Trial
``
With the following defined datasource, I believe the problem is in the way we merge the configuration at the datasource's input level and the stream level to generate the metricbeat's input configuration.
Results in the metricbeat logs