Questions tagged [grafana-loki]

Like Prometheus, but for logs.

Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus

https://github.com/grafana/loki

521 questions
15
votes
2 answers

Loki json logs filter by detected fields from grafana

I am sending json logs to loki and visualizing in grafana. Initially, my logs looked like as following. { "log":…
Timam
  • 378
  • 1
  • 2
  • 8
14
votes
4 answers

How to send alert for every error in my logs using Promtail / Loki - AlertManager?

I'm using Promtail + Loki to collect my logs and I can't figure how can I alert for every error in my log files. I'm also using Prometheus, Alertmanager and Grafana. I've seen some people have managed to achieve that, but none of them explained the…
EnTm
  • 163
  • 1
  • 1
  • 6
13
votes
3 answers

Loki config with s3

I can't get Loki to connect to AWS S3 using docker-compose. Logs are visible in Grafana but the S3 bucket remains empty. The s3 bucket is public and I have an IAM role attached to allow s3:FullAccess. I updated loki to v2.0.0 and changed the period…
markhorrocks
  • 1,199
  • 19
  • 82
  • 151
12
votes
0 answers

Grafana Loki LogQL: How to parse log lines with different log formats?

We have different type of logs for one and the same application. Some are coming from our application which logs in a JSON format and others are different types of log messages. For example these 3 log lines: "{\"written_at\":…
Spenhouet
  • 6,556
  • 12
  • 51
  • 76
11
votes
1 answer

Grafana Timeout while querying large amount of logs from Loki

I have a Loki server running on AWS Graviton (arm, 4 vCPU, 8 GiB) configured as following: common: replication_factor: 1 ring: kvstore: store: etcd etcd: endpoints: ['127.0.0.1:2379'] storage_config: boltdb_shipper: …
Tanmay
  • 355
  • 5
  • 12
11
votes
2 answers

Loki query to show all logs

I'm trying to test our Loki log data source. From the Queries I've been executing nothing is returned. It's possible that the logs are in a different format to what I'm expecting, or that no Logs are ingested by Loki, and my pipeline is broken…
fuzzi
  • 1,967
  • 9
  • 46
  • 90
10
votes
1 answer

Loki display log message and extra fields separately

In https://github.com/grafana/loki/issues/4249 I found interesting screenshot. On this screenshot I see that log level and message are displayed bold with white text and other metadata (collected from log message) displayed on separate line with…
Dm3Ch
  • 621
  • 1
  • 10
  • 26
10
votes
3 answers

Send logs directly to Loki without use of agents

Is there a way to send logs to Loki directly without having to use one of it's agents? For example, if I have an API, is it possible to send request/response logs directly to Loki from an API, without the interference of, for example, Promtail?
OmarLittle
  • 423
  • 1
  • 9
  • 18
9
votes
1 answer

Grafana Loki total number of a specific log message

I am using Grafana Loki and I need to calculate the total number of a certain log message for a specific time interval. For example, I need the total number of log message "some-text" in the period from 12:00:00 to 14:00:00. I just found the…
bennex
  • 437
  • 2
  • 5
  • 12
8
votes
2 answers

How to visualize Loki JSON logs in Grafana

So we are using Loki/Grafana to collect logs from our Kubernetes cluster, and the tool is great for that. But now that I have cleaned up the logs, I would also like to visualize them! My logs Selecting only JSON lines # My…
Esben Eickhardt
  • 3,183
  • 2
  • 35
  • 56
8
votes
2 answers

Grafana Loki LogQL bar gauge order by total

I am using Grafana and Loki to analyze logs from my application, and have used the Bar Gauge in a few places already. This is my query: sum(count_over_time({namespace=~"$namespace", job=~"$namespace-logs"} |= "KPIExecuted" [$__interval])) by…
8
votes
1 answer

Is it possible to convert string values to numbers in LogQL?

I am following documentation and thanks to | line_format and regexReplaceAll I was able to fetch some substring from a line. Let's say now I have those columns: line 123 7 123 54 14 Having that I want to perform some transform operation, ex sum, or…
Rumid
  • 1,627
  • 2
  • 21
  • 39
7
votes
2 answers

Grafana showing "too many outstanding requests" error while querying loki dashboard

I am trying to use loki and grafana for generating and visualizing log-based metrics. I have created a Grafana dashboard using the loki filters. While clicking the refresh button, all dashboards fail with the error "too many outstanding requests"…
7
votes
1 answer

How to plot Loki parsed fields as numerical values using LogQL on Grafana?

My setup: Loki: 2.1.0, Grafana: 6.7.3 My software runs on Kubernetes, Loki collects its logs. It looks something like this: [2021-03-29 10:13:05] [INFO] Q_len=256 sol_q=0.049 info_q=0.240 [2021-03-29 10:13:05] [INFO] Q_len=196 sol_q=0.047…
Xuekai Du
  • 617
  • 1
  • 6
  • 27
6
votes
1 answer

POST /loki/api/v1/push (500) Response: empty ring and context canceled

I have built a test EKS environment to apply Loki for a few weeks, so far I have created 10s of Loki’s pods using Monolithic mode, each Loki’s pod received logs from multiple ec2 instances. However, I have found promtail keep returning error…
Andrew
  • 129
  • 2
  • 8
1
2 3
34 35