Grafana Loki timestamp

Hello everyone.
I want to exploit my logs with grafana and loki but I have a problem.

Loki relies on the creation of different log files to display the graphs, which is normal. But I want to use the date and time generated inside the log at the beginning of the line. How can I do this?

  1. First parse the log line (usually regex) and extract the timestamp string.

  2. Check your log agent’s documentation on how to set time stamp baed on a string and a format.