# Filebeat should omit timestamp in logs when ran via systemd

**URL:** <https://discuss.elastic.co/t/filebeat-should-omit-timestamp-in-logs-when-ran-via-systemd/299087>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 8, 2022, 12:20pm UTC](https://discuss.elastic.co/t/filebeat-should-omit-timestamp-in-logs-when-ran-via-systemd/299087 "2022-03-08T12:20:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![XANi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xani/32/102753_2.png) [@XANi](https://discuss.elastic.co/u/XANi)\
**Post date:** [March 8, 2022, 12:20pm UTC](https://discuss.elastic.co/t/filebeat-should-omit-timestamp-in-logs-when-ran-via-systemd/299087/1 "2022-03-08T12:20:46Z")

</div>

Currently logs via systemd look like this:

```
Mar 08 13:13:10 appserv1 filebeat[22055]: 2022-03-08T13:13:10.657+0100 INFO instance/beat.go:694 Beat ID: 70152ff2-5b2e-4c03-a60c-eedffb110c54

```

and the timestamp is doubled. There should be option to run it without the timestamp, either via CLI option or autodetection (IIRC systemd sets few environmental variables like JOURNAL\_STREAM and INVOCATION\_ID so it could change format string based on that). In my code I used

```
        if os.Getenv("INVOCATION_ID") != "" || os.Getenv("JOURNAL_STREAM") != "" {
            consoleEncoderConfig.TimeKey = ""
    }

```

(for [go.uber.org/zap](http://go.uber.org/zap)) with good success.

---

<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 5, 2022, 2:21pm UTC](https://discuss.elastic.co/t/filebeat-should-omit-timestamp-in-logs-when-ran-via-systemd/299087/2 "2022-04-05T14:21:38Z")

</div>

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