# Creating a new beat but can't see proper output

**URL:** <https://discuss.elastic.co/t/creating-a-new-beat-but-cant-see-proper-output/332645>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [May 5, 2023, 12:00pm UTC](https://discuss.elastic.co/t/creating-a-new-beat-but-cant-see-proper-output/332645 "2023-05-05T12:00:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeynepyz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeynepyz/32/114656_2.png) [@zeynepyz](https://discuss.elastic.co/u/zeynepyz)\
**Post date:** [May 5, 2023, 12:00pm UTC](https://discuss.elastic.co/t/creating-a-new-beat-but-cant-see-proper-output/332645/1 "2023-05-05T12:00:35Z")

</div>

Hello i'm new here so if i say something wrong please let me know. I was trying to make a new beat that collects k6 metrics via rest api and then send them into Elasticsearch. I follow the 7.17 Dev Guide " Creating a Beat based on Metricbeat" documentation. I have a output but it does not show me the proper output.

```auto
package k6metricset

import (

"github.com/elastic/beats/metricbeat/helper"

"github.com/elastic/beats/v7/libbeat/common/cfgwarn"

"github.com/elastic/elastic-agent-libs/logp"

// import from beat generator

"github.com/elastic/beats/v7/metricbeat/mb"

)

// init registers the MetricSet with the central registry as soon as the program

// starts. The New function will be called later to instantiate an instance of

// the MetricSet for each host defined in the module's configuration. After the

// MetricSet has been created then Fetch will begin to be called periodically.

func init() {

mb.Registry.MustAddMetricSet("k6module", "k6metricset", New)

}

// MetricSet holds any configuration or state information. It must implement

// the mb.MetricSet interface. And this is best achieved by embedding

// mb.BaseMetricSet because it implements all of the required mb.MetricSet

// interface methods except for Fetch.

type MetricSet struct {

mb.BaseMetricSet

http *helper.HTTP

}

// New creates a new instance of the MetricSet. New is responsible for unpacking

// any MetricSet specific configuration options if there are any.

func New(base mb.BaseMetricSet) (mb.MetricSet, error) {

cfgwarn.Beta("The k6module k6metricset metricset is beta.")

logp.Info("MyMetricSet: Starting to collect metrics")

config := struct{}{}

if err := base.Module().UnpackConfig(&config); err != nil {

return nil, err

}

return &MetricSet{

BaseMetricSet: base,

}, nil

}

// Fetch methods implements the data gathering and data conversion to the right

// format. It publishes the event which is then forwarded to the output. In case

// of an error set the Error field of mb.Event or simply call report.Error().

func (m *MetricSet) Fetch(report mb.ReporterV2) error {

println(report)

return GetReport(report)

} 

```

For example when i run the beat i expect an "MyMetricSet: Starting to collect metrics" output but there is no info about this. I have data.go file too. Can someone tell me what is the issue, did i do the configuration wrong or something?

---

<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:** [June 2, 2023, 2:01pm UTC](https://discuss.elastic.co/t/creating-a-new-beat-but-cant-see-proper-output/332645/2 "2023-06-02T14:01:35Z")

</div>

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