# Send FileBeat Logs to Specific Type and Index in Elastic Search

**URL:** <https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 12, 2018, 2:23pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838 "2018-04-12T14:23:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![code\_blue](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@code\_blue](https://discuss.elastic.co/u/code_blue)\
**Post date:** [April 12, 2018, 2:23pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838/1 "2018-04-12T14:23:08Z")

</div>

How can we configure FileBeat to send logs to specific Index and Type defined in Elastic Search,

We have created a Mapping Inside an Index and have defined analyzers on the Mapping. But we cannot seem to configure FileBeat to send logs to that Index.

---

<div class="post-metadata">

**Author:** ![sancroth](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sancroth](https://discuss.elastic.co/u/sancroth)\
**Post date:** [April 12, 2018, 2:26pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838/2 "2018-04-12T14:26:35Z")

</div>

Taken from [here](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html).

```
output.elasticsearch:
  hosts: ["http://localhost:9200"]
  index: "filebeat-%{[beat.version]}-%{+yyyy.MM.dd}"

```

Add any other info like user/pass etc you need, and of course change the index to the proper name.  
I see no reason why this shouldn't work. Except if you are using x-pack and the user you are trying to send the events with has no rights on this index. Could this be the case?

---

<div class="post-metadata">

**Author:** ![code\_blue](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@code\_blue](https://discuss.elastic.co/u/code_blue)\
**Post date:** [April 12, 2018, 2:35pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838/3 "2018-04-12T14:35:24Z")

</div>

But we cannot seem to specify the type name here. We have a defined Type in the Index.

---

<div class="post-metadata">

**Author:** ![sancroth](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sancroth](https://discuss.elastic.co/u/sancroth)\
**Post date:** [April 12, 2018, 2:42pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838/4 "2018-04-12T14:42:26Z")

</div>

Not sure about the result but if i understand correct then you should use:

```
fields:
    document_type: myType

```

on your prospector. I remember reading about the "type" being removed for elastic or something though.

---

<div class="post-metadata">

**Author:** ![code\_blue](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@code\_blue](https://discuss.elastic.co/u/code_blue)\
**Post date:** [April 12, 2018, 2:46pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838/5 "2018-04-12T14:46:39Z")

</div>

Thanks for your response.

Are you referring to fields under the prospector? I thought document\_type is to mention where logs originate. But we can run a check see if that works.

---

<div class="post-metadata">

**Author:** ![sancroth](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sancroth](https://discuss.elastic.co/u/sancroth)\
**Post date:** [April 12, 2018, 2:49pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838/6 "2018-04-12T14:49:59Z")

</div>

If i am not mistaken, and by fast reading the docs, this should override elastics \_type field(defaults to doc).  
And yeah where your set your paths/fields/tags etc.  
Something like:

```
- type: log
  paths:
    - /my/path/
  fields:
    document_type: myType
```

---

<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:** [May 10, 2018, 2:50pm UTC](https://discuss.elastic.co/t/send-filebeat-logs-to-specific-type-and-index-in-elastic-search/127838/7 "2018-05-10T14:50:09Z")

</div>

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