The best way to get avg from duration time from application

Hello, guys, i’m make this :

| error = “”
| line_format “{{ .ts}}\t{{.duration}}” | duration > 370 | unwrap duration [5m])

Here is my log content:

Log labels
app do-workflow-scale
duration 366
environment Development
status Processed
tenantId 5524151a19a226aab39c24e3
tracerId 6021f4bb96b52c3550ca0ff9
Detected fields
app do-workflow-scale
level info
ts 2021-02-09T02:34:36.217Z
tsNs 1612838076217301100

I’m not shure if this is the best way to make this.

Someone can help me?

I’m not sure I understand that log content? does it really come through as fields on each line with a space separator or did you reformat it for posting?

Can you paste an exact log line (assuming that’s not what this is?)