# Filebeatでの\_typeの変更について

**URL:** <https://discuss.elastic.co/t/filebeat-type/222417>\
**Category:** 日本語による質問・議論はこちら\
**Created:** [March 6, 2020, 7:51am UTC](https://discuss.elastic.co/t/filebeat-type/222417 "2020-03-06T07:51:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Negi700](https://avatars.discourse-cdn.com/v4/letter/n/e9bcb4/32.png) [@Negi700](https://discuss.elastic.co/u/Negi700)\
**Post date:** [March 6, 2020, 7:51am UTC](https://discuss.elastic.co/t/filebeat-type/222417/1 "2020-03-06T07:51:14Z")

</div>

Filebeatで収集しているログの「\_type」を、「doc」から、「statistics\_access\_log」に変更したいです。  
上記は、可能でしょうか？

下記の設定をしたのですが、反映されず、困っています。

```
 filebeat.yml
 
 
    - type: log
      enabled: true
      
      close_inactive: 5m
      ignore_older: 15m
      paths:
        - /var/lib/kubelet/plugins/kubernetes.io/access_log.*
      tags:
        - Apache_access_log
      _type:
        - statistics_access_log

```

以上、よろしくお願いします。

---

<div class="post-metadata">

**Author:** ![tsgkdt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsgkdt/32/39151_2.png) [@tsgkdt](https://discuss.elastic.co/u/tsgkdt)\
**Post date:** [March 8, 2020, 8:37am UTC](https://discuss.elastic.co/t/filebeat-type/222417/2 "2020-03-08T08:37:47Z")

</div>

Typeについては使われなくなる方向で進んでいると認識していますが、  
どのバージョンのfilebeatをお使いでしょうか？

こちらによると、filebaet5.5のとき、doc固定になっていると書かれています。

> [@Document\_type deprecated?](https://discuss.elastic.co/t/document-type-deprecated/96441/6):
>
> Hm.... checking the 5.5 branch I clearly see \_type being hardcoded to docs. The \_type field is set here: [https://github.com/elastic/beats/blob/5.5/libbeat/outputs/elasticsearch/client.go#L325](https://github.com/elastic/beats/blob/5.5/libbeat/outputs/elasticsearch/client.go#L325) with eventType being hardcoded to "doc": [https://github.com/elastic/beats/blob/5.5/libbeat/outputs/elasticsearch/client.go#L96](https://github.com/elastic/beats/blob/5.5/libbeat/outputs/elasticsearch/client.go#L96) Are you using the Elasticsearch output or Logstash?

また、最新のドキュメントを確認してもtypeが指定できるとマニュアル上で見つけることができませんでした。

> **[filebeat.reference.yml | Filebeat Reference \[7.6\] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/7.6/filebeat-reference-yml.html)**

\_typeを変更したい理由によっては、代替案があるかもしれませんが、  
マニュアルを見た限りですと、filebeat7.xでは\_typeは変えられなさそうです。

ご参考になれば幸いです。

---

<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:** [April 5, 2020, 8:37am UTC](https://discuss.elastic.co/t/filebeat-type/222417/3 "2020-04-05T08:37:53Z")

</div>

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