Currently, I am looking to process logs in json format.
I have managed to convert the given timestamp into a RFC3339 format. However, when parsing it through Promtail, it appears to be parsed but not being used as the displayed timestamp. Rather, it is using the timestamp where Promtail pushed said log to Loki.
Below is the snippet of my Promtail configuration:
scrape_configs:
- job_name: Test
static_configs:
- targets:
- localhost
labels:
job: Testing2
__path__: /path/to/*.json
pipeline_stages:
- json:
expressions:
timestamp: timestamp
- timestamp:
source: timestamp
format: 2006-01-02T15:04:05Z07:00
I have also tried switching the timestamp format to RFC3339 to no results as well.
Below is a sample log I generated
{"id":5072,"type":0,"timestamp":"2021-06-28T03:00:05+08:00","user":"System","ip":"127.0.0.1","computer":"localhost","desc":"Dummy message"}
This is how the log appears in Grafana. The timestamp field and ts field (which is used for displaying in Grafana) is different.

I would greatly appreciate any help or direction towards debugging. Do let me know if there are any additional information required!