# Output file plugin not creating timestamped file

**URL:** <https://discuss.elastic.co/t/output-file-plugin-not-creating-timestamped-file/186334>\
**Category:** Logstash\
**Created:** [June 18, 2019, 6:20pm UTC](https://discuss.elastic.co/t/output-file-plugin-not-creating-timestamped-file/186334 "2019-06-18T18:20:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikmathis](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@erikmathis](https://discuss.elastic.co/u/erikmathis)\
**Post date:** [June 18, 2019, 6:20pm UTC](https://discuss.elastic.co/t/output-file-plugin-not-creating-timestamped-file/186334/1 "2019-06-18T18:20:04Z")

</div>

```
output {
  file{
    path => "/var/log/kube-audit/audit-%{+YYYY.MM.dd.HH}.log"
    create_if_deleted => true
    id => "file"
}

```

The file looks ends up being /var/log/kube-audit/audit-.log. The timestamp works fine in the elasticsearch output plugin so I'm not sure why this is broken.

---

<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:** [June 18, 2019, 6:42pm UTC](https://discuss.elastic.co/t/output-file-plugin-not-creating-timestamped-file/186334/2 "2019-06-18T18:42:30Z")

</div>

In 7.1.1 that works as expected, provided, of course, that the events have an @timestamp field (that's what it uses to do the sprintf).

---

<div class="post-metadata">

**Author:** ![erikmathis](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@erikmathis](https://discuss.elastic.co/u/erikmathis)\
**Post date:** [June 18, 2019, 8:30pm UTC](https://discuss.elastic.co/t/output-file-plugin-not-creating-timestamped-file/186334/3 "2019-06-18T20:30:40Z")

</div>

Thanks!

I noticed that the @timestamp field was removed from a bad example on the kubernetes docs.

---

<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 16, 2019, 8:30pm UTC](https://discuss.elastic.co/t/output-file-plugin-not-creating-timestamped-file/186334/4 "2019-07-16T20:30:44Z")

</div>

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