How could I test my promtail configuration?

Hi there,

I’m wondering how I could test my promtail configuration.

My promtail.yml contains a few different jobs for different files and I’d like to echo some examples and ensure that the configuration of a specific job works fine.

I have seen the documentation but it seems to only apply the job: stdin. Is there a way to select a specific job (i.e/ nginx in my case)

tail /var/log/nginx/access.log | promtail --stdin --dry-run --inspect --client.url http://127.0.0.1:3100/loki/api/v1/push

Thanks in advance

Hum, I spot 2 issues.

In fact, if I don’t specify a -config.file parameter, I have no clue of which configuration it uses. I’ll make a PR for this

Secondly, I spot by reading the doc that the sdtin mode uses the first config from the file and ignore the others.

Unfortunately, my first item was not a job definition but a file_sd_configs which mess up y test.

I’ll try to make a PR to clarify that in the documentation

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.