Commit Graph

592 Commits (5af3664bc11123cdc7bc38aa006fb2bff3881303)

Author SHA1 Message Date
Timothy Stack 73e902f7d8 [json-log] handle invalid json log lines
Header from folded patch 'foldme1.patch':

[local] foldme
5 years ago
Phil Hord 5513deeade Add a gzip indexing class for faster gz navigation
The gzread function is slow.  Every time you seek to a new location, the
whole file up to that position has to be decompressed again.  This causes
massive lags when trying to do simple things in lnav on a large .gz file.

Use the zlib inflate* functions instead and record the dictionary
periodically while processing the file the first time.  Then use
inflateSetDictionary to restore the dictionary to a convenient
location when trying to seek into the file again in the future.

Use a default period of 1MB of compressed data for syncpoints.
Each syncpoint uses 32KB. This is a ratio of 3.2%.  For example,
a 1GB .gz file (compressed size) will require us to keep 32MB
of index data in memory. A better method may be to use a fixed
number of syncpoints and divide the file appropriately. This
would keep the memory bounded at the cost of slower file
navigation on large .gz files.

Use pread to read the data for the stream decompressor and remove
the lock_hack previously employed.

NB. The documentation on these zlib functions is sparse. I followed
the example in zlib/examples/zran.c, but I used the z_stream total_in
and total_out variables instead of keeping my own separately as zran.c
does.  Maybe this is incompatible with some very old zlib versions.
I haven't looked.
5 years ago
Timothy Stack 585986057d [build] missed cleaning a dir up 5 years ago
Timothy Stack 56a341f7f8 [view_curses] colors
Defect Number:
    Reviewed By:
   Testing Done:
5 years ago
Timothy Stack 9a05b9d186 [config] pay attention to XDG_CONFIG_HOME
Fixes #105
5 years ago
Timothy Stack e442f84e80 [textview] pause loading of files by pressing =
Fixes #670
5 years ago
Timothy Stack 63dba408ec [stdin] Keep the stdin piper file in .lnav so that it can be reopened
When piping the output of a program into lnav, the data would
be dumped to the terminal on exit so that it would not be
lost.  Since that is a bit noisy, the temp file used to store
the data is now left in .lnav so that it can be reopened later.
Older stdin captures are automatically removed after a day.

Also took the opportunity to start using filesystem::path more.

Fixes #436
5 years ago
Timothy Stack ffd9d88add [log_format] ignore line-format field if timestamp-format is set
Fixes #661
5 years ago
Timothy Stack 34db64aa32 [logfile] the index rebuild didn't check the mtime if the file size was the same
Fixes #668
5 years ago
Timothy Stack 7c485f64dc [cmake] fix some test targets 5 years ago
Timothy Stack 1257fcd62a [codacy] fix a few issues turned up 5 years ago
Timothy Stack 325e4a15d9 [build] test out the hunter package manager 5 years ago
Timothy Stack 76edd2a9d1 [line_buffer] refactor left a bug with non-blocking files
Fixes #662
5 years ago
Timothy Stack b81b35c866 [log-view] in time-offset mode, show negative times for messages before the first mark
Prototype for #395
5 years ago
Timothy Stack d61f2568d6 [ptimec] fix a case of undefined behavior 5 years ago
Timothy Stack a10fa06b10 [build] remove test file 5 years ago
Timothy Stack 02c53976b4 Some refactoring for the line buffer and other cleanups
Fixes #649
5 years ago
Timothy Stack 6cf5cc8213 [logfile] fix issue when files have headers
Defect Number:
    Reviewed By:
   Testing Done:
5 years ago
Timothy Stack 1fc24ecabf [bin2c] improve building of data files that are incorporated into the binary 5 years ago
Timothy Stack c7046b0b54 [json] newlines in the line format cause problems
Fixes #644
5 years ago
Timothy Stack 76b08f5fe3 [build] fix other lib order 5 years ago
Timothy Stack fb7d6eafaf [build] some refactoring of files 5 years ago
Timothy Stack 63e53377c3 [theme] add monocai theme 5 years ago
Timothy Stack a8e1f62da6 [build] add fmt lib 5 years ago
Timothy Stack fc9f9f43cf add bad-config to the dist 5 years ago
Timothy Stack 06d1098211 [config] initial support for themes
For #422

Still more to do
5 years ago
Timothy Stack 6f451eec35 [pretty] fix crash when rewriting lines 5 years ago
Timothy Stack 5e8a1cebe9 [json-log] handle arrays in json log message fields
Fixes #635
5 years ago
Timothy Stack 062d480fea [sql] fix some issues found while trying to query some logs 5 years ago
Timothy Stack 2fa603d07e [tests] fix a test 5 years ago
Timothy Stack 78d80fddd5 [cli] add -r flag for recursively loading files from a directory hierarchy
Fixes #431
5 years ago
Timothy Stack 33cdbefaaa [help] some online help additions 5 years ago
Timothy Stack 21c5c52843 [format] allow multiple log format patterns per log file
This tries to address #624
5 years ago
Timothy Stack 0e12f98ae7 [sql] change base_time to time_offset 5 years ago
Timothy Stack 469124d72b [time-offset] fixes
Defect Number:
    Reviewed By:
   Testing Done:
5 years ago
Timothy Stack 4614cbcb75 [sql] fix joins on some vtables 5 years ago
Timothy Stack 43243c7ba3 [build] revive freebsd release build
Some misc fixes for filtering as well
5 years ago
Timothy Stack 02b9e13343 [filters] add the number of hits for each filter in the editor
Might be useful to know the number of hits for a given filter.
5 years ago
Timothy Stack 659f01c9ae [filters] add a log_filters column to log tables that contains the matched filters
Related to #597
5 years ago
Timothy Stack 153b59ea8a [status] some fixes for the bottom status bar
Fixes #603
Fixes #578
6 years ago
Timothy Stack 104b8736e8 [vtab] fix for failed update to log_tags column and fix filtering with json logs 6 years ago
Timothy Stack 3d77fb2acf [cmds] change :write-raw-to to write all the lines in the view
Fixes #606
6 years ago
Timothy Stack 31c440777f [hotkeys] add ctrl+f to toggle filters
Fixes #604
6 years ago
Timothy Stack 0c2f84a3c0 [hotkeys] press 7/8 for previous/next minute
Fixes #382
6 years ago
Timothy Stack 5fff4d8784 [help] add some initial help text for search/SQL prompts
Also:
  * You can now "scroll out" of the visual editor to
    return to the main view.  This should alleviate the
    frustration of pressing up/down arrows thinking the
    main view should move but, really, you're stuck in
    the editor.
  * The three-dot-ellipsis for hidden fields has been
    replaced with a unicode vertical ellipsis so that
    less space is taken up.
6 years ago
Timothy Stack dcccebe797 [sql] add some help for regexp_capture()
Fixes #593
6 years ago
Timothy Stack 7dfa0e9dd4 [textview] highlights that start from the beginning of the line are not working in the log view
The log view prefixes lines with some extra characters and they
were mistakenly being included when performing the highlight
regex.

Fixes #590
6 years ago
Timothy Stack a63b6a199c [filter] in the filter editor, use "t" to toggle the type of filter
Related to #423
6 years ago
Timothy Stack 814ad03ec9 [view] keep a history of view positions
Fixes #577
6 years ago
Timothy Stack e001b49e28 [format] hidden object/array fields add sub-lines when they should not
Fixes #576
6 years ago
Timothy Stack 1a08eb0d12 [cmds] allow commands to set the prompt
Fixes #574 and #573
6 years ago
Timothy Stack 8b5b8743b1 try make locale test optional
Fixes #562
6 years ago
Timothy Stack 64d4226a89 disable test_top_status for now 6 years ago
Timothy Stack 5c6cc5fe2a [readline] pressing escape should exit the command prompt
Fixes #316
6 years ago
Timothy Stack 6336fa56e9 [cmds] :write-json-to should passthru JSON columns as JSON instead of strings
Fixes #565
6 years ago
Timothy Stack aa0bfd6c62 [sql] add a spooky_hash() function
Fixes #567
6 years ago
Timothy Stack ec82ecda62 [filter] display the number of filters 6 years ago
Timothy Stack efe6ccf0d1 [filter] change from backquote to tab for activating filter panel 6 years ago
Timothy Stack 2345a32423 [filter] add panel that shows the set of filters
Initial version, still needs some cleanup
6 years ago
Timothy Stack b1a6d06490 [lss] refactor the force flag during indexing and some other stuff 6 years ago
Timothy Stack 8b9536100e [build] fix a typo in test_sql.sh 6 years ago
Timothy Stack 2589345e5c [perf] improve initial indexing times 6 years ago
Timothy Stack 2e10ca09d0 [line_buffer] fix crlf handling in log files 6 years ago
Timothy Stack 9fa3714c85 [build] missed cleaning test files 6 years ago
Timothy Stack ac7ae1275a [cmds] add :redirect-to command for redirecting the output of commands in scripts
Related to #551
6 years ago
Timothy Stack ea5ac46c0e [cmds] the output of the :pipe commands should go to the top of the output stack and not to a temp file 6 years ago
Timothy Stack 5f5e2d5c4e [cleanup] prune some includes and some other cleaning
Defect Number:
    Reviewed By:
   Testing Done:
6 years ago
Timothy Stack 9664b015c6 [textview] preserve location in view when changing filters
Defect Number:
    Reviewed By:
   Testing Done:
6 years ago
Timothy Stack d1856b53ba [build] avoid adding -I/usr/include to CPPFLAGS
Defect Number:
    Reviewed By:
   Testing Done:
6 years ago
Timothy Stack d09e1509dd [test] remove debugging 6 years ago
Timothy Stack 265f80c60d [test] locale tweak 6 years ago
Timothy Stack 2c36d97a35 [build] try some more things to fix travis test failures 6 years ago
Timothy Stack bc26b92199 [json] some more journald log tweaks
Defect Number:
    Reviewed By:
   Testing Done:
6 years ago
Timothy Stack 26cccdafce [locale] some tweaks for recognizing non-english logs
Try to address some locale issues brought up in #533
6 years ago
Timothy Stack 0b36da15a6 add monotonic timestamp back to the journald format, map priority 1 to fatal as well 6 years ago
Timothy Stack dcf24f34ee use UTC for json log timezone 6 years ago
Timothy Stack f360732957 missed new file 6 years ago
Timothy Stack b1ff6b3a3b [json-log] fix some inconsistencies with json logs
Fill some gaps brought up in #535
6 years ago
Timothy Stack ae460526da [tests] disable test_view_colors for now 6 years ago
Timothy Stack a554d67875 [build] try to fix a build issue 6 years ago
Timothy Stack 3e457e30ca [json-format] fix json file recognition for crlf line-endings
Fixes #528
6 years ago
Timothy Stack 00ed12557b [keymap] add more keys to the keymap 6 years ago
Timothy Stack 086eb2e552 [build] update news and fix test failure 6 years ago
Timothy Stack 0ee6bdd5bf [sql] the log_part column was not correct in some cases 6 years ago
Timothy Stack 5e8983b857 [sql-view] pressing tab should hide bart charts
Fixes #514
6 years ago
Timothy Stack d1da7b800c [ptime] fix %p and %l 6 years ago
Timothy Stack b94571c58e [build] fixes... 6 years ago
Timothy Stack 5689984702 [yajlpp] use pointer to member over nullobj() 6 years ago
Timothy Stack 9e1411f113 [ptime] fix am/pm issue again
Fixes #520
6 years ago
Timothy Stack 5e0dabb231 [ptime] fix offset in failed parse for a few cases 6 years ago
Timothy Stack 2070c669de [ptime] fix PM offset
Fixes #517
6 years ago
Timothy Stack a741236c76 [sql] missed a null check on log_time in vt_filter
Fixes #518
6 years ago
Timothy Stack 36d5ff8b86 [lo-fi] display fixes
Fixes #513
Fixes #516
6 years ago
Timothy Stack ab2980f5dd [build] remove meta-sessions test dir 6 years ago
Timothy Stack 4ccae48aea [bookmarks] add support for tags and comments for log lines
Initial work for #446 and #447
  TODO: filtering on tags/comments

Also did a bunch of clang-tidy cleanups and improvements to
the online help.
6 years ago
Timothy Stack 7fb881222d [pretty] highlight log messages in the pretty view as in the normal log view 6 years ago
Timothy Stack 809159140c [unique_path] fix an infinite loop when files rolled 6 years ago
Timothy Stack a4faac4628 [tests] update drive_mvwattrline 6 years ago
Timothy Stack 7c5fc44f7d [view_curses] fix highlighting when a line contains unicode
Take into account unicode codepoint lengths when adjusting
attribute ranges
6 years ago
Timothy Stack 9f91d3b447 [log-view] display the unique parts of the file name instead of just the base
Instead of just displaying the base name of the file, try to include some
additional parts of the path that make a unique string.
6 years ago
Timothy Stack 1ed0ff7e0f [pretty-print] check if lines are XML before indenting them as such
Also, update the scanner for changes to re2c
6 years ago
Timothy Stack ecb1af304d [view_curses] fix search highlights
Cleanup the styling code, never really redid it after
switching to use mvwin_wchnstr

Fixes #493
6 years ago
Timothy Stack 6b9ca15f21 [tests] update expected output 6 years ago
Timothy Stack e4432cfdeb [tests] fix an issue with the last commit 6 years ago
Phil Hord 3f7f80e32c Squash various compiler warnings
Unused-result from sensitive APIs, printf/scanf formatting types, set
but never used variables, and uninitialized variables.

Also there's one select(enum) that doesn't cover all cases.
6 years ago
Timothy Stack ef34a6aaaf [search] display lines matching the search in preview instead of jumping to the first
Jumping around can be disruptive, instead show matches in
the preview window.
6 years ago
Timothy Stack 8257f188cb [hotkeys] change the filename hotkey to left/right arrow 6 years ago
Phil Hord 95e294decb fix failing unit test
The help output changed with the toggle-filenames option, but
the test for help wasn't updated.

Maybe the help needs to be updated a bit to include the two
filename column modes, now that I think about it.  But we should
discuss the merits of that first, I suppose.
6 years ago
Timothy Stack fe6781d3e8 [reltime] support milliseconds when specifying a partial absolute time
Fixes #499
6 years ago
Timothy Stack 7f99955cbc [misc] fix a perf issue when previewing commands and some sql fixes 7 years ago
Timothy Stack bdcfc5cfdd [misc] rounding some corners 7 years ago
Timothy Stack 74b58ed9fc [highlights] allow the highlight color to be specified in log formats
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack 4b40b3f9f5 [date-time] add a formatter for 0x0p+0
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack b5f5b4137c [search] redo search after filtering
Fixes #480
7 years ago
Timothy Stack f25980df03 [ui] rework the default colors change
The default colors change resulted in some parts of the lnav
UI being colored incorrectly.  I've reworked it a bit so that
the ansi color pairs are preserved and the default colors are
only used with the color pairs for roles.  I've also replaced
references to ansi colors with roles in a few places to make
things work consistently.
7 years ago
Suresh Sundriyal fb41673532 [test] Fix printf format specifier for size_t.
Suppress compiler warnings.
7 years ago
Suresh Sundriyal 150252e578 [command] Add a ':quit' command.
Add a ':quit' command and add ':q' as the alias for the
quit command.

Closes #470
7 years ago
Timothy Stack 283293e019 [tests] update expected output for default colors change 7 years ago
Timothy Stack 485a931793 [headless] always switch to the DB view after executing a SQL command, even if the result set is empty 7 years ago
Timothy Stack 5e4ca5bbed [test] comment out mvwattrline test for now 7 years ago
Timothy Stack 753e12d606 [unicode] do not clobber wide chars when applying attributes
Attempt to address #414
7 years ago
Timothy Stack a9fd0e37f6 [formats] add rfc5424 syslog format
Fixes #444
7 years ago
Timothy Stack 9d249004ac [time-offset] add days to offset
Fixes #435
7 years ago
Timothy Stack 6306659362 [test] remove extra test 7 years ago
Timothy Stack ef5347b0eb [build] even more 7 years ago
Timothy Stack 4fb6e24be9 [build] one more time 7 years ago
Timothy Stack c3688e87f7 [build] fix some tests
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack 36e46fc67b [log] do a full sort if there is a year rollover
Fixes #437
7 years ago
Timothy Stack 7f5916d480 [crash] call endwin() after a crash
Fixes #438
7 years ago
Timothy Stack 9764cb1a93 [loader] add line numbers for parse errors
Fixes #442
7 years ago
Timothy Stack f0c884ddc3 [build] another bro log test fix 7 years ago
Timothy Stack 867504b2b5 [build] try to fix some tests
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack 8ea51a6fd8 [formats] support for CSV/TSV log formats
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack 16fd7ec785 [help] remove old command help and add some more filesystem extensions 7 years ago
Timothy Stack 5e8d6aa3a8 [session] add hidden fields to the session
Fixes #433
7 years ago
Timothy Stack 5016ea9e71 [help] fix a help text issue 7 years ago
Timothy Stack 4cedde9a43 [help] add builtin help to the main help text as a reference
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack a973f7f934 [misc] some more miscellaneous bugs
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack aa21234164 [hist] need to rebuild hist to reflect marks
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack 035460eb61 update expected output 7 years ago
Timothy Stack 407c5c67b1 [build] missed some new files 7 years ago
Timothy Stack df399a36a4 [docs] some more docs, command-help, and tests for #428 7 years ago
Timothy Stack 04e60fd79d [build] sign warnings 7 years ago
Timothy Stack 78119dc9f1 fixing some minor issues
Fixes #255
7 years ago
Timothy Stack 411ea1fbee [help] show help text for SQL functions
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack cd76eae5b8 [build] convert some C files to C++
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack 6fcfd35395 [sql] add "search" column to the lnav_views table
Fixes #388
7 years ago
Timothy Stack 8776f6a703 [sql] do some minimal parsing/annotation of SQL statements
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack 0b157ff867 [sql] add function adapter template
Defect Number:
    Reviewed By:
   Testing Done:
7 years ago
Timothy Stack c0684a97cc [sql] add a regexp_capture tablue-valued function
Fixup the release makefile a bit.
7 years ago