# Overriding timestamp in logstash

**URL:** https://discuss.elastic.co/t/overriding-timestamp-in-logstash/340515
**Category:** Elasticsearch
**Tags:** elastic-stack-monitoring
**Created:** [August 10, 2023, 7:26am UTC](https://discuss.elastic.co/t/overriding-timestamp-in-logstash/340515 "2023-08-10T07:26:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Indeed2000](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@Indeed2000](https://discuss.elastic.co/u/Indeed2000)
#### Post date: [August 10, 2023, 7:26am UTC](https://discuss.elastic.co/t/overriding-timestamp-in-logstash/340515/1 "2023-08-10T07:26:03Z")

</div>

Hi  
on logstash need to override timestamp, here is the scenario input file, output as http.

here is the string must be send via “http output”:  
mymeasure,tag=mytag field="myfield" 1689682934

FYI: this part "1689682934" is timestamp.

now question is how can i extract date from filename, and time from log line and create epoch time format like 1689682934 and put in end of line.

here is file name:  
/tmp/log.cus.20230720

here is log line:  
00:00:13.441 cus module: A[srv1]B[551]C[000]

expected timestamp  
20230720 00:00:13.441

expected timestamp in epochtime format  
1689682934

Any idea?  
Thanks

---

<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: [September 7, 2023, 7:26am UTC](https://discuss.elastic.co/t/overriding-timestamp-in-logstash/340515/2 "2023-09-07T07:26:09Z")

</div>

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