Loki: how to use?

Created on 12 Dec 2018  路  12Comments  路  Source: grafana/loki

I'm interesting in this package, i have some microservices that want to log data, how to do that with loki?

Most helpful comment

Will do!

All 12 comments

Hi @vtolstov We're initially targeting Kubernetes with our launch, see: https://github.com/grafana/loki#getting-started for instructions on getting started. Having said that we'll soon be publishing blog posts and other content around how to run Loki and Promtail on different platforms, so keep an eye out!

褋褉, 12 写械泻. 2018 谐. 胁 15:44, Goutham Veeramachaneni notifications@github.com:
>

Hi @vtolstov We're initially targeting Kubernetes with our launch, see: https://github.com/grafana/loki#getting-started for instructions on getting started. Having said that we'll soon be publishing blog posts and other content around how to run Loki and Promtail on different platforms, so keep an eye out!

Thanks, i'm waiting for future info.

--
Vasiliy Tolstov,
e-mail: v.[email protected]

If you are targeting Kubernetes why are the docs all using docker run instead of kubectl run? Do you want a PR?

Haha, I'll be publishing the ksonnet for it today, we have something here that kinda works: https://github.com/grafana/loki/tree/master/ksonnet but not yet.

@gouthamve any chance you can publish something that just works on minikube or other Kubernetes using kubectl port-forward after kubectl create?

Will do!

I really like the docker-compose support and everything started perfectly, but then what?
I clicked the Explore tab but of course I had no data.

If possible, it would be nice to explain (write in the tutorial) how to actually see some test log data so people can quickly evaluate this exciting product!

see #117

That is nice, but how to get logs without grafana and how to write it?
So my use case - write logs from 20 microservices to some store and have ability to get some logs via labels (for example service name or uuid)

@philips we've merged in a helm chart now, and removed the docker run instructions. docker-compose is still there mind you. The helm chart instructions include all the necessary port-forward commands for a full E2E demo.

@viktorsmari:

If possible, it would be nice to explain (write in the tutorial) how to actually see some test log data so people can quickly evaluate this exciting product

@davkal and @gouthamve have put the source code for the demo app we used at KubeCon here: https://github.com/gouthamve/tns

@vtolstov

That is nice, but how to get logs without grafana and how to write it?

There is an example CLI and API docs:

FYI, I adapted the Kubernetes manifests and am running loki/promtail without consul or cloud storage. It was much easier to get logcli working then. I could write up something if people wanted.

This setup allowed me to just use infra.moov.io/loki and run logcli query '{ job != "" }' type queries just fine. I've since hidden that behind auth.

I'd recommend using the ksonnet builders for a more drop-in install though.

Can we get an example of:

  • Relabel Config. I only found that was a thing digging through the source. I have no experience with prometheus so it's not something I really understand. I'm trying to pull a value out of a logline and use that as a label. Source label doesn't make sense, but target label does.
    This is best I can come up with, but doesn't seem to work:
    relabel_configs: <ul> <li>source_labels: [logfield]<br /> regex: '.<em>level=([a-zA-Z]+).</em>'<br /> replacement: '${1}'<br /> target_label: 'level'<br /> action: replace<br />

  • Working logcli query example. I'm unable to figure out how to read the logs that have been ingested beyond logcli labels
  • Was this page helpful?
    0 / 5 - 0 ratings

    Related issues

    suppix picture suppix  路  3Comments

    bzon picture bzon  路  5Comments

    steven-sheehy picture steven-sheehy  路  4Comments

    TakumaNakagame picture TakumaNakagame  路  5Comments

    Menda picture Menda  路  5Comments