<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Grafana Loki configuration parameters on Grafana Labs</title><link>https://grafana.com/docs/loki/v2.9.x/configure/</link><description>Recent content in Grafana Loki configuration parameters on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/loki/v2.9.x/configure/index.xml" rel="self" type="application/rss+xml"/><item><title>Configuration best practices</title><link>https://grafana.com/docs/loki/v2.9.x/configure/bp-configure/</link><pubDate>Mon, 29 Apr 2024 15:52:20 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/configure/bp-configure/</guid><content><![CDATA[&lt;h1 id=&#34;configuration-best-practices&#34;&gt;Configuration best practices&lt;/h1&gt;
&lt;p&gt;Grafana Loki is under active development, and we are constantly working to improve performance. But here are some of the most current best practices for configuration that will give you the best experience with Loki.&lt;/p&gt;
&lt;h2 id=&#34;configure-caching&#34;&gt;Configure caching&lt;/h2&gt;
&lt;p&gt;Loki can cache data at many levels, which can drastically improve performance. Details of this will be in a future post.&lt;/p&gt;
&lt;h2 id=&#34;time-ordering-of-logs&#34;&gt;Time ordering of logs&lt;/h2&gt;
&lt;p&gt;Loki 
    &lt;a href=&#34;/docs/loki/v2.9.x/configure/#accept-out-of-order-writes&#34;&gt;accepts out-of-order writes&lt;/a&gt; &lt;em&gt;by default&lt;/em&gt;.
This section identifies best practices when Loki is &lt;em&gt;not&lt;/em&gt; configured to accept out-of-order writes.&lt;/p&gt;
&lt;p&gt;One issue many people have with Loki is their client receiving errors for out of order log entries.  This happens because of this hard and fast rule within Loki:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For any single log stream, logs must always be sent in increasing time order. If a log is received with a timestamp older than the most recent log received for that stream, that log will be dropped.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are a few things to dissect from that statement. The first is this restriction is per stream.  Let’s look at an example:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{job=&amp;#34;syslog&amp;#34;} 00:00:00 i&amp;#39;m a syslog!
{job=&amp;#34;syslog&amp;#34;} 00:00:01 i&amp;#39;m a syslog!&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If Loki received these two lines which are for the same stream, everything would be fine. But what about this case:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{job=&amp;#34;syslog&amp;#34;} 00:00:00 i&amp;#39;m a syslog!
{job=&amp;#34;syslog&amp;#34;} 00:00:02 i&amp;#39;m a syslog!
{job=&amp;#34;syslog&amp;#34;} 00:00:01 i&amp;#39;m a syslog!  &amp;lt;- Rejected out of order!&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;What can we do about this? What if this was because the sources of these logs were different systems? We can solve this with an additional label which is unique per system:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{job=&amp;#34;syslog&amp;#34;, instance=&amp;#34;host1&amp;#34;} 00:00:00 i&amp;#39;m a syslog!
{job=&amp;#34;syslog&amp;#34;, instance=&amp;#34;host1&amp;#34;} 00:00:02 i&amp;#39;m a syslog!
{job=&amp;#34;syslog&amp;#34;, instance=&amp;#34;host2&amp;#34;} 00:00:01 i&amp;#39;m a syslog!  &amp;lt;- Accepted, this is a new stream!
{job=&amp;#34;syslog&amp;#34;, instance=&amp;#34;host1&amp;#34;} 00:00:03 i&amp;#39;m a syslog!  &amp;lt;- Accepted, still in order for stream 1
{job=&amp;#34;syslog&amp;#34;, instance=&amp;#34;host2&amp;#34;} 00:00:02 i&amp;#39;m a syslog!  &amp;lt;- Accepted, still in order for stream 2&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;But what if the application itself generated logs that were out of order? Well, I&amp;rsquo;m afraid this is a problem. If you are extracting the timestamp from the log line with something like 
    &lt;a href=&#34;/docs/loki/v2.9.x/send-data/promtail/stages/timestamp/&#34;&gt;the Promtail pipeline stage&lt;/a&gt;, you could instead &lt;em&gt;not&lt;/em&gt; do this and let Promtail assign a timestamp to the log lines. Or you can hopefully fix it in the application itself.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s also worth noting that the batching nature of the Loki push API can lead to some instances of out of order errors being received which are really false positives. (Perhaps a batch partially succeeded and was present; or anything that previously succeeded would return an out of order entry; or anything new would be accepted.)&lt;/p&gt;
&lt;h2 id=&#34;use-chunk_target_size&#34;&gt;Use &lt;code&gt;chunk_target_size&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;chunk_target_size&lt;/code&gt; instructs Loki to try to fill all chunks to a target &lt;em&gt;compressed&lt;/em&gt; size of 1.5MB. These larger chunks are more efficient for Loki to process.&lt;/p&gt;
&lt;p&gt;Other configuration variables affect how full a chunk can get. Loki has a default &lt;code&gt;max_chunk_age&lt;/code&gt; of 2h and &lt;code&gt;chunk_idle_period&lt;/code&gt; of 30m to limit the amount of memory used as well as the exposure of lost logs if the process crashes.&lt;/p&gt;
&lt;p&gt;Depending on the compression used (we have been using snappy which has less compressibility but faster performance), you need 5-10x or 7.5-10MB of raw log data to fill a 1.5MB chunk. Remembering that a chunk is per stream, the more streams you break up your log files into, the more chunks that sit in memory, and the higher likelihood they get flushed by hitting one of those timeouts mentioned above before they are filled.&lt;/p&gt;
&lt;p&gt;Lots of small, unfilled chunks negatively affect Loki. We are always working to improve this and may consider a compactor to improve this in some situations. But, in general, the guidance should stay about the same: try your best to fill chunks.&lt;/p&gt;
&lt;p&gt;If you have an application that can log fast enough to fill these chunks quickly (much less than &lt;code&gt;max_chunk_age&lt;/code&gt;), then it becomes more reasonable to use dynamic labels to break that up into separate streams.&lt;/p&gt;
&lt;h2 id=&#34;use--print-config-stderr-or--log-config-reverse-order&#34;&gt;Use &lt;code&gt;-print-config-stderr&lt;/code&gt; or &lt;code&gt;-log-config-reverse-order&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Loki and Promtail have flags which will dump the entire config object to stderr or the log file when they start.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-print-config-stderr&lt;/code&gt; works well when invoking Loki from the command line, as you can get a quick output of the entire Loki configuration.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-log-config-reverse-order&lt;/code&gt; is the flag we run Loki with in all our environments. The configuration entries are reversed, so that the order of the configuration reads correctly top to bottom when viewed in Grafana&amp;rsquo;s Explore.&lt;/p&gt;
]]></content><description>&lt;h1 id="configuration-best-practices">Configuration best practices&lt;/h1>
&lt;p>Grafana Loki is under active development, and we are constantly working to improve performance. But here are some of the most current best practices for configuration that will give you the best experience with Loki.&lt;/p></description></item><item><title>Query frontend example</title><link>https://grafana.com/docs/loki/v2.9.x/configure/query-frontend/</link><pubDate>Wed, 06 Sep 2023 12:47:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/configure/query-frontend/</guid><content><![CDATA[&lt;h1 id=&#34;query-frontend-example&#34;&gt;Query frontend example&lt;/h1&gt;
&lt;h2 id=&#34;disclaimer&#34;&gt;Disclaimer&lt;/h2&gt;
&lt;p&gt;This aims to be a general purpose example; there are a number of substitutions to make for it to work correctly. These variables take the form of &amp;lt;variable_name&amp;gt;. You should override them with specifics to your environment.&lt;/p&gt;
&lt;h2 id=&#34;use-case&#34;&gt;Use case&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s a common occurrence to start running Grafana Loki as a single binary while trying it out in order to simplify deployments and defer learning the (initially unnecessary) nitty gritty details. As we become more comfortable with its paradigms and begin migrating towards a more production ready deployment there are a number of things to be aware of. A common bottleneck is on the read path: queries that executed effortlessly on small data sets may churn to a halt on larger ones. Sometimes we can solve this with more queriers. However, that doesn&amp;rsquo;t help when our queries are too large for a single querier to execute. Then we need the query frontend.&lt;/p&gt;
&lt;h3 id=&#34;parallelization&#34;&gt;Parallelization&lt;/h3&gt;
&lt;p&gt;One of the most important functions of the query frontend is the ability to split larger queries into smaller ones, execute them in parallel, and stitch the results back together. How often it splits them is determined by the &lt;code&gt;querier.split-queries-by-interval&lt;/code&gt; flag or the yaml config &lt;code&gt;query_range.split_queriers_by_interval&lt;/code&gt;. With this set to &lt;code&gt;1h&lt;/code&gt;, the frontend will dissect a day long query into 24 one hour queries, distribute them to the queriers, and collect the results. This is immensely helpful in production environments as it not only allows us to perform larger queries via aggregation, but also evens the work distribution across queriers so that one or two are not stuck with impossibly large queries while others are left idle.&lt;/p&gt;
&lt;h2 id=&#34;kubernetes-deployment&#34;&gt;Kubernetes Deployment&lt;/h2&gt;
&lt;h3 id=&#34;configmap&#34;&gt;ConfigMap&lt;/h3&gt;
&lt;p&gt;Use this ConfigMap to get the benefits of query parallelisation and caching with the query-frontend component.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: v1
kind: ConfigMap
metadata:
  name: loki-frontend
  namespace: &amp;lt;namespace&amp;gt;
data:
  config.yaml: |
    # Disable the requirement that every request to Loki has a
    # X-Scope-OrgID header. `fake` will be substituted in instead.
    auth_enabled: false

    # We don&amp;#39;t want the usual /api/prom prefix.
    http_prefix:

    server:
      http_listen_port: 3100

    query_range:
      # make queries more cache-able by aligning them with their step intervals
      align_queries_with_step: true
      max_retries: 5
      cache_results: true

      results_cache:
        cache:
          # We&amp;#39;re going to use the in-process &amp;#34;FIFO&amp;#34; cache
          enable_fifocache: true
          fifocache:
            size: 1024
            validity: 24h

    limits_config:
      max_cache_freshness_per_query: &amp;#39;10m&amp;#39;
      # parallelize queries in 15min intervals
      split_queries_by_interval: 15m

    frontend:
      log_queries_longer_than: 5s
      downstream_url: http://querier.&amp;lt;namespace&amp;gt;.svc.cluster.local:3100
      compress_responses: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;frontend-service&#34;&gt;Frontend Service&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: v1
kind: Service
metadata:
  annotations:
  labels:
    name: query-frontend
  name: query-frontend
  namespace: &amp;lt;namespace&amp;gt;
spec:
  ports:
  - name: query-frontend-http
    port: 3100
    protocol: TCP
    targetPort: 3100
  selector:
    name: query-frontend
  sessionAffinity: None
  type: ClusterIP
  ClusterIP: None
  publishNotReadyAddresses: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;frontend-deployment&#34;&gt;Frontend Deployment&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    name: query-frontend
  name: query-frontend
  namespace: &amp;lt;namespace&amp;gt;
spec:
  minReadySeconds: 10
  replicas: 2
  selector:
    matchLabels:
      name: query-frontend
  template:
    metadata:
      labels:
        name: query-frontend
    spec:
      containers:
      - args:
        - -config.file=/etc/loki/config.yaml
        - -log.level=debug
        - -target=query-frontend
        image: grafana/loki:latest
        imagePullPolicy: Always
        name: query-frontend
        ports:
        - containerPort: 3100
          name: http
          protocol: TCP
        resources:
          limits:
            memory: 1200Mi
          requests:
            cpu: &amp;#34;2&amp;#34;
            memory: 600Mi
        volumeMounts:
        - mountPath: /etc/loki
          name: loki-frontend
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: loki-frontend
        name: loki-frontend&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;grafana&#34;&gt;Grafana&lt;/h3&gt;
&lt;p&gt;Once you&amp;rsquo;ve deployed these, point your Grafana datasource to the new frontend service. The service is available within the cluster at &lt;code&gt;http://query-frontend.&amp;lt;namespace&amp;gt;.svc.cluster.local:3100&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;grpc-mode-pull-model&#34;&gt;GRPC Mode (Pull model)&lt;/h3&gt;
&lt;p&gt;The query frontend operates in one of two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Specify &lt;code&gt;--frontend.downstream-url&lt;/code&gt; or its YAML equivalent, &lt;code&gt;frontend.downstream_url&lt;/code&gt;. This proxies requests over HTTP to the specified URL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Without &lt;code&gt;--frontend.downstream-url&lt;/code&gt; or its yaml equivalent &lt;code&gt;frontend.downstream_url&lt;/code&gt;, the query frontend defaults to a pull service. As a pull service, the frontend instantiates per-tenant queues that downstream queriers pull queries from via GRPC. To act as a pull service, queriers need to specify &lt;code&gt;-querier.frontend-address&lt;/code&gt; or its YAML equivalent &lt;code&gt;frontend_worker.frontend_address&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Set &lt;code&gt;ClusterIP=None&lt;/code&gt; for the query frontend pull service.
This causes DNS resolution of each query frontend pod IP address.
It avoids wrongly resolving to the service IP.&lt;/p&gt;
&lt;p&gt;Enable &lt;code&gt;publishNotReadyAddresses=true&lt;/code&gt; on the query frontend pull service.
Doing so eliminates a race condition in which the query frontend address
is needed before the query frontend becomes ready
when at least one querier connects.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="query-frontend-example">Query frontend example&lt;/h1>
&lt;h2 id="disclaimer">Disclaimer&lt;/h2>
&lt;p>This aims to be a general purpose example; there are a number of substitutions to make for it to work correctly. These variables take the form of &amp;lt;variable_name&amp;gt;. You should override them with specifics to your environment.&lt;/p></description></item><item><title>Examples</title><link>https://grafana.com/docs/loki/v2.9.x/configure/examples/</link><pubDate>Mon, 29 Apr 2024 15:52:20 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/configure/examples/</guid><content><![CDATA[&lt;h1 id=&#34;examples&#34;&gt;Examples&lt;/h1&gt;
&lt;h2 id=&#34;alibaba-cloud-storage-configyaml&#34;&gt;alibaba-cloud-storage-config.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses Alibaba for chunk storage

schema_config:
  configs:
  - from: 2020-05-15
    object_store: alibabacloud
    schema: v11
    index:
      prefix: loki_index_
      period: 168h

storage_config:
  alibabacloud:
    bucket: &amp;lt;bucket&amp;gt;
    endpoint: &amp;lt;endpoint&amp;gt;
    access_key_id: &amp;lt;access_key_id&amp;gt;
    secret_access_key: &amp;lt;secret_access_key&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;1-local-configuration-exampleyaml&#34;&gt;1-Local-Configuration-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
auth_enabled: false

server:
  http_listen_port: 3100

common:
  ring:
    instance_addr: 127.0.0.1
    kvstore:
      store: inmemory
  replication_factor: 1
  path_prefix: /tmp/loki

schema_config:
  configs:
  - from: 2020-05-15
    store: boltdb-shipper
    object_store: filesystem
    schema: v11
    index:
      prefix: index_
      period: 24h&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;2-s3-cluster-exampleyaml&#34;&gt;2-S3-Cluster-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This is a complete configuration to deploy Loki backed by a s3-Comaptible API
# like MinIO for storage. Loki components will use memberlist ring to shard and
# the index will be shipped to storage via boltdb-shipper.

auth_enabled: false

server:
  http_listen_port: 3100

common:
  ring:
    instance_addr: 127.0.0.1
    kvstore:
      store: memberlist
  replication_factor: 1
  path_prefix: /loki # Update this accordingly, data will be stored here.

memberlist:
  join_members:
  # You can use a headless k8s service for all distributor, ingester and querier components.
  - loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port.

schema_config:
  configs:
  - from: 2020-05-15
    store: boltdb-shipper
    object_store: s3
    schema: v11
    index:
      prefix: index_
      period: 24h

storage_config:
 boltdb_shipper:
   active_index_directory: /loki/index
   cache_location: /loki/index_cache
   shared_store: s3
 aws:
   s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name
   s3forcepathstyle: true

compactor:
  working_directory: /loki/compactor
  shared_store: s3
  compaction_interval: 5m&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;3-s3-without-credentials-snippetyaml&#34;&gt;3-S3-Without-Credentials-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# If you don&amp;#39;t wish to hard-code S3 credentials you can also configure an EC2
# instance role by changing the `storage_config` section

schema_config:
  configs:
  - from: 2020-05-15
    store: aws
    object_store: s3
    schema: v11
    index:
      prefix: loki_
storage_config:
  aws:
    s3: s3://region/bucket_name
    dynamodb:
      dynamodb_url: dynamodb://region
      &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;4-bos-exampleyaml&#34;&gt;4-BOS-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
schema_config:
  configs:
    - from: 2020-05-15
      store: boltdb-shipper
      object_store: bos
      schema: v11
      index:
        prefix: index_
        period: 24h

storage_config:
  boltdb_shipper:
    active_index_directory: /loki/index
    cache_location: /loki/index_cache
    shared_store: bos

  bos:
    bucket_name: bucket_name_1
    endpoint: bj.bcebos.com
    access_key_id: access_key_id
    secret_access_key: secret_access_key

compactor:
  working_directory: /tmp/loki/compactor
  shared_store: bos&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-s3-and-dynamodb-snippetyaml&#34;&gt;5-S3-And-DynamoDB-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage

schema_config:
  configs:
  - from: 2020-05-15
    store: aws
    object_store: s3
    schema: v11
    index:
      prefix: loki_
storage_config:
  aws:
    s3: s3://access_key:secret_access_key@region/bucket_name
    dynamodb:
      dynamodb_url: dynamodb://access_key:secret_access_key@region
      &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;6-cassandra-snippetyaml&#34;&gt;6-Cassandra-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage

schema_config:
  configs:
  - from: 2020-05-15
    store: cassandra
    object_store: filesystem
    schema: v11
    index:
      prefix: cassandra_table
      period: 168h

storage_config:
  cassandra:
    username: cassandra
    password: cassandra
    addresses: 127.0.0.1
    auth: true
    keyspace: lokiindex

  filesystem:
    directory: /tmp/loki/chunks
    &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;7-schema-migration-snippetyaml&#34;&gt;7-Schema-Migration-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
schema_config:
  configs:
    # Starting from 2018-04-15 Loki should store indexes on Cassandra
    # using weekly periodic tables and chunks on filesystem.
    # The index tables will be prefixed with &amp;#34;index_&amp;#34;.
  - from: &amp;#34;2018-04-15&amp;#34;
    store: cassandra
    object_store: filesystem
    schema: v11
    index:
        period: 168h
        prefix: index_

  # Starting from 2020-6-15 we moved from filesystem to AWS S3 for storing the chunks.
  - from: &amp;#34;2020-06-15&amp;#34;
    store: cassandra
    object_store: s3
    schema: v11
    index:
        period: 168h
        prefix: index_
        &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;8-gcs-snippetyaml&#34;&gt;8-GCS-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses GCS for chunk storage and uses BigTable for index storage

schema_config:
  configs:
  - from: 2020-05-15
    store: bigtable
    object_store: gcs
    schema: v11
    index:
      prefix: loki_index_
      period: 168h

storage_config:
  bigtable:
    instance: BIGTABLE_INSTANCE
    project: BIGTABLE_PROJECT
  gcs:
    bucket_name: GCS_BUCKET_NAME
    &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;9-expanded-s3-snippetyaml&#34;&gt;9-Expanded-S3-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# S3 configuration supports an expanded configuration. 
# Either an `s3` endpoint URL can be used, or an expanded configuration can be used.

schema_config:
  configs:
  - from: 2020-05-15
    store: aws
    object_store: s3
    schema: v11
    index:
      prefix: loki_
storage_config:
  aws:
    bucketnames: bucket_name1, bucket_name2
    endpoint: s3.endpoint.com
    region: s3_region
    access_key_id: s3_access_key_id
    secret_access_key: s3_secret_access_key
    insecure: false
    sse_encryption: false
    http_config:
      idle_conn_timeout: 90s
      response_header_timeout: 0s
      insecure_skip_verify: false
    s3forcepathstyle: true
    &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;10-s3-and-dynamodb-with-kms-snippetyaml&#34;&gt;10-S3-And-DynamoDB-With-KMS-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage and a KMS CMK for encryption

schema_config:
  configs:
  - from: 2020-05-15
    store: aws
    object_store: s3
    schema: v11
    index:
      prefix: loki_
storage_config:
  aws:
    s3: s3://access_key:secret_access_key@region/bucket_name
    sse_encryption: true
    sse:
      type: SSE-KMS
      kms_key_id: 1234abcd-12ab-34cd-56ef-1234567890ab
    dynamodb:
      dynamodb_url: dynamodb://access_key:secret_access_key@region
      kms_key_id: 0987dcba-09fe-87dc-65ba-ab0987654321&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;11-cos-hmac-exampleyaml&#34;&gt;11-COS-HMAC-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses IBM Cloud Object Storage (COS) for chunk storage. HMAC will be used for authenticating with COS.

schema_config:
  configs:
    - from: 2020-10-01
      index:
        period: 24h
        prefix: loki_index_
      object_store: &amp;#34;cos&amp;#34;
      schema: v11
      store: &amp;#34;boltdb-shipper&amp;#34;

storage_config:
  cos:
    bucketnames: &amp;lt;bucket1, bucket2&amp;gt;
    endpoint: &amp;lt;endpoint&amp;gt;
    region: &amp;lt;region&amp;gt;
    access_key_id: &amp;lt;access_key_id&amp;gt;
    secret_access_key: &amp;lt;secret_access_key&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;12-cos-apikey-exampleyaml&#34;&gt;12-COS-APIKey-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses IBM Cloud Object Storage (COS) for chunk storage. APIKey will be used for authenticating with COS.

schema_config:
  configs:
    - from: 2020-10-01
      index:
        period: 24h
        prefix: loki_index_
      object_store: &amp;#34;cos&amp;#34;
      schema: v11
      store: &amp;#34;boltdb-shipper&amp;#34;

storage_config:
  cos:
    bucketnames: &amp;lt;bucket1, bucket2&amp;gt;
    endpoint: &amp;lt;endpoint&amp;gt;
    region: &amp;lt;region&amp;gt;
    api_key: &amp;lt;api_key_to_authenticate_with_cos&amp;gt;
    service_instance_id: &amp;lt;cos_service_instance_id&amp;gt;
    auth_endpoint: &amp;lt;iam_endpoint_for_authentication&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;13-cos-trusted-profile-exampleyaml&#34;&gt;13-COS-Trusted-Profile-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses IBM Cloud Object Storage (COS) for chunk storage. 
# A trusted profile will be used for authenticating with COS. We can either pass
# the trusted profile name or trusted profile ID along with the compute resource token file.
# If we pass both trusted profile name and trusted profile ID it should be of 
# the same trusted profile.
# In order to use trusted profile authentication we need to follow an additional step to create a trusted profile.
# For more details about creating a trusted profile, see https://cloud.ibm.com/docs/account?topic=account-create-trusted-profile&amp;amp;interface=ui.

schema_config:
  configs:
    - from: 2020-10-01
      index:
        period: 24h
        prefix: loki_index_
      object_store: &amp;#34;cos&amp;#34;
      schema: v11
      store: &amp;#34;boltdb-shipper&amp;#34;

storage_config:
  cos:
    bucketnames: &amp;lt;bucket1, bucket2&amp;gt;
    endpoint: &amp;lt;endpoint&amp;gt;
    region: &amp;lt;region&amp;gt;
    auth_endpoint: &amp;lt;iam_endpoint_for_authentication&amp;gt;
    cr_token_file_path: &amp;lt;path_to_compute_resource_token&amp;gt;
    trusted_profile_name: &amp;lt;name_of_the_trusted_profile&amp;gt; # You can also use trusted_profile_id instead of trusted_profile_name&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;15-memberlist-ring-snippetyaml&#34;&gt;15-Memberlist-Ring-Snippet.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses memberlist for the ring.

common:
  ring:
    kvstore:
      store: memberlist
  replication_factor: 1
  path_prefix: /loki

memberlist:
  join_members:
    # You can use a headless k8s service for all distributor, ingester and querier components.
    - loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;16-azure-account-name-exampleyaml&#34;&gt;16-Azure-Account-Name-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses Azure for chunk storage
storage_config:
  azure:
    # For the account-key, see docs: https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal
    account_key: &amp;lt;azure_blob_access_key&amp;gt;
    account_name: &amp;lt;azure_account_name&amp;gt;
    container_name: &amp;lt;azure_storage_bucket_name&amp;gt;
    use_managed_identity: false
    # Providing a user assigned ID will override use_managed_identity
    #user_assigned_id: &amp;lt;user-assigned-identity-id&amp;gt;
    request_timeout: 0
    # Configure `endpoint_suffix` if you are using private azure cloud like azure stack hub and will use this endpoint suffix to compose container and blob storage URL. Ex: https://account_name.endpoint_suffix/container_name/blob_name
    #endpoint_suffix: &amp;lt;endpoint-suffix&amp;gt;
    # If `connection_string` is set, the `account_name` and `endpoint_suffix` values will not be used. Use this method over `account_key` if you need to authenticate via an SAS token. Or if you use the Azurite emulator.
    #connection_string: &amp;lt;connection-string&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;17-azure-service-principal-exampleyaml&#34;&gt;17-Azure-Service-Principal-Example.yaml&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;
# This partial configuration uses Azure for chunk storage and a service principal for authentication
storage_config:
  azure:
    use_service_principal: true
    # Azure tenant ID used to authenticate through Azure OAuth
    tenant_id: &amp;lt;tenant-id&amp;gt;
    # Azure Service Principal ID
    client_id: &amp;lt;client-id&amp;gt;
    # Azure Service Principal secret key
    client_secret: &amp;lt;client-secret&amp;gt;
    # See https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction#containers
    container_name: &amp;lt;azure_storage_bucket_name&amp;gt;
    request_timeout: 0&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="examples">Examples&lt;/h1>
&lt;h2 id="alibaba-cloud-storage-configyaml">alibaba-cloud-storage-config.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses Alibaba for chunk storage
schema_config:
configs:
- from: 2020-05-15
object_store: alibabacloud
schema: v11
index:
prefix: loki_index_
period: 168h
storage_config:
alibabacloud:
bucket: &amp;lt;bucket&amp;gt;
endpoint: &amp;lt;endpoint&amp;gt;
access_key_id: &amp;lt;access_key_id&amp;gt;
secret_access_key: &amp;lt;secret_access_key&amp;gt;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="1-local-configuration-exampleyaml">1-Local-Configuration-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
auth_enabled: false
server:
http_listen_port: 3100
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: inmemory
replication_factor: 1
path_prefix: /tmp/loki
schema_config:
configs:
- from: 2020-05-15
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="2-s3-cluster-exampleyaml">2-S3-Cluster-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This is a complete configuration to deploy Loki backed by a s3-Comaptible API
# like MinIO for storage. Loki components will use memberlist ring to shard and
# the index will be shipped to storage via boltdb-shipper.
auth_enabled: false
server:
http_listen_port: 3100
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: memberlist
replication_factor: 1
path_prefix: /loki # Update this accordingly, data will be stored here.
memberlist:
join_members:
# You can use a headless k8s service for all distributor, ingester and querier components.
- loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port.
schema_config:
configs:
- from: 2020-05-15
store: boltdb-shipper
object_store: s3
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: s3
aws:
s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name
s3forcepathstyle: true
compactor:
working_directory: /loki/compactor
shared_store: s3
compaction_interval: 5m&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="3-s3-without-credentials-snippetyaml">3-S3-Without-Credentials-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# If you don&amp;#39;t wish to hard-code S3 credentials you can also configure an EC2
# instance role by changing the `storage_config` section
schema_config:
configs:
- from: 2020-05-15
store: aws
object_store: s3
schema: v11
index:
prefix: loki_
storage_config:
aws:
s3: s3://region/bucket_name
dynamodb:
dynamodb_url: dynamodb://region
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="4-bos-exampleyaml">4-BOS-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
schema_config:
configs:
- from: 2020-05-15
store: boltdb-shipper
object_store: bos
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/index_cache
shared_store: bos
bos:
bucket_name: bucket_name_1
endpoint: bj.bcebos.com
access_key_id: access_key_id
secret_access_key: secret_access_key
compactor:
working_directory: /tmp/loki/compactor
shared_store: bos&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="5-s3-and-dynamodb-snippetyaml">5-S3-And-DynamoDB-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage
schema_config:
configs:
- from: 2020-05-15
store: aws
object_store: s3
schema: v11
index:
prefix: loki_
storage_config:
aws:
s3: s3://access_key:secret_access_key@region/bucket_name
dynamodb:
dynamodb_url: dynamodb://access_key:secret_access_key@region
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="6-cassandra-snippetyaml">6-Cassandra-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage
schema_config:
configs:
- from: 2020-05-15
store: cassandra
object_store: filesystem
schema: v11
index:
prefix: cassandra_table
period: 168h
storage_config:
cassandra:
username: cassandra
password: cassandra
addresses: 127.0.0.1
auth: true
keyspace: lokiindex
filesystem:
directory: /tmp/loki/chunks
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="7-schema-migration-snippetyaml">7-Schema-Migration-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
schema_config:
configs:
# Starting from 2018-04-15 Loki should store indexes on Cassandra
# using weekly periodic tables and chunks on filesystem.
# The index tables will be prefixed with &amp;#34;index_&amp;#34;.
- from: &amp;#34;2018-04-15&amp;#34;
store: cassandra
object_store: filesystem
schema: v11
index:
period: 168h
prefix: index_
# Starting from 2020-6-15 we moved from filesystem to AWS S3 for storing the chunks.
- from: &amp;#34;2020-06-15&amp;#34;
store: cassandra
object_store: s3
schema: v11
index:
period: 168h
prefix: index_
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="8-gcs-snippetyaml">8-GCS-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses GCS for chunk storage and uses BigTable for index storage
schema_config:
configs:
- from: 2020-05-15
store: bigtable
object_store: gcs
schema: v11
index:
prefix: loki_index_
period: 168h
storage_config:
bigtable:
instance: BIGTABLE_INSTANCE
project: BIGTABLE_PROJECT
gcs:
bucket_name: GCS_BUCKET_NAME
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="9-expanded-s3-snippetyaml">9-Expanded-S3-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# S3 configuration supports an expanded configuration.
# Either an `s3` endpoint URL can be used, or an expanded configuration can be used.
schema_config:
configs:
- from: 2020-05-15
store: aws
object_store: s3
schema: v11
index:
prefix: loki_
storage_config:
aws:
bucketnames: bucket_name1, bucket_name2
endpoint: s3.endpoint.com
region: s3_region
access_key_id: s3_access_key_id
secret_access_key: s3_secret_access_key
insecure: false
sse_encryption: false
http_config:
idle_conn_timeout: 90s
response_header_timeout: 0s
insecure_skip_verify: false
s3forcepathstyle: true
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="10-s3-and-dynamodb-with-kms-snippetyaml">10-S3-And-DynamoDB-With-KMS-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage and a KMS CMK for encryption
schema_config:
configs:
- from: 2020-05-15
store: aws
object_store: s3
schema: v11
index:
prefix: loki_
storage_config:
aws:
s3: s3://access_key:secret_access_key@region/bucket_name
sse_encryption: true
sse:
type: SSE-KMS
kms_key_id: 1234abcd-12ab-34cd-56ef-1234567890ab
dynamodb:
dynamodb_url: dynamodb://access_key:secret_access_key@region
kms_key_id: 0987dcba-09fe-87dc-65ba-ab0987654321&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="11-cos-hmac-exampleyaml">11-COS-HMAC-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses IBM Cloud Object Storage (COS) for chunk storage. HMAC will be used for authenticating with COS.
schema_config:
configs:
- from: 2020-10-01
index:
period: 24h
prefix: loki_index_
object_store: &amp;#34;cos&amp;#34;
schema: v11
store: &amp;#34;boltdb-shipper&amp;#34;
storage_config:
cos:
bucketnames: &amp;lt;bucket1, bucket2&amp;gt;
endpoint: &amp;lt;endpoint&amp;gt;
region: &amp;lt;region&amp;gt;
access_key_id: &amp;lt;access_key_id&amp;gt;
secret_access_key: &amp;lt;secret_access_key&amp;gt;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="12-cos-apikey-exampleyaml">12-COS-APIKey-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses IBM Cloud Object Storage (COS) for chunk storage. APIKey will be used for authenticating with COS.
schema_config:
configs:
- from: 2020-10-01
index:
period: 24h
prefix: loki_index_
object_store: &amp;#34;cos&amp;#34;
schema: v11
store: &amp;#34;boltdb-shipper&amp;#34;
storage_config:
cos:
bucketnames: &amp;lt;bucket1, bucket2&amp;gt;
endpoint: &amp;lt;endpoint&amp;gt;
region: &amp;lt;region&amp;gt;
api_key: &amp;lt;api_key_to_authenticate_with_cos&amp;gt;
service_instance_id: &amp;lt;cos_service_instance_id&amp;gt;
auth_endpoint: &amp;lt;iam_endpoint_for_authentication&amp;gt;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="13-cos-trusted-profile-exampleyaml">13-COS-Trusted-Profile-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses IBM Cloud Object Storage (COS) for chunk storage.
# A trusted profile will be used for authenticating with COS. We can either pass
# the trusted profile name or trusted profile ID along with the compute resource token file.
# If we pass both trusted profile name and trusted profile ID it should be of
# the same trusted profile.
# In order to use trusted profile authentication we need to follow an additional step to create a trusted profile.
# For more details about creating a trusted profile, see https://cloud.ibm.com/docs/account?topic=account-create-trusted-profile&amp;amp;interface=ui.
schema_config:
configs:
- from: 2020-10-01
index:
period: 24h
prefix: loki_index_
object_store: &amp;#34;cos&amp;#34;
schema: v11
store: &amp;#34;boltdb-shipper&amp;#34;
storage_config:
cos:
bucketnames: &amp;lt;bucket1, bucket2&amp;gt;
endpoint: &amp;lt;endpoint&amp;gt;
region: &amp;lt;region&amp;gt;
auth_endpoint: &amp;lt;iam_endpoint_for_authentication&amp;gt;
cr_token_file_path: &amp;lt;path_to_compute_resource_token&amp;gt;
trusted_profile_name: &amp;lt;name_of_the_trusted_profile&amp;gt; # You can also use trusted_profile_id instead of trusted_profile_name&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="15-memberlist-ring-snippetyaml">15-Memberlist-Ring-Snippet.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses memberlist for the ring.
common:
ring:
kvstore:
store: memberlist
replication_factor: 1
path_prefix: /loki
memberlist:
join_members:
# You can use a headless k8s service for all distributor, ingester and querier components.
- loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port.&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="16-azure-account-name-exampleyaml">16-Azure-Account-Name-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses Azure for chunk storage
storage_config:
azure:
# For the account-key, see docs: https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal
account_key: &amp;lt;azure_blob_access_key&amp;gt;
account_name: &amp;lt;azure_account_name&amp;gt;
container_name: &amp;lt;azure_storage_bucket_name&amp;gt;
use_managed_identity: false
# Providing a user assigned ID will override use_managed_identity
#user_assigned_id: &amp;lt;user-assigned-identity-id&amp;gt;
request_timeout: 0
# Configure `endpoint_suffix` if you are using private azure cloud like azure stack hub and will use this endpoint suffix to compose container and blob storage URL. Ex: https://account_name.endpoint_suffix/container_name/blob_name
#endpoint_suffix: &amp;lt;endpoint-suffix&amp;gt;
# If `connection_string` is set, the `account_name` and `endpoint_suffix` values will not be used. Use this method over `account_key` if you need to authenticate via an SAS token. Or if you use the Azurite emulator.
#connection_string: &amp;lt;connection-string&amp;gt;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;h2 id="17-azure-service-principal-exampleyaml">17-Azure-Service-Principal-Example.yaml&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">YAML&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-yaml">
# This partial configuration uses Azure for chunk storage and a service principal for authentication
storage_config:
azure:
use_service_principal: true
# Azure tenant ID used to authenticate through Azure OAuth
tenant_id: &amp;lt;tenant-id&amp;gt;
# Azure Service Principal ID
client_id: &amp;lt;client-id&amp;gt;
# Azure Service Principal secret key
client_secret: &amp;lt;client-secret&amp;gt;
# See https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction#containers
container_name: &amp;lt;azure_storage_bucket_name&amp;gt;
request_timeout: 0&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div></description></item></channel></rss>