# Renaming log file in filebeat and passing index name

**URL:** https://discuss.elastic.co/t/renaming-log-file-in-filebeat-and-passing-index-name/260519
**Category:** Beats
**Tags:** filebeat
**Created:** [January 8, 2021, 9:11am UTC](https://discuss.elastic.co/t/renaming-log-file-in-filebeat-and-passing-index-name/260519 "2021-01-08T09:11:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![navin1093](https://avatars.discourse-cdn.com/v4/letter/n/e47c2d/32.png) [@navin1093](https://discuss.elastic.co/u/navin1093)
#### Post date: [January 8, 2021, 9:11am UTC](https://discuss.elastic.co/t/renaming-log-file-in-filebeat-and-passing-index-name/260519/1 "2021-01-08T09:11:33Z")

</div>

hi can i knowif wish to renmae the log before sending to logstash. Besides that, I also wish to set index name based on respective paths. How can this be done in filebeat. I saw we have something called fields but fields will only set index name . What would be the best approach

```auto
- type: log
  paths:
    - /home/navin/log/eai_new.log
    - /home/navin/log/access.log
- type: log
  paths:
    - /home/navin/log/apps.log
    - /home/navin/log/console.log

```

---

<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: [February 5, 2021, 11:11am UTC](https://discuss.elastic.co/t/renaming-log-file-in-filebeat-and-passing-index-name/260519/2 "2021-02-05T11:11:43Z")

</div>

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