Drop TimeStamp in Grafana Loki and Get the List of Logs

757 Views Asked by At

Recently, i have started working on Grafana Loki. I got some understanding of the logging stack(PLG - Promtail, Loki and Grafana). I need to store the logs in Loki. So, i have set the promtail agents which could monitor the logs file and sends it to Loki.

And Grafana is able to show me the logs on the UI.

But, i do need to have our own UI. which could show the logs. So, basically, I did some research and found that, we have APIs through which we can query Loki to get log messages.

However, by querying loki, i get the following response,

values": [
[
"1622627498058775000",
"{"date-time":"Wed Jun 02 09:49:21 GMT 2021","thread":"ForkJoinPool.commonPool-worker-5","level" : "INFO","loggerName":"org.apache.camel.spring.SpringCamelContext","message":"Apache Camel 3.0.1 (CamelContext: camel-2) started in 0.396 seconds"}"
],
[
"1622627498058768000",
"{"date-time":"Wed Jun 02 09:49:21 GMT 2021","thread":"ForkJoinPool.commonPool-worker-5","level" : "INFO","loggerName":"org.apache.camel.spring.SpringCamelContext","message":\"Total 1 routes, of which 1 are started"}"
]

Is there a way to drop these timestamp 1622627498058775000 and make loki return only the log messages?

For example, values: [ { key:value }, { key:value } ]

0

There are 0 best solutions below