# Filebeat Autodiscover Hints Breaking Template

**URL:** <https://discuss.elastic.co/t/filebeat-autodiscover-hints-breaking-template/137310>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 25, 2018, 6:58pm UTC](https://discuss.elastic.co/t/filebeat-autodiscover-hints-breaking-template/137310 "2018-06-25T18:58:07Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Evesy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evesy/32/29520_2.png) [@Evesy](https://discuss.elastic.co/u/Evesy)\
**Post date:** [June 26, 2018, 3:56pm UTC](https://discuss.elastic.co/t/filebeat-autodiscover-hints-breaking-template/137310/10 "2018-06-26T15:56:07Z")

</div>

Hey @exekias,

I have managed to almost achieve what I was after. I've been able to use the hints autodiscover to only publish logs with a specific annotation, whilst also being able to make use of multiline hints:

```auto
    filebeat.autodiscover:
      providers:
        - type: kubernetes
          hints.enabled: true
          include_annotations: [logging']

    processors:
    - add_cloud_metadata: ~
    - drop_event:
        when:
          not:
            equals:
              kubernetes.annotations.logging: 'true'

```

The last thing I'm struggling to get working is `tail_files` within the Kubernetes autodiscovery (Since our filebeat instances are stateless). Currently when a filebeat restarts it ends up scraping logs that have already been scraped, resulting in duplicated messages being published.

Is there somewhere I can configure the hints discovery/kubernetes logger to only tail files?  
Neither of the below configs appear to work:

```auto
    filebeat.autodiscover:
      providers:
        - type: kubernetes
          hints.enabled: true
          include_annotations: ['logging']
          config:
            - type: docker
              tail_files: true

    processors:
    - add_cloud_metadata: ~
    - drop_event:
        when:
          not:
            equals:
              kubernetes.annotations.logging: 'true'

```

```auto
    filebeat.autodiscover:
      providers:
        - type: kubernetes
          hints.enabled: true
          include_annotations: ['logging']
          tail_files: true

    processors:
    - add_cloud_metadata: ~
    - drop_event:
        when:
          not:
            equals:
              kubernetes.annotations.logging: 'true'

```

---

_[View the full topic](https://discuss.elastic.co/t/filebeat-autodiscover-hints-breaking-template/137310)._
