# Custom Beat with Multiple Event Field Structures

**URL:** <https://discuss.elastic.co/t/custom-beat-with-multiple-event-field-structures/206350>\
**Category:** Beats\
**Tags:** beats-development\
**Created:** [November 4, 2019, 7:56am UTC](https://discuss.elastic.co/t/custom-beat-with-multiple-event-field-structures/206350 "2019-11-04T07:56:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![0xThiebaut](https://avatars.discourse-cdn.com/v4/letter/0/f17d59/32.png) [@0xThiebaut](https://discuss.elastic.co/u/0xThiebaut)\
**Post date:** [November 4, 2019, 7:56am UTC](https://discuss.elastic.co/t/custom-beat-with-multiple-event-field-structures/206350/1 "2019-11-04T07:56:46Z")

</div>

I am writing a custom network-related Beat following the ["Creating a New Beat"](https://www.elastic.co/guide/en/beats/devguide/current/new-beat.html) dev-guide.

As part of this Beat, I would like multiple type of events to be produced which would have different field mappings. The above Elastic guide explains how to define the event's fields from the `fields.yml` file as follow:

```auto
- key: countbeat
  title: countbeat
  description:
  fields:
    - name: counter
      type: long
      required: true
      description: >
        PLEASE UPDATE DOCUMENTATION

```

Is there a way to define multiple event structures and select the appropriate structure when generating the event in the Beat's code? I'm looking to achieve something as follow:

```auto
- key: countbeatA
  title: countbeatA
  description:
  fields:
    - name: counter
      type: long
      required: true
      description: >
        Some counter on A

- key: countbeatB
  title: countbeatB
  description:
  fields:
    - name: counter
      type: boolean
      required: true
      description: >
        Whether we use a counter in B

```

Thanks in advance!

---

<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 2, 2019, 7:56am UTC](https://discuss.elastic.co/t/custom-beat-with-multiple-event-field-structures/206350/2 "2019-12-02T07:56:47Z")

</div>

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