# Using grok filter show log timestamp in time

**URL:** <https://discuss.elastic.co/t/using-grok-filter-show-log-timestamp-in-time/222872>\
**Category:** Kibana\
**Created:** [March 10, 2020, 7:03am UTC](https://discuss.elastic.co/t/using-grok-filter-show-log-timestamp-in-time/222872 "2020-03-10T07:03:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lohit18](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lohit18/32/64131_2.png) [@lohit18](https://discuss.elastic.co/u/lohit18)\
**Post date:** [March 10, 2020, 7:03am UTC](https://discuss.elastic.co/t/using-grok-filter-show-log-timestamp-in-time/222872/1 "2020-03-10T07:03:57Z")

</div>

Dear Team,

Kindly help me with this how to do

{  
"\_index": "env-2020.03.09",  
"\_type": "\_doc",  
"\_id": "dsfhdsj2e630",  
"\_version": 1,  
"\_score": null,  
"\_source": {  
"type": "Monitor Logs",  
"host": "efjf4323",  
"message": "2020-03-08 08:55:12,415 localq-stats-0 INFO [c.a.j.c.distribution.localq.LocalQCacheManager] ",  
"@timestamp": "2020-03-09T10:28:56.460Z",  
"@version": "1"

},  
"fields": {  
"@timestamp": [  
"2020-03-09T10:28:56.460Z"  
]  
},  
"sort": [  
1583749736460  
]  
}

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [March 12, 2020, 3:45pm UTC](https://discuss.elastic.co/t/using-grok-filter-show-log-timestamp-in-time/222872/2 "2020-03-12T15:45:52Z")

</div>

Hello,

Can you be more explicit on your request? What exactly do you need to extract with a grok filter?

---

<div class="post-metadata">

**Author:** ![lohit18](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lohit18/32/64131_2.png) [@lohit18](https://discuss.elastic.co/u/lohit18)\
**Post date:** [March 16, 2020, 7:12am UTC](https://discuss.elastic.co/t/using-grok-filter-show-log-timestamp-in-time/222872/3 "2020-03-16T07:12:47Z")

</div>

Dear Marius\_Dragomir,

I am trying to extract **MY LOG Timestamp** to **Logstash Timestamp**.

######################################################################  
**Message** : "message": "2020-03-08 08:55:12,415 localq-stats-0 INFO [http-nio-8080-exec-25] loggingFilter - Recieved 'GET' request from user  
'anonymousUser' accessing from '172.115.133.50' url:'[http://www.mercurycards.com/gateway/platform-services/api/v1/maintenance/isMa-intenanceActive](http://www.mercurycards.com/gateway/platform-services/api/v1/maintenance/isMa-intenanceActive)'

######################################################################

**Need to extract timestamp from the above and replace it with logstash timesatmp**

I am passing parameters in .conf file like this

input {  
# File paths must be absolute

```
    file {
            type => "Monitor Logs"
            add_field => { "project" => "estro"}
            path => "/etc/monitor*.log"
            start_position => "beginning"
            sincedb_path => "/dev/opt"
            codec => multiline {
            pattern => "^%{TIMESTAMP_ISO8601}"
            negate => true
            what => "previous"
            }

```

}  
}

filter {  
grok {  
match =\>{  
"message" =\> "^%{TIMESTAMP\_ISO8601}"}

}

date {  
match =\> ["@timestamp" , "(?[\d-\s:]+)"]  
target =\> "@timestamp"  
timezone =\> "UTC"  
}  
}

output {

```
    elasticsearch{

```

hosts=\>["localhost:9200"]  
index=\>"estros"  
}  
#stdout{codec=\> rubydebug }  
}

---

<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:** [April 13, 2020, 7:12am UTC](https://discuss.elastic.co/t/using-grok-filter-show-log-timestamp-in-time/222872/4 "2020-04-13T07:12:48Z")

</div>

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