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

Support for search / highlight #13

Open
alexcherka opened this issue Feb 20, 2024 · 8 comments
Open

Support for search / highlight #13

alexcherka opened this issue Feb 20, 2024 · 8 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@alexcherka
Copy link

Would be really nice if you could filter console lines via search. Or even just highlight a desired key. I know this may not be the intention of this tool but when filtering back in time, would be great to search for specific data if needed!

@amorey
Copy link
Member

amorey commented Feb 20, 2024

Thanks for the suggestion! I definitely want to add search/highlight functionality to kubetail. It will take some time to implement but now's a good time to start specing it out. Is there another tool that you think has implemented log search particularly well so far?

@alexcherka
Copy link
Author

alexcherka commented Feb 20, 2024

As far as web k8s logs viewers go, I don't think there is much out there honestly... I know for IDE's I use K8s Lens that when you view a pod's logs it allows for searching via highlight and then jump around to results.
image

I think this is the best option depending on how you render your front end results. I assume there is some JS packages that allow for search/highlight content on page.

Found something that seems to cover it pretty well.
https://markjs.io/
Specifically the example Search bar with jump to matches
image

@amorey
Copy link
Member

amorey commented Feb 21, 2024

Thanks! I'll take a look at K8S Lens and mark.js.

@amorey amorey added enhancement New feature or request question Further information is requested labels Feb 21, 2024
@nodesocket
Copy link

Are you thinking client side search? DataDog Logs (paid solution) does a really good job at filtering and searching.

@amorey
Copy link
Member

amorey commented Feb 23, 2024

I'm curious about doing search client side but I have a feeling that performance will be an issue. I think I'll do some experiments with IndexedDB to see if it's feasible.

@nefarius
Copy link

I think in this case client-side search and indexing makes sense; no load increase on the backend and the client already has all the searchable data anyway so why not make use of it.

@alexcherka
Copy link
Author

I agree with @nefarius, The front end data is loaded in the first place regardless and then filtering can be done client/DOM level and in theory no extra heavy lifting on the backend or really front end either. I think a highlighting approach is best and just have it jump around to matches. Similar to vscode in file search or any other ide as an example

@amorey
Copy link
Member

amorey commented Feb 23, 2024

Currently, the frontend only stores new events so the full log files aren't directly accessible locally. We could change this behavior and download the full files in the background and that would work well for small/medium files but it could be problematic for large amounts of data (and egress costs could also be an issue down the road for power users). I'm still curious to test out client side search though because it might be useful for small amounts of data or in other contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants