Skip to content

Filter logs by backstage.io/kubernetes-label-selector #164

@jkleinlercher

Description

@jkleinlercher

Summary

How can I display logs based on the backstage.io/kubernetes-label-selector annotation?

I defined this custom query in the app-config.yaml:

fetch logs, from: -1d
                | filter backstageComponent == "$${componentNamespace}.$${componentName}"
                | sort timestamp desc
                | fieldsAdd content=if(isNull(content), "N/A", else: content)
                | fieldsAdd source=if(isNull(log.source), "N/A", else: log.source)
                | fieldsAdd host=if(isNull(host.name), "N/A", else: host.name)
                | fieldsAdd environment = "$${environmentName}"
                | fieldsKeep timestamp, source, content, host, environment

this doesn’t seem to work
filter backstageComponent == "$${componentNamespace}.$${componentName}"

Can you add an example in the Readme?
Also, I want to filter Davis events like this.

Feature Suggestion

Possible Implementation

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions