diff --git a/src/highlighter.cc b/src/highlighter.cc index 1323ffa9..f5a999ce 100644 --- a/src/highlighter.cc +++ b/src/highlighter.cc @@ -38,7 +38,7 @@ highlighter::operator=(const highlighter& other) return *this; } - this->h_pattern = other.h_pattern; + this->h_name = other.h_name; this->h_fg = other.h_fg; this->h_bg = other.h_bg; this->h_role = other.h_role; @@ -57,12 +57,26 @@ highlighter::annotate_capture(attr_line_t& al, const line_range& lr) const auto& vc = view_colors::singleton(); auto& sa = al.get_attrs(); - if (!(lr.lr_start < lr.lr_end - && (this->h_nestable - || find_string_attr_containing(sa, &VC_STYLE, lr) == sa.end()))) - { + if (lr.lr_end <= lr.lr_start) { return; } + if (!this->h_nestable) { + for (const auto& attr : sa) { + if (attr.sa_range.lr_end == -1) { + continue; + } + if (!attr.sa_range.intersects(lr)) { + continue; + } + if (attr.sa_type == &VC_STYLE || attr.sa_type == &VC_ROLE + || attr.sa_type == &VC_FOREGROUND + || attr.sa_type == &VC_BACKGROUND) + { + return; + } + } + } + if (!this->h_fg.empty()) { sa.emplace_back(lr, VC_FOREGROUND.value( diff --git a/src/highlighter.hh b/src/highlighter.hh index 640dabcd..b6752110 100644 --- a/src/highlighter.hh +++ b/src/highlighter.hh @@ -91,6 +91,12 @@ struct highlighter { return *this; } + highlighter& with_name(std::string name) + { + this->h_name = std::move(name); + return *this; + } + highlighter& with_nestable(bool val) { this->h_nestable = val; @@ -103,7 +109,7 @@ struct highlighter { void annotate_capture(attr_line_t& al, const line_range& lr) const; - std::string h_pattern; + std::string h_name; role_t h_role{role_t::VCR_NONE}; styling::color_unit h_fg{styling::color_unit::make_empty()}; styling::color_unit h_bg{styling::color_unit::make_empty()}; diff --git a/src/lnav.cc b/src/lnav.cc index 1613ad45..5d255bf8 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -1146,12 +1146,12 @@ looper() && hl.h_attrs.empty()) { hl.with_attrs(hl.h_attrs - | vc.attrs_for_ident(hl.h_pattern)); + | vc.attrs_for_ident(hl.h_name)); } lnav_data.ld_views[LNV_LOG].get_highlights()[{ highlight_source_t::CONFIGURATION, - format->get_name().to_string() + "-" + hl.h_pattern}] + format->get_name().to_string() + "-" + hl.h_name}] = hl; } } diff --git a/src/log_format.cc b/src/log_format.cc index f7aabf4f..6a4378aa 100644 --- a/src/log_format.cc +++ b/src/log_format.cc @@ -2374,6 +2374,7 @@ external_log_format::build(std::vector& errors) } else { this->lf_highlighters.emplace_back(regex.unwrap()); this->lf_highlighters.back() + .with_name(hd_pair.first.to_string()) .with_format_name(this->elf_name) .with_color(fg, bg) .with_attrs(attrs); diff --git a/src/textview_curses.cc b/src/textview_curses.cc index 4859d353..ac94186b 100644 --- a/src/textview_curses.cc +++ b/src/textview_curses.cc @@ -230,7 +230,8 @@ textview_curses::reload_config(error_reporter& reporter) this->tc_highlights[{highlight_source_t::THEME, hl_pair.first}] = highlighter(regex.unwrap()) .with_attrs(attrs) - .with_color(fg, bg); + .with_color(fg, bg) + .with_nestable(false); } } } diff --git a/src/textview_curses_fwd.hh b/src/textview_curses_fwd.hh index abab90bd..683266be 100644 --- a/src/textview_curses_fwd.hh +++ b/src/textview_curses_fwd.hh @@ -36,11 +36,11 @@ #include "highlighter.hh" enum class highlight_source_t { - INTERNAL, - THEME, + INTERACTIVE, PREVIEW, CONFIGURATION, - INTERACTIVE, + THEME, + INTERNAL, }; using highlight_map_t diff --git a/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out b/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out index 494c1f89..a462406e 100644 --- a/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out +++ b/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out @@ -88,7 +88,7 @@ list of IP addresses that dhclient has bound to in CSV format: ▌  ▌# Usage: dhcp_ip.lnav /var/log/messages  ▌# Only include lines that look like:  - ▌# Apr 29 00:31:56 example-centos5 dhclient: bound to 10.1.10.103 -- renewal in 9938 seconds.  + ▌# Apr 29 00:31:56 example-centos5 dhclient: bound to 10.1.10.103 -- renewal in 9938 seconds.  ▌  ▌:filter-in dhclient: bound to  ▌  @@ -2379,7 +2379,7 @@ lnav@googlegroups.com[1] support@lnav.org[2] gethostbyname() Example #1 To get the hostname for the IP '127.0.0.1': - ;SELECT gethostbyaddr('127.0.0.1')  + ;SELECT gethostbyaddr('127.0.0.1')  @@ -3429,7 +3429,7 @@ lnav@googlegroups.com[1] support@lnav.org[2] #3 To capture a number and word into a JSON object with the named properties 'num' and 'str': - ;SELECT regexp_match('(?<num>\d+) (?<str>\w+)', '123 four') + ;SELECT regexp_match('(?\d+) (?\w+)', '123 four') @@ -3457,7 +3457,7 @@ lnav@googlegroups.com[1] support@lnav.org[2] #2 To wrap alphanumeric words with angle brackets: - ;SELECT regexp_replace('123 abc', '(\w+)', '<\1>')  + ;SELECT regexp_replace('123 abc', '(\w+)', '<\1>')  @@ -4105,15 +4105,15 @@ lnav@googlegroups.com[1] support@lnav.org[2] strfilter(), substr(), trim(), unicode(), upper() Examples #1 To select the XML nodes on the path '/abc/def': - ;SELECT * FROM xpath('/abc/def', '<abc><def a="b">Hello<def>Bye') + ;SELECT * FROM xpath('/abc/def', 'HelloBye') #2 To select all 'a' attributes on the path '/abc/def': - ;SELECT * FROM xpath('/abc/def/@a', '<abc><def a="b">Hello<def>Bye') + ;SELECT * FROM xpath('/abc/def/@a', 'HelloBye') #3 To select the text nodes on the path '/abc/def': - ;SELECT * FROM xpath('/abc/def/text()', '<abc><def a="b">Hello ★') + ;SELECT * FROM xpath('/abc/def/text()', 'Hello ★') diff --git a/test/expected/test_sql.sh_13429aed81d7edfd47b57e9cdb8a25c43aff35c4.out b/test/expected/test_sql.sh_13429aed81d7edfd47b57e9cdb8a25c43aff35c4.out index 3f2a81c8..a663004f 100644 --- a/test/expected/test_sql.sh_13429aed81d7edfd47b57e9cdb8a25c43aff35c4.out +++ b/test/expected/test_sql.sh_13429aed81d7edfd47b57e9cdb8a25c43aff35c4.out @@ -1,2 +1,2 @@ log_line log_part  log_time log_idle_msecs log_level log_mark log_comment log_tags log_filters  c_ip cs_bytes cs_method cs_uri_query  cs_uri_stem cs_username cs_vars cs_version s_app s_core s_pid s_req s_runtime s_switches s_worker_reqs sc_bytes sc_header_bytes sc_headers sc_status  - 0  <NULL> 2016-03-13 22:49:12.000  0 info   0  <NULL>  <NULL>  <NULL> 127.0.0.1  696 POST   <NULL> /update_metrics     38 HTTP/1.1  0   3  88185  1  0.129  1  1  47  378  9    200  + 0   2016-03-13 22:49:12.000  0 info   0       127.0.0.1  696 POST    /update_metrics     38 HTTP/1.1  0   3  88185  1  0.129  1  1  47  378  9    200  diff --git a/test/expected/test_sql_indexes.sh_1614ebb5e2e83bab11023354dea8a0885ddf64b4.out b/test/expected/test_sql_indexes.sh_1614ebb5e2e83bab11023354dea8a0885ddf64b4.out index 81cf4887..ea68c446 100644 --- a/test/expected/test_sql_indexes.sh_1614ebb5e2e83bab11023354dea8a0885ddf64b4.out +++ b/test/expected/test_sql_indexes.sh_1614ebb5e2e83bab11023354dea8a0885ddf64b4.out @@ -1,3 +1,3 @@ log_line log_part  log_time log_idle_msecs log_level log_mark log_comment log_tags log_filters log_msg_format    1  <NULL> 2009-07-20 22:59:29.000  3000 error   0  <NULL>  <NULL>  <NULL>   - 3  <NULL> 2013-02-15 06:00:31.000  112777262000 error   0  <NULL>  <NULL>  <NULL>   + 3   2013-02-15 06:00:31.000  112777262000 error   0         diff --git a/test/expected/test_sql_indexes.sh_541a8e35f34a206e340a3880128b6ce137847872.out b/test/expected/test_sql_indexes.sh_541a8e35f34a206e340a3880128b6ce137847872.out index 32cf0f6c..a7afcad7 100644 --- a/test/expected/test_sql_indexes.sh_541a8e35f34a206e340a3880128b6ce137847872.out +++ b/test/expected/test_sql_indexes.sh_541a8e35f34a206e340a3880128b6ce137847872.out @@ -2,4 +2,4 @@   0  <NULL> 2009-07-20 22:59:26.000  0 info   0  <NULL>  <NULL>  <NULL> 192.168.202.254 GET  -   <NULL> /vmw/cgi/tramp  gPXE/0.9.7  -  HTTP/1.0   134  200  <NULL> logfile_access_log.0     1 2009-07-20 22:59:29.000 3000 error 0 192.168.202.254 GET - /vmw/vSphere/default/vmkboot.gz gPXE/0.9.7 - HTTP/1.0 46210 404 logfile_access_log.0   2  <NULL> 2009-07-20 22:59:29.000  0 info   0  <NULL>  <NULL>  <NULL> 192.168.202.254 GET  -   <NULL> /vmw/vSphere/default/vmkernel.gz gPXE/0.9.7  -  HTTP/1.0   78929  200  <NULL> logfile_access_log.0  - 3  <NULL> 2013-02-15 06:00:31.000  112777262000 error   0  <NULL>  <NULL>  <NULL> 10.112.81.15  <NULL>  -   <NULL> <NULL>  -  -  <NULL>   0  400  <NULL> logfile_access_log.1 + 3   2013-02-15 06:00:31.000  112777262000 error   0       10.112.81.15    -      -  -     0  400   logfile_access_log.1 diff --git a/test/expected/test_sql_indexes.sh_69fd19d56a8cd1fc9c7eb9351270eabb491f8233.out b/test/expected/test_sql_indexes.sh_69fd19d56a8cd1fc9c7eb9351270eabb491f8233.out index 1c9b330d..5f631c22 100644 --- a/test/expected/test_sql_indexes.sh_69fd19d56a8cd1fc9c7eb9351270eabb491f8233.out +++ b/test/expected/test_sql_indexes.sh_69fd19d56a8cd1fc9c7eb9351270eabb491f8233.out @@ -2,4 +2,4 @@  0  <NULL> 2009-07-20 22:59:26.000  0 info   0  <NULL>  <NULL>  <NULL>   access_log    1 2009-07-20 22:59:29.000 3000 error 0 access_log  2  <NULL> 2009-07-20 22:59:29.000  0 info   0  <NULL>  <NULL>  <NULL>   access_log  - 3  <NULL> 2013-02-15 06:00:31.000  112777262000 error   0  <NULL>  <NULL>  <NULL>   access_log + 3   2013-02-15 06:00:31.000  112777262000 error   0         access_log diff --git a/test/expected/test_sql_indexes.sh_f7681c234d4f60df16c997a05163aeb058c52870.out b/test/expected/test_sql_indexes.sh_f7681c234d4f60df16c997a05163aeb058c52870.out index 280eac36..d6010cc5 100644 --- a/test/expected/test_sql_indexes.sh_f7681c234d4f60df16c997a05163aeb058c52870.out +++ b/test/expected/test_sql_indexes.sh_f7681c234d4f60df16c997a05163aeb058c52870.out @@ -2,4 +2,4 @@  0  <NULL> 2009-07-20 22:59:26.000  0 info   0  <NULL>  <NULL>  <NULL>     1 2009-07-20 22:59:29.000 3000 error 0  2  <NULL> 2009-07-20 22:59:29.000  0 info   0  <NULL>  <NULL>  <NULL>   - 3  <NULL> 2013-02-15 06:00:31.000  112777262000 error   0  <NULL>  <NULL>  <NULL>   + 3   2013-02-15 06:00:31.000  112777262000 error   0         diff --git a/test/expected/test_sql_search_table.sh_1a0d872ebc492fcecb2e79a0993170d5fc771a5b.out b/test/expected/test_sql_search_table.sh_1a0d872ebc492fcecb2e79a0993170d5fc771a5b.out index a24e5f1d..2ca148c6 100644 --- a/test/expected/test_sql_search_table.sh_1a0d872ebc492fcecb2e79a0993170d5fc771a5b.out +++ b/test/expected/test_sql_search_table.sh_1a0d872ebc492fcecb2e79a0993170d5fc771a5b.out @@ -1,2 +1,2 @@ log_line log_part  log_time log_idle_msecs log_level log_mark log_comment log_tags log_filters  comp  opid  tid  user  item prc reason  req  sid  src  sub vpxa_update  line  file match_index  lro_id  entity  operation  SessionId  SessionSubId  - 2  <NULL> 2022-06-02 11:58:12.376  182 info   0  <NULL>  <NULL>  <NULL> <NULL> e3979f6 45709 <NULL> <NULL> vpxd <NULL> <NULL> <NULL> Originator@6876 vpxLro  <NULL> <NULL> <NULL>  0 lro-846064 SessionManager vim.SessionManager.sessionIsActive 52626140-422b-6287-b4e4-344192c6a01d 523e0a4b-6e83-6bcd-9342-22502dd89866  + 2   2022-06-02 11:58:12.376  182 info   0        e3979f6 45709   vpxd    Originator@6876 vpxLro      0 lro-846064 SessionManager vim.SessionManager.sessionIsActive 52626140-422b-6287-b4e4-344192c6a01d 523e0a4b-6e83-6bcd-9342-22502dd89866  diff --git a/test/expected/test_sql_search_table.sh_5aaae556ecb1661602f176215e28f661d3404032.out b/test/expected/test_sql_search_table.sh_5aaae556ecb1661602f176215e28f661d3404032.out index f6f9606d..274d2ab0 100644 --- a/test/expected/test_sql_search_table.sh_5aaae556ecb1661602f176215e28f661d3404032.out +++ b/test/expected/test_sql_search_table.sh_5aaae556ecb1661602f176215e28f661d3404032.out @@ -1,4 +1,4 @@ log_line log_part  log_time log_idle_msecs log_level log_mark log_comment log_tags log_filters match_index user pid cpu_pct mem_pct vsz rss tty stat start_time cpu_time  cmd  cmd_name cmd_args   0  <NULL> 2022-06-02 00:01:01.000  0 info   0  <NULL>  <NULL>  <NULL>  1 root  2  0  0  0  0 ?  S  Jun01  0:00  [kthreadd] [kthreadd]  <NULL>  - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  1 root  2  0  0  0  0 ?  S  Jun01  0:00  [kthreadd] [kthreadd]  <NULL> - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  1 root  2  0  0  0  0 ?  S  Jun01  0:00  [kthreadd] [kthreadd]  <NULL>  + 12   2022-06-02 00:02:01.000  60000 info   0        1 root  2  0  0  0  0 ?  S  Jun01  0:00  [kthreadd] [kthreadd]  + 30   2022-06-02 00:03:01.000  60000 info   0        1 root  2  0  0  0  0 ?  S  Jun01  0:00  [kthreadd] [kthreadd]   diff --git a/test/expected/test_sql_search_table.sh_df0fd242f57a96d40f466493938cda0789a094fa.out b/test/expected/test_sql_search_table.sh_df0fd242f57a96d40f466493938cda0789a094fa.out index 08e4905a..0f5d52ff 100644 --- a/test/expected/test_sql_search_table.sh_df0fd242f57a96d40f466493938cda0789a094fa.out +++ b/test/expected/test_sql_search_table.sh_df0fd242f57a96d40f466493938cda0789a094fa.out @@ -1,24 +1,24 @@ log_line log_part  log_time log_idle_msecs log_level log_mark log_comment log_tags log_filters match_index user pid cpu_pct mem_pct  vsz rss tty stat start_time cpu_time  cmd  cmd_name  cmd_args  - 0  <NULL> 2022-06-02 00:01:01.000  0 info   0  <NULL>  <NULL>  <NULL>  0 root  1  0  0 158392 7792 ?  Ss  Jun01  0:14  /lib/systemd/systemd --switched-root --system --deserialize 16 /lib/systemd/systemd  --switched-root --system --deserialize 16  + 0   2022-06-02 00:01:01.000  0 info   0        0 root  1  0  0 158392 7792 ?  Ss  Jun01  0:14  /lib/systemd/systemd --switched-root --system --deserialize 16 /lib/systemd/systemd  --switched-root --system --deserialize 16  0 2022-06-02 00:01:01.000 0 info 0 1 root 2 0 0 0 0 ? S Jun01 0:00 [kthreadd] [kthreadd]  0  <NULL> 2022-06-02 00:01:01.000  0 info   0  <NULL>  <NULL>  <NULL>  2 root  3  0  0  0  0 ?  I<  Jun01  0:00  [rcu_gp]  [rcu_gp]  <NULL>  0 2022-06-02 00:01:01.000 0 info 0 3 root 4 0 0 0 0 ? I< Jun01 0:00 [rcu_par_gp] [rcu_par_gp]  0  <NULL> 2022-06-02 00:01:01.000  0 info   0  <NULL>  <NULL>  <NULL>  4 root  6  0  0  0  0 ?  I<  Jun01  0:00  [kworker/0:0H-kblockd]  [kworker/0:0H-kblockd] <NULL>  - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  0 root  1  0  0 158392 7792 ?  Ss  Jun01  0:14  /lib/systemd/systemd --switched-root --system --deserialize 16 /lib/systemd/systemd  --switched-root --system --deserialize 16 - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  1 root  2  0  0  0  0 ?  S  Jun01  0:00  [kthreadd]  [kthreadd]  <NULL>  - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL> 2 root 3 0 0 0 0 ? I< Jun01 0:00 [rcu_gp] [rcu_gp] - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  3 root  4  0  0  0  0 ?  I<  Jun01  0:00  [rcu_par_gp]  [rcu_par_gp]  <NULL>  - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL> 4 root 6 0 0 0 0 ? I< Jun01 0:00 [kworker/0:0H-kblockd] [kworker/0:0H-kblockd] - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  5 root  8  0  0  0  0 ?  I<  Jun01  0:00  [mm_percpu_wq]  [mm_percpu_wq]  <NULL>  - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL> 6 root 9 0 0 0 0 ? S Jun01 0:00 [ksoftirqd/0] [ksoftirqd/0] - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  7 root  10  0  0  0  0 ?  I  Jun01  0:23  [rcu_sched]  [rcu_sched]  <NULL>  - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL> 8 root 11 0 0 0 0 ? I Jun01 0:00 [rcu_bh] [rcu_bh] - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  9 root  12  0  0  0  0 ?  S  Jun01  0:00  [migration/0]  [migration/0]  <NULL>  - 12  <NULL> 2022-06-02 00:02:01.000  60000 info   0  <NULL> 10 root 14 0 0 0 0 ? S Jun01 0:00 [cpuhp/0] [cpuhp/0] - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  0 root  1  0  0 158392 7792 ?  Ss  Jun01  0:14  /lib/systemd/systemd --switched-root --system --deserialize 16 /lib/systemd/systemd  --switched-root --system --deserialize 16  - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL> 1 root 2 0 0 0 0 ? S Jun01 0:00 [kthreadd] [kthreadd] - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  2 root  3  0  0  0  0 ?  I<  Jun01  0:00  [rcu_gp]  [rcu_gp]  <NULL>  - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL> 3 root 4 0 0 0 0 ? I< Jun01 0:00 [rcu_par_gp] [rcu_par_gp] - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  4 root  6  0  0  0  0 ?  I<  Jun01  0:00  [kworker/0:0H-kblockd]  [kworker/0:0H-kblockd] <NULL>  - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL> 5 root 8 0 0 0 0 ? I< Jun01 0:00 [mm_percpu_wq] [mm_percpu_wq] - 30  <NULL> 2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  6 root  9  0  0  0  0 ?  S  Jun01  0:00  [ksoftirqd/0]  [ksoftirqd/0]  <NULL>  + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL>      0 root  1  0  0 158392 7792 ?  Ss  Jun01  0:14  /lib/systemd/systemd --switched-root --system --deserialize 16 /lib/systemd/systemd  --switched-root --system --deserialize 16 + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  1 root  2  0  0  0  0 ?  S  Jun01  0:00  [kthreadd]  [kthreadd]  <NULL>  + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL> 2 root 3 0 0 0 0 ? I< Jun01 0:00 [rcu_gp] [rcu_gp] + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  3 root  4  0  0  0  0 ?  I<  Jun01  0:00  [rcu_par_gp]  [rcu_par_gp]  <NULL>  + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL> 4 root 6 0 0 0 0 ? I< Jun01 0:00 [kworker/0:0H-kblockd] [kworker/0:0H-kblockd] + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  5 root  8  0  0  0  0 ?  I<  Jun01  0:00  [mm_percpu_wq]  [mm_percpu_wq]  <NULL>  + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL> 6 root 9 0 0 0 0 ? S Jun01 0:00 [ksoftirqd/0] [ksoftirqd/0] + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  7 root  10  0  0  0  0 ?  I  Jun01  0:23  [rcu_sched]  [rcu_sched]  <NULL>  + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL> 8 root 11 0 0 0 0 ? I Jun01 0:00 [rcu_bh] [rcu_bh] + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  9 root  12  0  0  0  0 ?  S  Jun01  0:00  [migration/0]  [migration/0]  <NULL>  + 12   2022-06-02 00:02:01.000  60000 info   0  <NULL> 10 root 14 0 0 0 0 ? S Jun01 0:00 [cpuhp/0] [cpuhp/0] + 30   2022-06-02 00:03:01.000  60000 info   0  <NULL>      0 root  1  0  0 158392 7792 ?  Ss  Jun01  0:14  /lib/systemd/systemd --switched-root --system --deserialize 16 /lib/systemd/systemd  --switched-root --system --deserialize 16  + 30   2022-06-02 00:03:01.000  60000 info   0  <NULL> 1 root 2 0 0 0 0 ? S Jun01 0:00 [kthreadd] [kthreadd] + 30   2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  2 root  3  0  0  0  0 ?  I<  Jun01  0:00  [rcu_gp]  [rcu_gp]  <NULL>  + 30   2022-06-02 00:03:01.000  60000 info   0  <NULL> 3 root 4 0 0 0 0 ? I< Jun01 0:00 [rcu_par_gp] [rcu_par_gp] + 30   2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  4 root  6  0  0  0  0 ?  I<  Jun01  0:00  [kworker/0:0H-kblockd]  [kworker/0:0H-kblockd] <NULL>  + 30   2022-06-02 00:03:01.000  60000 info   0  <NULL> 5 root 8 0 0 0 0 ? I< Jun01 0:00 [mm_percpu_wq] [mm_percpu_wq] + 30   2022-06-02 00:03:01.000  60000 info   0  <NULL>  <NULL>  <NULL>  6 root  9  0  0  0  0 ?  S  Jun01  0:00  [ksoftirqd/0]  [ksoftirqd/0]  <NULL>  diff --git a/test/expected/test_sql_search_table.sh_ef9373a76853f345d06234f6e0fe11b5d40da27b.out b/test/expected/test_sql_search_table.sh_ef9373a76853f345d06234f6e0fe11b5d40da27b.out index afc58556..9a7dd283 100644 --- a/test/expected/test_sql_search_table.sh_ef9373a76853f345d06234f6e0fe11b5d40da27b.out +++ b/test/expected/test_sql_search_table.sh_ef9373a76853f345d06234f6e0fe11b5d40da27b.out @@ -1,6 +1,6 @@ log_line log_part  log_time log_idle_msecs log_level log_mark log_comment log_tags log_filters  comp  opid  tid  user  item prc reason  req  sid  src  sub vpxa_update  line  file match_index  lro_id  entity  operation  SessionId  SessionSubId  log_body   0  <NULL> 2022-06-02 11:58:12.193  0 info   0  <NULL>  <NULL>  <NULL> <NULL> 7e1280cf  45715 <NULL> <NULL> vpxd <NULL> <NULL> <NULL> Originator@6876 vpxLro  <NULL> <NULL> <NULL>  0 lro-846063 SessionManager  vim.SessionManager.sessionIsActive  528e6e0c-246d-58b5-3234-278c6e0c5d0d 52c289ac-2563-48d5-8a8e-f178da022c0d [VpxLRO] -- BEGIN lro-846063 -- SessionManager -- vim.Sessio⋯8b5-3234-278c6e0c5d0d(52c289ac-2563-48d5-8a8e-f178da022c0d)  - 2  <NULL> 2022-06-02 11:58:12.376  182 info   0  <NULL>  <NULL>  <NULL> <NULL> e3979f6  45709 <NULL> <NULL> vpxd <NULL> <NULL> <NULL> Originator@6876 vpxLro  <NULL> <NULL> <NULL>  0 lro-846064 SessionManager  vim.SessionManager.sessionIsActive  52626140-422b-6287-b4e4-344192c6a01d 523e0a4b-6e83-6bcd-9342-22502dd89866 [VpxLRO] -- BEGIN lro-846064 -- SessionManager -- vim.Sessio⋯287-b4e4-344192c6a01d(523e0a4b-6e83-6bcd-9342-22502dd89866) - 4  <NULL> 2022-06-02 11:58:12.623  246 info   0  <NULL>  <NULL>  <NULL> <NULL> l3wrhr4o-cbf-h5:70001034-60 47524 <NULL> <NULL> vpxd <NULL> <NULL> <NULL> Originator@6876 vpxLro  <NULL> <NULL> <NULL>  0 lro-846066 ChangeLogCollector vim.cdc.ChangeLogCollector.waitForChanges 526861fc-0c28-1930-ae5e-d8c2772bf8c2 52a7a308-9646-c054-f1e7-16131c1a7db6 [VpxLRO] -- BEGIN lro-846066 -- ChangeLogCollector -- vim.c⋯1930-ae5e-d8c2772bf8c2(52a7a308-9646-c054-f1e7-16131c1a7db6)  - 6  <NULL> 2022-06-02 11:58:12.736  113 info   0  <NULL>  <NULL>  <NULL> <NULL> 499b440  48432 <NULL> <NULL> vpxd <NULL> <NULL> <NULL> Originator@6876 vpxLro  <NULL> <NULL> <NULL>  0 lro-846067 SessionManager vim.SessionManager.sessionIsActive 521fe9f6-d061-11a2-ac86-badb3c071373 524cba9b-2cc4-9b70-32e4-421452a404d7 [VpxLRO] -- BEGIN lro-846067 -- SessionManager -- vim.Sessio⋯1a2-ac86-badb3c071373(524cba9b-2cc4-9b70-32e4-421452a404d7) + 2   2022-06-02 11:58:12.376  182 info   0        e3979f6  45709   vpxd    Originator@6876 vpxLro      0 lro-846064 SessionManager  vim.SessionManager.sessionIsActive  52626140-422b-6287-b4e4-344192c6a01d 523e0a4b-6e83-6bcd-9342-22502dd89866 [VpxLRO] -- BEGIN lro-846064 -- SessionManager -- vim.Sessio⋯287-b4e4-344192c6a01d(523e0a4b-6e83-6bcd-9342-22502dd89866) + 4   2022-06-02 11:58:12.623  246 info   0        l3wrhr4o-cbf-h5:70001034-60 47524   vpxd    Originator@6876 vpxLro      0 lro-846066 ChangeLogCollector vim.cdc.ChangeLogCollector.waitForChanges 526861fc-0c28-1930-ae5e-d8c2772bf8c2 52a7a308-9646-c054-f1e7-16131c1a7db6 [VpxLRO] -- BEGIN lro-846066 -- ChangeLogCollector -- vim.c⋯1930-ae5e-d8c2772bf8c2(52a7a308-9646-c054-f1e7-16131c1a7db6)  + 6   2022-06-02 11:58:12.736  113 info   0        499b440  48432   vpxd    Originator@6876 vpxLro      0 lro-846067 SessionManager vim.SessionManager.sessionIsActive 521fe9f6-d061-11a2-ac86-badb3c071373 524cba9b-2cc4-9b70-32e4-421452a404d7 [VpxLRO] -- BEGIN lro-846067 -- SessionManager -- vim.Sessio⋯1a2-ac86-badb3c071373(524cba9b-2cc4-9b70-32e4-421452a404d7)  8  <NULL> 2022-06-02 11:58:12.740  4 info   0  <NULL>  <NULL>  <NULL> <NULL> 55a419df  48035 <NULL> <NULL> vpxd <NULL> <NULL> <NULL> Originator@6876 vpxLro  <NULL> <NULL> <NULL>  0 lro-846068 SessionManager  vim.SessionManager.sessionIsActive  52585600-b0bc-76b1-c4d5-4d7708671c5e 523b68ba-e312-9909-a3ca-39cc86aaf206 [VpxLRO] -- BEGIN lro-846068 -- SessionManager -- vim.Sessio⋯6b1-c4d5-4d7708671c5e(523b68ba-e312-9909-a3ca-39cc86aaf206)  diff --git a/test/expected/test_text_file.sh_87943c6be50d701a03e901f16493314c839af1ab.out b/test/expected/test_text_file.sh_87943c6be50d701a03e901f16493314c839af1ab.out index a7ed7404..fab42285 100644 --- a/test/expected/test_text_file.sh_87943c6be50d701a03e901f16493314c839af1ab.out +++ b/test/expected/test_text_file.sh_87943c6be50d701a03e901f16493314c839af1ab.out @@ -56,7 +56,7 @@ log_level_t abbrev2level(const char* levelstr, ssize_t len) { - if (len == 0 || levelstr[0] == '\0') { + if (len == 0 || levelstr[0] == '\0') { return LEVEL_UNKNOWN; } @@ -67,13 +67,13 @@ abbrev2level(const char* levelstr, ssize_t len) case 'V': if (len > 1) { switch (levelstr[len - 1]) { - case '2': + case '2': return LEVEL_DEBUG2; - case '3': + case '3': return LEVEL_DEBUG3; - case '4': + case '4': return LEVEL_DEBUG4; - case '5': + case '5': return LEVEL_DEBUG5; } } diff --git a/test/formats/xmlmsg/format.json b/test/formats/xmlmsg/format.json index fa191f71..b557ed62 100644 --- a/test/formats/xmlmsg/format.json +++ b/test/formats/xmlmsg/format.json @@ -50,6 +50,14 @@ "reply_error": { "pattern": "(?<=)ERROR(?=)", "color": "Red1" + }, + "request": { + "pattern": "]*>", + "color": "Green" + }, + "reply": { + "pattern": "]*>", + "color": "Gold1" } }, "sample": [