Skip to content
Discussion options

You must be logged in to vote

you can use transform processor

    processors:
      # loki create index for resource attributes, so need to move k8s attributes from log to resource
      transform/loki:
        log_statements:   
          - context: log
            statements:
              - set(resource.attributes["exporter"], "OTLP")
              - set(resource.attributes["k8s.namespace.name"], log.attributes["k8s.namespace.name"])
              - delete_key(log.attributes, "k8s.namespace.name")

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nealwei2008
Comment options

Answer selected by nealwei2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants