# I am sending a customized log file to filebeat, in which my time format is not able to come in date format type

**URL:** <https://discuss.elastic.co/t/i-am-sending-a-customized-log-file-to-filebeat-in-which-my-time-format-is-not-able-to-come-in-date-format-type/162479>\
**Category:** Logstash\
**Created:** [December 31, 2018, 7:52am UTC](https://discuss.elastic.co/t/i-am-sending-a-customized-log-file-to-filebeat-in-which-my-time-format-is-not-able-to-come-in-date-format-type/162479 "2018-12-31T07:52:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SunilT](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@SunilT](https://discuss.elastic.co/u/SunilT)\
**Post date:** [December 31, 2018, 7:52am UTC](https://discuss.elastic.co/t/i-am-sending-a-customized-log-file-to-filebeat-in-which-my-time-format-is-not-able-to-come-in-date-format-type/162479/1 "2018-12-31T07:52:08Z")

</div>

I am sending my data to elasticsearch through logstash from customized log file, with a "time2" field in it, i am not able to find a way how to convert time2 field into date type format.  
below is my log file:

"score":{

{"username":"Su200222","process1":"chrome.exe","RAM1":8,"time2":"11:24:54 AM 12/30/2018"},

{"username":"Su200222","process1":"chrome.exe","RAM1":6,"time2":"11:30:54 AM 12/30/2018"},

{"username":"Su200222","process1":"chrome.exe","RAM1":7,"time2":"11:40:54 AM 12/30/2018"},

{"username":"Su200222","process1":"chrome.exe","RAM1":5,"time2":"11:55:54 AM 12/30/2018"},

{"username":"Su200222","process1":"chrome.exe","RAM1":3,"time2":"12:24:54 PM 12/30/2018"},

{"username":"Su200222","process1":"chrome.exe","RAM1":9,"time2":"12:54:54 PM 12/30/2018"}

}

And below is my logstash-simple.conf file

input {  
beats {  
port =\> 5044  
}  
}

filter {  
date {  
match =\> ["time2", "HH:mm:ss MM/dd/yyyy"]  
}  
}

output {  
elasticsearch {  
hosts =\> "localhost:9200"  
manage\_template =\> false  
index =\> "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"  
}  
}

Can some one help me how to convert this field into date type.  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![staodd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/staodd/32/24509_2.png) [@staodd](https://discuss.elastic.co/u/staodd)\
**Post date:** [January 3, 2019, 11:23pm UTC](https://discuss.elastic.co/t/i-am-sending-a-customized-log-file-to-filebeat-in-which-my-time-format-is-not-able-to-come-in-date-format-type/162479/2 "2019-01-03T23:23:32Z")

</div>

Did you check if your grok pattern works? You don't match for AM or PM. Did you try to verify the pattern against a log line with grokdebug og grokconstructor?

---

<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:** [January 31, 2019, 11:23pm UTC](https://discuss.elastic.co/t/i-am-sending-a-customized-log-file-to-filebeat-in-which-my-time-format-is-not-able-to-come-in-date-format-type/162479/3 "2019-01-31T23:23:37Z")

</div>

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