# Date extraction from a log file

**URL:** https://discuss.elastic.co/t/date-extraction-from-a-log-file/136883
**Category:** Logstash
**Created:** [June 21, 2018, 1:40pm UTC](https://discuss.elastic.co/t/date-extraction-from-a-log-file/136883 "2018-06-21T13:40:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mariyana](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mariyana](https://discuss.elastic.co/u/mariyana)
#### Post date: [June 21, 2018, 1:40pm UTC](https://discuss.elastic.co/t/date-extraction-from-a-log-file/136883/1 "2018-06-21T13:40:23Z")

</div>

hi,  
I want to extract date from a log file to another field in elastic search that is coming through logstash. My log file is like this

21 May 2018 12:13:32,025 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem

What I want is get the date field extracted using logstash and save it to elastic search. Any help would be appreciable.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 21, 2018, 1:43pm UTC](https://discuss.elastic.co/t/date-extraction-from-a-log-file/136883/2 "2018-06-21T13:43:05Z")

</div>

Use a grok filter to extract fields (like the timestamp) and use a date filter to parse the timestamp into a standard format.

This is a standard setup for which there are countless examples, though probably not the exact log format you have.

---

<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 19, 2018, 1:43pm UTC](https://discuss.elastic.co/t/date-extraction-from-a-log-file/136883/3 "2018-07-19T13:43:07Z")

</div>

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