# Filebeat-6.2.3： timestamp issue with output.kafka

**URL:** https://discuss.elastic.co/t/filebeat-6-2-3-timestamp-issue-with-output-kafka/127800
**Category:** Beats
**Tags:** filebeat
**Created:** [April 12, 2018, 11:06am UTC](https://discuss.elastic.co/t/filebeat-6-2-3-timestamp-issue-with-output-kafka/127800 "2018-04-12T11:06:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Brian\_Chung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_chung/32/29928_2.png) [@Brian\_Chung](https://discuss.elastic.co/u/Brian_Chung)
#### Post date: [April 12, 2018, 11:06am UTC](https://discuss.elastic.co/t/filebeat-6-2-3-timestamp-issue-with-output-kafka/127800/1 "2018-04-12T11:06:26Z")

</div>

filebeat version: filebeat-6.2.3  
kafka version: 0.10.2.1  
filebeat.yml as follows:

filebeat.prospectors:

- type: log  
enabled: ture  
paths:
  - /opt/filebeat/test.log  
fields:  
log\_topic: test  
tag: bdu

output.kafka:  
hosts: ["kafka1", "kafka2", "kafka3"]  
topic: '%{[fields.log\_topic]}'  
required\_ack: 1

It works perfect, but I have a requirement for changing the default @timestamp format (ISO 8601)  
from: "@timestamp": "2018-04-12T10:58:01.787Z"  
to: "@timestamp": "2018-04-12T18:58:01.787+08:00"

and I found in the /var/lib/filebeat/registry  
the timestamp is exactly the format I need

is it possible to get the timestamp format in /var/lib/filebeat/registry ?

is there any other solution like getting the local time in fields ?

---

<div class="post-metadata">

### Author: ![sancroth](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sancroth](https://discuss.elastic.co/u/sancroth)
#### Post date: [April 12, 2018, 11:19am UTC](https://discuss.elastic.co/t/filebeat-6-2-3-timestamp-issue-with-output-kafka/127800/2 "2018-04-12T11:19:14Z")

</div>

Have a look at [https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html)  
date {  
match =\> ["@timestamp", "YYYY-MM-ddddTHH:mm:ssZZ"]  
}  
or something like this could work.  
You need some testing. Also i wouldn't quite recommend messing with timestamp itself, not sure how kibana/elastic might be affected.Try to create a second field "custom\_date"(?) and test on that.

Edit: My bad you are not using logstash, you can't use this approach unless you add logstash in your stack.

---

<div class="post-metadata">

### Author: ![Brian\_Chung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_chung/32/29928_2.png) [@Brian\_Chung](https://discuss.elastic.co/u/Brian_Chung)
#### Post date: [April 12, 2018, 11:35am UTC](https://discuss.elastic.co/t/filebeat-6-2-3-timestamp-issue-with-output-kafka/127800/3 "2018-04-12T11:35:08Z")

</div>

Thanks for the respond

So is it possible to have a field like this:

fields:  
timestamp: {local host time}

Cause I haven’t figured out what variable to deal with that

---

<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: [May 10, 2018, 11:35am UTC](https://discuss.elastic.co/t/filebeat-6-2-3-timestamp-issue-with-output-kafka/127800/4 "2018-05-10T11:35:24Z")

</div>

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