# Send custom logs to elasticsearch with predefined list of fields

**URL:** <https://discuss.elastic.co/t/send-custom-logs-to-elasticsearch-with-predefined-list-of-fields/338681>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [July 18, 2023, 1:25pm UTC](https://discuss.elastic.co/t/send-custom-logs-to-elasticsearch-with-predefined-list-of-fields/338681 "2023-07-18T13:25:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johannnnnn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johannnnnn/32/106031_2.png) [@Johannnnnn](https://discuss.elastic.co/u/Johannnnnn)\
**Post date:** [July 18, 2023, 1:25pm UTC](https://discuss.elastic.co/t/send-custom-logs-to-elasticsearch-with-predefined-list-of-fields/338681/1 "2023-07-18T13:25:53Z")

</div>

Disclaimer: I am very confused about filebeat help files. If I need anything more technical than sending a log line to elasticsearch, it does not explain anything. It just states options and leaves me to find out which options I need and what values to set them to.

Situation:

- Windows server with Filebeat installed
- Filebeat has access to Elasticsearch and Kibana (simply no security needed)
- Custom log of one json per line
- Fields description both in json and yml available

Up until now, we just dumped a line of json as a message to ES and it worked, because everything was a keyword. But now I need to analyse some fields into numbers and dates

I think I need an index template. I have defined an index template in Kibana.  
I think filebeat needs the name of this index template to be able to load it (?).

Please advise

---

<div class="post-metadata">

**Author:** ![eMitch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emitch/32/93607_2.png) [@eMitch](https://discuss.elastic.co/u/eMitch)\
**Post date:** [July 18, 2023, 2:22pm UTC](https://discuss.elastic.co/t/send-custom-logs-to-elasticsearch-with-predefined-list-of-fields/338681/2 "2023-07-18T14:22:20Z")

</div>

Hi @Johannnnnn

in Filebeat, you're specifying the index being written to in Elasticsearch. If that index name matches the pattern that you have configured in your index template, when a new index is created (as in the case of the first event written for a day) the template will be used to generate that new index.

---

<div class="post-metadata">

**Author:** ![Johannnnnn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johannnnnn/32/106031_2.png) [@Johannnnnn](https://discuss.elastic.co/u/Johannnnnn)\
**Post date:** [August 8, 2023, 8:43am UTC](https://discuss.elastic.co/t/send-custom-logs-to-elasticsearch-with-predefined-list-of-fields/338681/3 "2023-08-08T08:43:40Z")

</div>

Hi Mitch. This is the current setup of my filebeat.yml:

```auto
  # ======================= Elasticsearch template setting =======================

setup.template.overwrite: true
setup.template.name: "performance-tests"
setup.template.pattern: "performance-functional-test*"
setup.ilm.enabled: false

```

Do I understand correctly, by setting the overwrite to true, filebeat will overwrite any mapping I set under Index Management \> Index templates \> template \> Mappings?

---

<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:** [September 5, 2023, 10:44am UTC](https://discuss.elastic.co/t/send-custom-logs-to-elasticsearch-with-predefined-list-of-fields/338681/4 "2023-09-05T10:44:27Z")

</div>

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