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

Not possible to specify jsonl (JSON lines) in the language parameter #3042

Open
aliok opened this issue Jul 25, 2024 · 2 comments
Open

Not possible to specify jsonl (JSON lines) in the language parameter #3042

aliok opened this issue Jul 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@aliok
Copy link

aliok commented Jul 25, 2024

I follow logs of a Kubernetes pod. Those logs are in jsonl format (https://jsonlines.org/), where each line is a valid and complete JSON entry.

I see jsonl support is added here: #2539. However, it only uses jsonl format if a file name ends with .jsonl. In my case, I use a pipe like

kubectl logs -n my-pod --follow | bat --paging=never -l jsonl

which doesn't work: [bat error]: unknown syntax: 'jsonl'

Is it possible to add a separate language entry for jsonl?

@aliok aliok added the bug Something isn't working label Jul 25, 2024
@keith-hall
Copy link
Collaborator

Currently the .jsonl files are mapped to the JSON syntax so you should be able to just use -l json.

@aliok
Copy link
Author

aliok commented Jul 26, 2024

But in case of a pipe, the tool won't understand that the input is jsonl and not json, hence not doing the syntax highlighting properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants