# Setup filebeat module

**URL:** https://discuss.elastic.co/t/setup-filebeat-module/247658
**Category:** Beats
**Tags:** beats-module, filebeat
**Created:** [September 6, 2020, 7:04am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658 "2020-09-06T07:04:59Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![headtea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/headtea/32/24271_2.png) [@headtea](https://discuss.elastic.co/u/headtea)
#### Post date: [September 6, 2020, 7:04am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/1 "2020-09-06T07:04:59Z")

</div>

I'm trying to set up the [apache module in filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-apache.html). I output filebeat to logstash. Just for some context I've enabled pipelines with this command:

```
filebeat setup --pipelines --dashboards --modules apache -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["https://elastic:password@202.71.11.11:9200"]' -E output.elasticsearch.ssl.certificate_authorities=/etc/beats/http2.crt

```

I've set up the `/modules.d/apache.yml` with [these settings](https://i.imgur.com/zFtSzQY.png).

When I start filebeat, I get this message:

```
{"level":"info","timestamp":"2020-09-06T06:58:58.574Z","logger":"monitoring","caller":"log/log.go:131","message":"Stopping metrics logging."}
{"level":"info","timestamp":"2020-09-06T06:58:58.574Z","caller":"instance/beat.go:456","message":"filebeat stopped."}
{"level":"error","timestamp":"2020-09-06T06:58:58.574Z","caller":"instance/beat.go:951","message":"Exiting: Failed to start crawler: creating module reloader failed: Error getting config for fileset apache/access: Error interpreting the template of the input: template: text:3:22: executing \"text\" at <.paths>: range can't iterate over /var/log/httpd/access_log*"}
Exiting: Failed to start crawler: creating module reloader failed: Error getting config for fileset apache/access: Error interpreting the template of the input: template: text:3:22: executing "text" at <.paths>: range can't iterate over /var/log/httpd/access_log*

```

The path `/var/log/httpd/access_log*` does exist though:

```
]# ll /var/log/httpd/access_log*
-rw-r--r-- 1 root root 0 Sep 6 03:48 /var/log/httpd/access_log
-rw-r--r-- 1 root root 4948 Aug 15 08:17 /var/log/httpd/access_log-20200816
-rw-r--r-- 1 root root 5837 Aug 21 14:20 /var/log/httpd/access_log-20200823
-rw-r--r-- 1 root root 3867 Aug 29 13:13 /var/log/httpd/access_log-20200830
-rw-r--r-- 1 root root 16917 Sep 3 15:06 /var/log/httpd/access_log-20200906
```

---

<div class="post-metadata">

### Author: ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)
#### Post date: [September 6, 2020, 9:50am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/2 "2020-09-06T09:50:29Z")

</div>

Try to use this synatxe

```
 var.paths:
      - '/var/log/httpd/access_log*'
```

---

<div class="post-metadata">

### Author: ![headtea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/headtea/32/24271_2.png) [@headtea](https://discuss.elastic.co/u/headtea)
#### Post date: [September 6, 2020, 10:20am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/3 "2020-09-06T10:20:03Z")

</div>

Thanks for the response,

Getting the same result.

---

<div class="post-metadata">

### Author: ![headtea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/headtea/32/24271_2.png) [@headtea](https://discuss.elastic.co/u/headtea)
#### Post date: [September 6, 2020, 11:16am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/4 "2020-09-06T11:16:27Z")

</div>

# SOLVED:

> [@Unable to ingest apache2 logs through filebeat](https://discuss.elastic.co/t/unable-to-ingest-apache2-logs-through-filebeat/146309/3):
>
> The vars.paths setting in the apache module requires an array. The template engine complaints about it being a plain string. Update your modules setting to say: filebeat.modules: #------------------------------- Apache2 Module ------------------------------ - module: apache2 access: enabled: true # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. var.paths: - '/opt/bea/Logwarhouse/MarketApache/\*access.log' e…

Has solved the issue! for some VERY strange reason it only accepts arrays?

---

<div class="post-metadata">

### Author: ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)
#### Post date: [September 6, 2020, 11:32am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/5 "2020-09-06T11:32:41Z")

</div>

Yes only array

---

<div class="post-metadata">

### Author: ![headtea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/headtea/32/24271_2.png) [@headtea](https://discuss.elastic.co/u/headtea)
#### Post date: [September 6, 2020, 11:33am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/6 "2020-09-06T11:33:58Z")

</div>

I'm sorry you were right. I'm an idiot. I copied your syntax wrong. I just put `'` around it. Didn't notice you did it as an array.

Thank you. Changed your answer to be the solution.

---

<div class="post-metadata">

### Author: ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)
#### Post date: [September 6, 2020, 11:35am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/7 "2020-09-06T11:35:12Z")

</div>

You're welcome, this is always happens with yaml 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: [October 4, 2020, 11:35am UTC](https://discuss.elastic.co/t/setup-filebeat-module/247658/8 "2020-10-04T11:35:18Z")

</div>

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