# Logstash only logs the word 'log' on completion

**URL:** <https://discuss.elastic.co/t/logstash-only-logs-the-word-log-on-completion/312916>\
**Category:** Logstash\
**Created:** [August 25, 2022, 12:01pm UTC](https://discuss.elastic.co/t/logstash-only-logs-the-word-log-on-completion/312916 "2022-08-25T12:01:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [August 25, 2022, 12:01pm UTC](https://discuss.elastic.co/t/logstash-only-logs-the-word-log-on-completion/312916/1 "2022-08-25T12:01:32Z")

</div>

I am using the following input configurations for deleting the files once read and log the information.

```auto
input {
  file {
    path => "C:/.log"
    mode => "read"
    file_completed_action => "log_and_delete"
    file_completed_log_path => "./ingested_files.log"
  }
}

```

Files are being read correctly and are being deleted after read operation is completed. The issue is, it only logs the word "log" in ingested\_files.log whereas I want to log information about the file (timestamp and filename) which was read.

At the moment, ingested\_files.log only contains "log" at every line.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 25, 2022, 4:48pm UTC](https://discuss.elastic.co/t/logstash-only-logs-the-word-log-on-completion/312916/2 "2022-08-25T16:48:55Z")

</div>

> [@usman1](#):
>
> I want to log information about the file (timestamp and filename) which was read.

The file input only [logs the path](https://github.com/logstash-plugins/logstash-input-file/blob/c543a2e9e12b6b07709a4e306c29dbecb660f991/lib/logstash/inputs/log_completed_file_handler.rb#L10), not the timestamp. Since you do not have any wildcard in the path option I would expect it only to log one value.

---

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [August 25, 2022, 4:51pm UTC](https://discuss.elastic.co/t/logstash-only-logs-the-word-log-on-completion/312916/3 "2022-08-25T16:51:24Z")

</div>

Thanks for the reply @Badger

Any suggestions about how can I log `[TIMESTAMP] [Filename]` to logs?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 25, 2022, 5:03pm UTC](https://discuss.elastic.co/t/logstash-only-logs-the-word-log-on-completion/312916/4 "2022-08-25T17:03:14Z")

</div>

You would have to fork the code and edit that logging function.

---

<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:** [September 22, 2022, 5:04pm UTC](https://discuss.elastic.co/t/logstash-only-logs-the-word-log-on-completion/312916/5 "2022-09-22T17:04:11Z")

</div>

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