# Functionbeat unable to extract microsecond @timestamp using decode\_json\_fields

**URL:** <https://discuss.elastic.co/t/functionbeat-unable-to-extract-microsecond-timestamp-using-decode-json-fields/314494>\
**Category:** Beats\
**Tags:** functionbeat\
**Created:** [September 15, 2022, 9:55am UTC](https://discuss.elastic.co/t/functionbeat-unable-to-extract-microsecond-timestamp-using-decode-json-fields/314494 "2022-09-15T09:55:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrian-skybaker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrian-skybaker/32/110916_2.png) [@adrian-skybaker](https://discuss.elastic.co/u/adrian-skybaker)\
**Post date:** [September 15, 2022, 9:55am UTC](https://discuss.elastic.co/t/functionbeat-unable-to-extract-microsecond-timestamp-using-decode-json-fields/314494/1 "2022-09-15T09:55:15Z")

</div>

I'm having issues extracting a @timestamp field from a nested JSON string (in standard ISO format),

It works if the nested timestamp has millisecond precision. It doesn't if it has microsecond or nanosecond precision.

This looks like it's the relevant code, but I don't know enough Go to work out if this (or some upstream JSON parsing) should be handling variable fractional seconds:

```nohighlight
		if v, ok := data["@timestamp"]; ok {
			switch t := v.(type) {
			case time.Time:
				ts = t
			case common.Time:
				ts = time.Time(ts)
			}
			delete(data, "@timestamp")
		}

```

---

<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:** [October 13, 2022, 11:55am UTC](https://discuss.elastic.co/t/functionbeat-unable-to-extract-microsecond-timestamp-using-decode-json-fields/314494/2 "2022-10-13T11:55:26Z")

</div>

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