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

jq log - handling non json lines as raw with red color #975

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

gtankovics
Copy link
Contributor

Input:

{"time":"2020-11-28T21:11:15.949Z","severity":"DEBUG","severityLevel":100,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"NODE_ENV: production","payload":[]}
{"time":"2020-11-28T21:11:16.242Z","severity":"INFO","severityLevel":200,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"Authentication successfully initialized.","payload":[]}
Sat, 28 Nov 2020 21:11:21 GMT kubernetes-client deprecated require('kubernetes-client').config, use require('kubernetes-client/backends/request').config. at lib/k8s-api/KubeApiClient.js:25:39
Sat, 28 Nov 2020 21:11:21 GMT kubernetes-client deprecated getInCluster see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig- at lib/k8s-api/KubeApiClient.js:25:46
{"time":"2020-11-28T21:11:21.035Z","severity":"INFO","severityLevel":200,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"KubeApiClient successfully initialized.","payload":[]}
{"time":"2020-11-28T21:11:21.036Z","severity":"INFO","severityLevel":200,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"ComputeEngineApiClient successfully initialized.","payload":[]}
{"time":"2020-11-28T21:11:21.081Z","severity":"INFO","severityLevel":200,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"StorageApi successfully initialized.","payload":[]}
{"time":"2020-11-28T21:11:21.082Z","severity":"INFO","severityLevel":200,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"BackupHandler successfully initialized.","payload":[]}
{"time":"2020-11-28T21:11:21.082Z","severity":"INFO","severityLevel":200,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"Worker [update] successfully initialized.","payload":[]}
{"time":"2020-11-28T21:11:21.083Z","severity":"INFO","severityLevel":200,"hostname":"update-deployment-58fffbb4dc-2rzvz","message":"Worker listen.","payload":[]}

Original output
(drop error during parsing)

NODE_ENV: production
Authentication successfully initialized.
parse error: Invalid numeric literal at line 3, column

New output looks like this

NODE_ENV: production
Authentication successfully initialized.
- Sat, 28 Nov 2020 21:11:21 GMT kubernetes-client deprecated require('kubernetes-client').config, use require('kubernetes-client/backends/request').config. at lib/k8s-api/KubeApiClient.js:25:39"
- Sat, 28 Nov 2020 21:11:21 GMT kubernetes-client deprecated getInCluster see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig- at lib/k8s-api/KubeApiClient.js:25:46
KubeApiClient successfully initialized.
ComputeEngineApiClient successfully initialized.
StorageApi successfully initialized.
BackupHandler successfully initialized.
Worker [update] successfully initialized.
Worker listen.

@gtankovics gtankovics changed the title handling non json lines as raw with red color jq log - handling non json lines as raw with red color Nov 30, 2020
@derailed derailed merged commit 0a57bf4 into derailed:master Dec 2, 2020
@derailed
Copy link
Owner

derailed commented Dec 2, 2020

@gtankovics Very cool! Thank you for your contribution Gergely!!

placintaalexandru pushed a commit to placintaalexandru/k9s that referenced this pull request Apr 3, 2024
jq log - handling non json lines as raw with red color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants