# File Import Timestamps

**URL:** <https://discuss.elastic.co/t/file-import-timestamps/169318>\
**Category:** Beats\
**Created:** [February 21, 2019, 3:24am UTC](https://discuss.elastic.co/t/file-import-timestamps/169318 "2019-02-21T03:24:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renny](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@Renny](https://discuss.elastic.co/u/Renny)\
**Post date:** [February 21, 2019, 3:24am UTC](https://discuss.elastic.co/t/file-import-timestamps/169318/1 "2019-02-21T03:24:36Z")

</div>

Hi,

Looking for some direction on how to utilize a combination of Filename (2019/02/21 - YYYY/MM/DD) and the first 8 characters of each line in the file (04:16:50 - HH:NN:SS) instead of the generic @timestamp being utilized by the Time Filter Field Name.

Haven't had much luck searching for answers, it's a pretty basic install of Elasticsearch, Logstash and Kibana on a single server with Filebeats sending the files to Elasticsearch :9200

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [February 21, 2019, 1:45pm UTC](https://discuss.elastic.co/t/file-import-timestamps/169318/2 "2019-02-21T13:45:42Z")

</div>

There's probably a few ways to do this. With Logstash you could:

- grok the date from the filename
- grok the time from the message
- create a new field using the [mutate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-replace) filter that joins `%{filename_date} %{message_ts}`
- then use a `date` filter to set the @timestamp

---

<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:** [March 21, 2019, 3:45pm UTC](https://discuss.elastic.co/t/file-import-timestamps/169318/3 "2019-03-21T15:45:43Z")

</div>

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