From b77367a3d3b56b5aed7949794a83df910a4f5a2d Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Wed, 16 Jun 2021 11:19:11 -0700 Subject: [PATCH] [logs] some minor fixes hide files on remote like with archives fix vmw_log pattern fix an NPE --- src/formats/vmw_log.json | 8 +++++++- src/logfile_sub_source.cc | 2 ++ src/tailer/tailer.looper.cc | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/formats/vmw_log.json b/src/formats/vmw_log.json index f1be4e11..f9b5228d 100644 --- a/src/formats/vmw_log.json +++ b/src/formats/vmw_log.json @@ -6,7 +6,10 @@ "url": "http://kb.vmware.com/kb/2004201", "regex": { "6.0+": { - "pattern": "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) (?\\w+) (?[\\w\\-]+)\\[(?\\w+)\\] \\[(?[^ \\]]+)\\s*(?: sub=(?.+?))?(?: opI(?:D|d)=(?[^ \\]]+))?(?: user=(?[^ \\]]+))?\\]\\s*(?.*)(?:\\n.*)?$" + "pattern": "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) (?\\w+) (?[\\w\\-]+)\\[(?\\w+)\\] \\[(?[^ \\]]+)\\s*(?: sub=(?.+?))?(?: opI(?:D|d)=(?[^\\]]+))?(?: user=(?[^ \\]]+))?\\]\\s*(?.*)(?:\\n.*)?$" + }, + "6.0+-nosrc": { + "pattern": "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) (?\\w+) (?[\\w\\-]+)\\[(?\\w+)\\] \\[(?:opI(?:D|d)=(?[^\\]]+))\\]\\s*(?.*)(?:\\n.*)?$" }, "section": { "pattern": "^(?\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2})) (?:- last log rotation time, \\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[-+]\\d{2}:\\d{2}))?\\s*(ESX KMX Agent started.|Section for VMware VirtualCenter,.*|- time the service was last started(?: \\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z)?, Section for (?:[^,]+), pid=(?\\w+).*)" @@ -129,6 +132,9 @@ }, { "line": "2021-06-03T16:50:32.890Z - time the service was last started 2021-06-03T16:50:32.884Z, Section for VMware Update Manager, pid=5916, version=7.0.3, build=0, option=DEBUG" + }, + { + "line": "2021-06-16T14:59:52.362Z info vsand[1000083783] [opID=MainThread VsanMgmtSvcMain::_PatchPyVmomi] Python 3.8.8 (default, Jun 1 2021, 03:16:39) [GCC 4.6.3] on VMkernel, optimize: 0, recursionLimit: 300" } ] } diff --git a/src/logfile_sub_source.cc b/src/logfile_sub_source.cc index 29bdd590..eeb16e09 100644 --- a/src/logfile_sub_source.cc +++ b/src/logfile_sub_source.cc @@ -628,6 +628,8 @@ logfile_sub_source::rebuild_result logfile_sub_source::rebuild_index(nonstd::opt ld.ld_lines_indexed, last_indexed_line, new_file_line.get_time_in_millis(), + last_indexed_line == nullptr ? + (uint64_t) -1 : last_indexed_line->get_time_in_millis()); if (retval <= rebuild_result::rr_partial_rebuild) { retval = rebuild_result::rr_partial_rebuild; diff --git a/src/tailer/tailer.looper.cc b/src/tailer/tailer.looper.cc index 30e49ed4..6b136d7f 100644 --- a/src/tailer/tailer.looper.cc +++ b/src/tailer/tailer.looper.cc @@ -668,7 +668,9 @@ void tailer::looper::host_tailer::loop_body() fc.fc_file_names[lpath_str] .with_filename(custom_name) .with_source(logfile_name_source::REMOTE) - .with_tail(loo.loo_tail); + .with_tail(loo.loo_tail) + .with_non_utf_visibility(false) + .with_visible_size_limit(256 * 1024); update_active_files(fc); }); }