How can I extract time-series metric in grafana?

Viewed 16

I am having a challanging time extracting timeseries data from logs in grafana.

I am using grafana 9.1.3 with Loki&promtail in local server, to collect data from logs.
The log looks like this(this is just an example), and I want to visualize loss in dashboard.

2022-09-08 22:46:31 Train Epoch: 14 [59520/60000 (99%)] Loss: 0.001811  
2022-09-08 22:46:31 Train Epoch: 14 [59520/60000 (99%)] Loss: 0.001813  
2022-09-08 22:46:31 Train Epoch: 14 [59520/60000 (99%)] Loss: 0.001811  

But when I use query below in dashboard, grafana indicated that there is no data matching with query(without pattern, grafana shows log)

{filename=“/root/train/training/mnist/mnist_1.log”} | pattern <_> Loss: <loss> | label=loss  

which can be the problem? thanks in advance

0 Answers
Related