# Trouble selecting beats inputs

**URL:** <https://discuss.elastic.co/t/trouble-selecting-beats-inputs/235830>\
**Category:** Beats\
**Created:** [June 4, 2020, 6:02pm UTC](https://discuss.elastic.co/t/trouble-selecting-beats-inputs/235830 "2020-06-04T18:02:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maria\_Daniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maria_daniel/32/69697_2.png) [@Maria\_Daniel](https://discuss.elastic.co/u/Maria_Daniel)\
**Post date:** [June 4, 2020, 6:02pm UTC](https://discuss.elastic.co/t/trouble-selecting-beats-inputs/235830/1 "2020-06-04T18:02:43Z")

</div>

Hello!

So, i'm trying to select two different types of input files from the same directory. I add a different tag depending on the type of file so that I can later use different grok patterns to process the logs, based on the different tags.

This is my current input:

```auto
filebeat.inputs:
- type: log
  paths:
  - /var/log/conn/*/*/*.results
  tags: ["delivery_conn_results"]
- type: log
  paths:
  - /var/log/conn/*/*/!(*.results)
  tags: ["delivery_conn_total"]

```

And my files look like this:

![Captura de ecrã 2020-06-04, às 19.00.55](https://us1.discourse-cdn.com/elastic/original/3X/a/6/a60b36ef56bb657a7b9a1d29d480e76750746c27.png)

I'm succeeding at getting the "_XXX.results_" files, but now the other ones.

What should I do?

---

<div class="post-metadata">

**Author:** ![Maria\_Daniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maria_daniel/32/69697_2.png) [@Maria\_Daniel](https://discuss.elastic.co/u/Maria_Daniel)\
**Post date:** [June 5, 2020, 3:17pm UTC](https://discuss.elastic.co/t/trouble-selecting-beats-inputs/235830/2 "2020-06-05T15:17:24Z")

</div>

Hello again!

I solved this issue by using _"exclude\_files"_ like this:

```auto
filebeat.inputs:
- type: log
  paths:
  - /var/log/conn/*/*/*.results
  tags: ["delivery_conn_results"]
- type: log
  paths:
  - /var/log/conn/*/*/*
  exclude_files: ['\.results$']
  tags: ["delivery_conn_total"]

```

[Here](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html) is more info on how to use exclude\_files.

---

<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:** [July 3, 2020, 5:17pm UTC](https://discuss.elastic.co/t/trouble-selecting-beats-inputs/235830/3 "2020-07-03T17:17:24Z")

</div>

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