Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[newrelic-logging] Specify logtype via Kubernetes API object metadata #251

Open
devurandom opened this issue Jan 8, 2021 · 2 comments
Open

Comments

@devurandom
Copy link

devurandom commented Jan 8, 2021

Is your feature request related to a problem? Please describe.

According to New Relic documentation, a logtype attribute can be set on logs in order to parse them in a certain way (e.g. to automatically extract structured information from Nginx logs): https://docs.newrelic.com/docs/logs/log-management/ui-data/logs-parsing-built-rules-custom-parsing#logtype

Currently there seems to be no way to specify the logtype for logs originating from containers running on Kubernetes.

Describe the solution you'd like

I would like to be able to set this logtype attribute in the object metadata via Kubernetes API (e.g. something like metadata > annotations > "newrelic.com/logtype" = "nginx").

Describe alternatives you've considered

I do not see any way to achieve the result of parsing structured logs for containers running on Kubernetes with current New Relic capabilities.

Additional context

Originally asked as a question, but received no reply with a solution that would achieve the desired result: https://discuss.newrelic.com/t/kubernetes-helm-nri-bundle-logtype/120712

This might be somewhat related to #78 (they both are about using Kubernetes object metadata to influence New Relic log ingest behaviour).

@giovannicandido
Copy link

This is someone a basic feature. I would like to see implemented

@giovannicandido
Copy link

giovannicandido commented Feb 16, 2023

To work around a setup a custom parsing in the application ui targeting the containers in kubernetes.
If you going to implement it make sure to ignore the start of the messages because is getting from the docker container and not from kubernetes, all messges get prefixed with a "tiimestamp stdout F ".
In order to parse json I did setup the following:

%{TIMESTAMP_ISO8601:containerTimestamp} stdout F %{GREEDYDATA:message:json}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants