Questions tagged [promtail]

Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud. Use with grafana-loki tag.

See documentation

145 questions
1
vote
2 answers

With Promtail, how do I only keep log messages for specified Docker containers

So I have configuration like this: scrape_configs: - job_name: flog_scrape docker_sd_configs: - host: unix:///var/run/docker.sock refresh_interval: 5s relabel_configs: - source_labels: ['__meta_docker_container_name'] …
alamar
  • 18,729
  • 4
  • 64
  • 97
1
vote
0 answers

How change docker log length limit to more than 16k

I am running docker swarm on engine version 20.10.17. I find out, some application making long logs (more than 16k) and in Loki, as my logging stack, I cannot parse JSON logs, because docker split logs by 16k strings and insert date in the middle of…
dorinand
  • 1,397
  • 1
  • 24
  • 49
1
vote
1 answer

can't parse login using promtail correctlyl

Could anyone offer advice on how to configure promtail correctly to parse the json output from my logs? I haven't been able to figure out why promtail is not identifying the json properties and showing them in Grafana. my logback appender, in…
Jeryl Cook
  • 989
  • 17
  • 40
1
vote
0 answers

Promtail Stage Camelcase

Can anyone help on how to transform incoming JSON text to camelcase in Promtail? I am thinking of using the ToLower function and some kidn of trimming as described in:…
Lud1212
  • 117
  • 9
1
vote
0 answers

Promtail extract json

I am having an issue with getting promtail to read and log file and extract the infomation i need to send to loki The log line in the file looks like this 2022-11-16T16:55:35.738757+00:00 hostname-13 tracker[15857] {'arg': 'test.py', 'show': None,…
1
vote
0 answers

Loki - Promtail - How to debug different values for ts field being shown in Loki than what -dry-run shows should be the case?

When I am running: cat test.log | promtail-v2.3.0 -config.file /etc/promtail.yml -stdin -dry-run -inspect with a config containing: pipeline_stages: - regex: expression: '^(?P\S+) (?P\S+) (?P\S+)…
aronisstav
  • 7,755
  • 5
  • 23
  • 48
1
vote
1 answer

remove timestamp from log line with Promtail

I am scraping logs from docker with Promtail to Loki. Works very well, but I would like to remove timestamp from log line once it has been extracted by Promtail. The reason is that I end up with log panel that half of screen is occupied by…
tas
  • 45
  • 2
  • 7
1
vote
2 answers

Promtail + Loki - Only shows some namespaces not all

we recently decided to install loki and promtail via the loki-stack helm chart. Loki and promtail kind of work. We get some logs from Promtail and we can visualize them in grafana but our development namespace is nowhere to be found in loki.…
Lilin
  • 25
  • 5
1
vote
0 answers

Is it possible to transform log entries with Grafana Loki/Promtail

My setup currently uses Promtail and Grafana Loki to parse logs files. I visualize them with Grafana and want to group my log-entries into only three different log levels: Info Warning Error The problem is, that the log gathered by Promtail has…
1
vote
0 answers

How to truncate the logs in Promtail

I am using Promtail to ship some Jenkins logs to Loki and I want to truncate the logs which are longer than e.g. 12k characters. This is the current configuration that I'm using: clients: - url: my-loki-instance external_labels: …
Andreea
  • 11
  • 2
1
vote
0 answers

Is it possible to sum values within log lines in Loki / Grafana

If I have 2 log lines, e.g: 01/02/2022 - my log line - arbitrary number: 40 02/02/2022 - another log line - arbitrary number: 60 Within Grafana (or loki) is it possible to add together the 'arbitrary numbers' and give me an output of 100? The use…
solarflare
  • 880
  • 2
  • 8
  • 23
1
vote
2 answers

Promtail End Point Failure At /loki/api/v1/push On EC2 Instance Via Docker

I am using aws Instance and I am trying to run promtail in order to fetch logs and forward it to loki server. Promtail, Loki and Grafana are being run through Docker. The Loki Server is runing on port 3100, Promtail on 3400 and Loki on 8001. Since…
1
vote
1 answer

How to edit a helm chart (loki) config files for Grafana Cloud

I have installed loki and grafana via helm charts to my cloud hosted k8s cluster. How do I send the loki metrics to grafana cloud? I know I should edit the promtail config file but how do I locate and view/edit helm chart files? My installation…
1
vote
0 answers

Promtail not scraping logs from within subdirectories

I'm having issues getting promtail to scrape files from subdirectories. My filesystem where the logs are stored is structured as follows: /var/log/building1logs/logfolder// I'd like to be able to…
Matt
  • 106
  • 1
  • 14
1
vote
1 answer

Promtail keep last log bufferised and don't give it to Loki

I have a pretty simple application which send tcp log to promtail. (So promtail doesn't gaver data from file) The problem is that the last log sent to protail isn't stored in loki until another log comes. Let's say that I logged "foo", I'll see…
lou lou
  • 11
  • 2