# Override filebeat input paths using command line configuration override?

**URL:** https://discuss.elastic.co/t/override-filebeat-input-paths-using-command-line-configuration-override/339482
**Category:** Beats
**Tags:** filebeat
**Created:** [July 27, 2023, 10:22pm UTC](https://discuss.elastic.co/t/override-filebeat-input-paths-using-command-line-configuration-override/339482 "2023-07-27T22:22:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tolland](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tolland/32/116498_2.png) [@tolland](https://discuss.elastic.co/u/tolland)
#### Post date: [July 27, 2023, 10:22pm UTC](https://discuss.elastic.co/t/override-filebeat-input-paths-using-command-line-configuration-override/339482/1 "2023-07-27T22:22:59Z")

</div>

I have a filebeat filestream input which parses a complicated message format. There are a few edge cases I'd like to create standalone tests for. I'd like to test single instances of the the message format from the command line, so basically pass the input.d config file to filebeat but override the `paths` parameter to point at my sample log, rather than the live log file.

I have a sample line of my format in a file like so `/path/to/sample1.log`

```auto
2023‐07‐27T22:10:55Z,field1,field2,some,other,stuff,{"key":"val"},more,stuff

```

and a input configuration in `inputs.d/my-filestream-id.yml`

```auto
- type: filestream
  id: my-filestream-id 
  paths:
    - /var/log/my-complicated-logfile.log
  ...
  processors:
     xxxx
  parsers:
     yyyy

```

so basically I want to do something like this from the command line:

```shell
filebeat -E filebeat.config.inputs.path=inputs.d/my-filestream-id.yml \
    -E 'filebeat.inputs.my-filestream-id.paths=["/path/to/sample1.log"] \
    -E output.console.enabled=true \
    -e --once

```

so it spits out the processed message to the console.

Is this possible to do something like this?

Edit:

I tried a few variations like:

```shell
filebeat -E filebeat.config.inputs.path=inputs.d/my-filestream-id.yml \
    -E 'filebeat.inputs.0.paths=["/path/to/sample1.log"] \
    -E output.console.enabled=true \
    -e 

```

These don't cause the overridden path to be used, still is polling the original path in the the inputs.d config file

Many Thanks

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [July 31, 2023, 4:22pm UTC](https://discuss.elastic.co/t/override-filebeat-input-paths-using-command-line-configuration-override/339482/2 "2023-07-31T16:22:21Z")

</div>

Hey @tolland,

I am not sure if this is possible. I think configuration overrides only work on the main configuration file. You would need to put your inputs configuration in the main file.

You can try though to use environment variables, you could set a default in your configuration file, and override it when running filebeat.  
Find here docs about using environment variables in configuration: [Use environment variables in the configuration | Filebeat Reference [8.9] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/8.9/using-environ-vars.html)

Btw, if you have log files that are complicated to parse, you can also consider using [Ingest Pipelines](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/ingest.html), that offer many more options and have a [Simulate API](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/simulate-pipeline-api.html) for testing.

---

<div class="post-metadata">

### Author: ![tolland](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tolland/32/116498_2.png) [@tolland](https://discuss.elastic.co/u/tolland)
#### Post date: [August 1, 2023, 9:52am UTC](https://discuss.elastic.co/t/override-filebeat-input-paths-using-command-line-configuration-override/339482/3 "2023-08-01T09:52:00Z")

</div>

Yes the env thing will work! not sure how I missed that. Many Thanks!

Also, I definitely would have used ingest pipelines if I was starting from scratch.

---

<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: [August 29, 2023, 11:52am UTC](https://discuss.elastic.co/t/override-filebeat-input-paths-using-command-line-configuration-override/339482/4 "2023-08-29T11:52:39Z")

</div>

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