I have a timestamp epoch number value in the log row.
So if I use the following query:
{app="$app"} | json | line_format `{{.ts}} [{{.name}}] {{.message}}` |= `$search`
I would get the result like this:
1693919208435 [log.file.name] log message payload
In this result, I’d like to format the epoch value to human readable date string.
I tried this:
{app="$app"} | json | line_format `{{.ts | date "2006-01-02 15:04:05"}} [{{.name}}] {{.message}}` |= `$search`
The result looks perfect,
2023-09-06 08:43:31 [log.file.name] log message payload
But the date/time does not come from the log timestamp field.
It is always current time regardless of the timestamp value.
So, consequently every rows have the same current datetime string.
How can I make the correct datetime string in accordance with the timestamp field value?