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

Add Head/Tail filtering of log for more efficient searches #2548

Closed
ddb4github opened this issue Mar 20, 2019 · 5 comments
Closed

Add Head/Tail filtering of log for more efficient searches #2548

ddb4github opened this issue Mar 20, 2019 · 5 comments
Labels
enhancement General tag for an enhancement logging Logging issue resolved A fixed issue
Milestone

Comments

@ddb4github
Copy link
Contributor

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

Describe the solution you'd like
Suggest use "Head lines" for "Display Order => Oldest First'
And keep current 'Tail lines" for "Display Order => Newest First'

@netniV
Copy link
Member

netniV commented Mar 20, 2019

Can you be more explainatory? As far as I am aware, that is exactly how it works.

@ddb4github
Copy link
Contributor Author

Current "Logs(tab)" design is:

  • tail some lines of selected cacti.log file, then show them by timestamp.
  • head of selected cacti.log is not able to display by current filter combination.

My idea is:

  • head or tail some lines of selected cacti.log, then show them by timestamp.
  • Then we can freely read logfile whatever get from head or tail, display them by ordest or newest first.
    Like
    image

My Case is:

- When I found my cacti have some problem around midnight 00:00,  I want to check tail of
  yesterday cacti.log-<date> and head of today cacti.log;
- I checked tail of last cacti.log by "Logs(tab) ->  (Display Order=Newest First)"
- I get few confusion when I want to check head of today cacti.log by  "Logs --> (Display Order=Oldest First)"

@netniV
Copy link
Member

netniV commented Mar 21, 2019

I think introducing the Head/Tail options would potentially speed up some searches but since the number of rows is linked to the filtered results of a search... it could get extremely confusing and lead to misunderstanding of what's being displayed in the results if we were to also add head/tail filtering. Some would expect the 500 to be maximum number of lines displayed after filtering, others the number trimmed before filtering even starts.

If there was a way to automatically scroll from one log file to another, that would make life easier.

@cigamit cigamit added the enhancement General tag for an enhancement label Mar 24, 2019
@TheWitness TheWitness added the logging Logging issue label Mar 17, 2020
@netniV
Copy link
Member

netniV commented Jul 11, 2020

So currently, having just been through this to add a feature to 1.3, the code loops through every line in the file to determine if it should display it and get an accurate line count. Once that is done, it then calculates the number of pages it would have from the displayed lines and then caclulates the start line and the end line.

With all that info, it then reads the file for a second time and displays those appropriate lines that should be displayed. Currently, the code actually calculates whether to display a line twice so I have speeded that be up in 1.3 by caching the result. You may not notice that speed difference though as it would be tiny, especially given the following enhancement that may have an opposite effect:

See #3679 and its associated commit for more info.

@TheWitness TheWitness added this to the v1.2.23 milestone Oct 17, 2022
TheWitness added a commit that referenced this issue Oct 17, 2022
Logs display Order vs head or tail
@TheWitness TheWitness added the resolved A fixed issue label Oct 17, 2022
@TheWitness
Copy link
Member

This is resolved now.

@netniV netniV changed the title Logs display Order vs head or tail Add Head/Tail filtering of log for more efficient searches Dec 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement General tag for an enhancement logging Logging issue resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants