Grafana 在promtail loki日志文件链中配置时间戳格式

Grafana 在promtail loki日志文件链中配置时间戳格式,grafana,Grafana,我在docker使用promtail、loki和grafana的工具堆。 我想把它放在我的日志文件中 这是promtail配置的一部分: scrape_configs: - job_name: mylogs pipeline_stages: - timestamp: source: time format: RFC3339 我创建了一个日志文件,其中包含以下行: time=2020-01-02T15:04:05-07:00 message=bla ts=202

我在docker使用promtail、loki和grafana的工具堆。 我想把它放在我的日志文件中

这是promtail配置的一部分:

scrape_configs:
- job_name: mylogs
  pipeline_stages:
   - timestamp:
      source: time
      format: RFC3339
我创建了一个日志文件,其中包含以下行:

time=2020-01-02T15:04:05-07:00 message=bla
ts=2020-01-02T15:04:05-07:00 message=bla
2020-01-02T15:04:05-07:00 message=bla
但是正如在grafana gui中看到的,时间戳在这些行中都没有被识别出来。 我的问题是:

  • 时间戳配置是否正确
  • 日志文件中的行应该是什么样子
1)大写“Z”字符必须在没有数字时区偏移的情况下出现()。参见示例:)。2) json格式是最容易开始使用的格式(请参阅)。对于其他日志文件格式,[管道阶段](])需要更多配置。