# Разделение логов по индексам в Filebeat

**URL:** <https://discuss.elastic.co/t/filebeat/239125>\
**Category:** Вопросы на русском языке\
**Created:** [June 29, 2020, 2:19pm UTC](https://discuss.elastic.co/t/filebeat/239125 "2020-06-29T14:19:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [June 29, 2020, 2:41pm UTC](https://discuss.elastic.co/t/filebeat/239125/2 "2020-06-29T14:41:07Z")

</div>

> [@Output to multiple indexes straight from filebeat.yml?](https://discuss.elastic.co/t/output-to-multiple-indexes-straight-from-filebeat-yml/130165/2):
>
> you hardcoded the index name in your output to index1. It is the index setting which selects the index name to use. See [index docs](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html#index-option-es) and [indices docs](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html#_literal_indices_literal). The index setting supports [Format Strings](https://www.elastic.co/guide/en/beats/libbeat/current/config-file-format-type.html#_format_string_sprintf). That is, you can use any field in the event to construct the index. e.g. filebeat.prospectors: - ... fields: type: "logs1" - ... fields: type: "logs2" setup.template.name: "index-%{[beat.version]}" setup.template.pattern: "index-%{[beat.version]}-\*" output.elasticsearch: ... index: "…

Только этот пост старый, теперь `prospectors` завутся `inputs`. Остальное должно работать.

---

_[View the full topic](https://discuss.elastic.co/t/filebeat/239125)._
