mirror of https://github.com/tstack/lnav
[log-annotations] add :annotate command
parent
1b31d7401a
commit
a16a8cf3fa
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) 2023, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lnav_bookmarks_json_hh
|
||||
#define lnav_bookmarks_json_hh
|
||||
|
||||
#include "bookmarks.hh"
|
||||
#include "yajlpp/yajlpp_def.hh"
|
||||
|
||||
extern typed_json_path_container<logmsg_annotations>
|
||||
logmsg_annotations_handlers;
|
||||
|
||||
#endif
|
@ -0,0 +1,406 @@
|
||||
/**
|
||||
* Copyright (c) 2023, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <future>
|
||||
|
||||
#include "log.annotate.hh"
|
||||
|
||||
#include "base/auto_fd.hh"
|
||||
#include "base/auto_pid.hh"
|
||||
#include "base/fs_util.hh"
|
||||
#include "base/paths.hh"
|
||||
#include "line_buffer.hh"
|
||||
#include "lnav.hh"
|
||||
#include "log_data_helper.hh"
|
||||
#include "md4cpp.hh"
|
||||
#include "readline_highlighters.hh"
|
||||
#include "yajlpp/yajlpp.hh"
|
||||
|
||||
namespace lnav {
|
||||
namespace log {
|
||||
namespace annotate {
|
||||
|
||||
struct compiled_cond_expr {
|
||||
auto_mem<sqlite3_stmt> cce_stmt{sqlite3_finalize};
|
||||
bool cce_enabled{true};
|
||||
};
|
||||
|
||||
struct expressions : public lnav_config_listener {
|
||||
void reload_config(error_reporter& reporter) override
|
||||
{
|
||||
auto& lnav_db = injector::get<auto_sqlite3&>();
|
||||
|
||||
if (lnav_db.in() == nullptr) {
|
||||
log_warning("db not initialized yet!");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& cfg = injector::get<const config&>();
|
||||
|
||||
this->e_cond_exprs.clear();
|
||||
for (const auto& pair : cfg.a_definitions) {
|
||||
if (pair.second.a_handler.pp_value.empty()) {
|
||||
auto um
|
||||
= lnav::console::user_message::error(
|
||||
"no handler specified for annotation")
|
||||
.with_reason("Every annotation requires a handler");
|
||||
reporter(&pair.second.a_handler, um);
|
||||
continue;
|
||||
}
|
||||
|
||||
auto stmt_str = fmt::format(FMT_STRING("SELECT 1 WHERE {}"),
|
||||
pair.second.a_condition);
|
||||
compiled_cond_expr cce;
|
||||
|
||||
log_info("preparing annotation condition expression: %s",
|
||||
stmt_str.c_str());
|
||||
auto retcode = sqlite3_prepare_v2(lnav_db,
|
||||
stmt_str.c_str(),
|
||||
stmt_str.size(),
|
||||
cce.cce_stmt.out(),
|
||||
nullptr);
|
||||
if (retcode != SQLITE_OK) {
|
||||
auto sql_al = attr_line_t(pair.second.a_condition)
|
||||
.with_attr_for_all(SA_PREFORMATTED.value())
|
||||
.with_attr_for_all(
|
||||
VC_ROLE.value(role_t::VCR_QUOTED_CODE));
|
||||
readline_sqlite_highlighter(sql_al, -1);
|
||||
intern_string_t cond_expr_path = intern_string::lookup(
|
||||
fmt::format(FMT_STRING("/log/annotations/{}/condition"),
|
||||
pair.first));
|
||||
auto snippet = lnav::console::snippet::from(
|
||||
source_location(cond_expr_path), sql_al);
|
||||
|
||||
auto um = lnav::console::user_message::error(
|
||||
"SQL expression is invalid")
|
||||
.with_reason(sqlite3_errmsg(lnav_db))
|
||||
.with_snippet(snippet);
|
||||
|
||||
reporter(&pair.second.a_condition, um);
|
||||
continue;
|
||||
}
|
||||
|
||||
this->e_cond_exprs.emplace(pair.first, std::move(cce));
|
||||
}
|
||||
}
|
||||
|
||||
void unload_config() override { this->e_cond_exprs.clear(); }
|
||||
|
||||
std::map<intern_string_t, compiled_cond_expr> e_cond_exprs;
|
||||
};
|
||||
|
||||
static expressions exprs;
|
||||
|
||||
std::vector<intern_string_t>
|
||||
applicable(vis_line_t vl)
|
||||
{
|
||||
std::vector<intern_string_t> retval;
|
||||
auto& lss = lnav_data.ld_log_source;
|
||||
auto cl = lss.at(vl);
|
||||
auto ld = lss.find_data(cl);
|
||||
log_data_helper ldh(lss);
|
||||
|
||||
ldh.parse_line(vl, true);
|
||||
for (auto& expr : exprs.e_cond_exprs) {
|
||||
if (!expr.second.cce_enabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto eval_res
|
||||
= lss.eval_sql_filter(expr.second.cce_stmt.in(), ld, ldh.ldh_line);
|
||||
|
||||
if (eval_res.isErr()) {
|
||||
log_error("eval failed: %s",
|
||||
eval_res.unwrapErr().to_attr_line().get_string().c_str());
|
||||
expr.second.cce_enabled = false;
|
||||
} else {
|
||||
if (eval_res.unwrap()) {
|
||||
retval.emplace_back(expr.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
Result<void, lnav::console::user_message>
|
||||
apply(vis_line_t vl, std::vector<intern_string_t> annos)
|
||||
{
|
||||
const auto& cfg = injector::get<const config&>();
|
||||
auto& lss = lnav_data.ld_log_source;
|
||||
auto cl = lss.at(vl);
|
||||
auto ld = lss.find_data(cl);
|
||||
auto lf = (*ld)->get_file();
|
||||
logmsg_annotations la;
|
||||
log_data_helper ldh(lss);
|
||||
|
||||
if (!ldh.parse_line(vl, true)) {
|
||||
log_error("failed to parse line %d", vl);
|
||||
return Err(lnav::console::user_message::error("Failed to parse line"));
|
||||
}
|
||||
auto line_number = content_line_t{ldh.ldh_line_index - ldh.ldh_y_offset};
|
||||
lss.set_user_mark(&textview_curses::BM_META,
|
||||
content_line_t{ldh.ldh_source_line - ldh.ldh_y_offset});
|
||||
|
||||
yajlpp_gen gen;
|
||||
|
||||
{
|
||||
auto bm_opt = lss.find_bookmark_metadata(vl);
|
||||
yajlpp_map root(gen);
|
||||
|
||||
root.gen("log_line");
|
||||
root.gen((int64_t) vl);
|
||||
root.gen("log_tags");
|
||||
{
|
||||
yajlpp_array tag_array(gen);
|
||||
|
||||
if (bm_opt) {
|
||||
const auto& bm = *(bm_opt.value());
|
||||
|
||||
for (const auto& tag : bm.bm_tags) {
|
||||
tag_array.gen(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
root.gen("log_path");
|
||||
root.gen(lf->get_filename());
|
||||
root.gen("log_format");
|
||||
root.gen(lf->get_format_name());
|
||||
root.gen("log_format_regex");
|
||||
root.gen(lf->get_format()->get_pattern_name(line_number));
|
||||
root.gen("log_msg");
|
||||
root.gen(ldh.ldh_line_values.lvv_sbr.to_string_fragment());
|
||||
for (const auto& val : ldh.ldh_line_values.lvv_values) {
|
||||
root.gen(val.lv_meta.lvm_name);
|
||||
switch (val.lv_meta.lvm_kind) {
|
||||
case value_kind_t::VALUE_NULL:
|
||||
root.gen();
|
||||
break;
|
||||
case value_kind_t::VALUE_INTEGER:
|
||||
root.gen(val.lv_value.i);
|
||||
break;
|
||||
case value_kind_t::VALUE_FLOAT:
|
||||
root.gen(val.lv_value.d);
|
||||
break;
|
||||
case value_kind_t::VALUE_BOOLEAN:
|
||||
root.gen(val.lv_value.i ? true : false);
|
||||
break;
|
||||
default:
|
||||
root.gen(val.to_string());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& anno : annos) {
|
||||
auto iter = cfg.a_definitions.find(anno);
|
||||
if (iter == cfg.a_definitions.end()) {
|
||||
log_error("unknown annotation: %s", anno.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
la.la_pairs[anno.to_string()] = "Loading...";
|
||||
auto child_fds_res = auto_pipe::for_child_fds(
|
||||
STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO);
|
||||
if (child_fds_res.isErr()) {
|
||||
auto um
|
||||
= lnav::console::user_message::error("unable to create pipes")
|
||||
.with_reason(child_fds_res.unwrapErr());
|
||||
return Err(um);
|
||||
}
|
||||
|
||||
auto child_res = lnav::pid::from_fork();
|
||||
if (child_res.isErr()) {
|
||||
auto um
|
||||
= lnav::console::user_message::error("unable to fork() child")
|
||||
.with_reason(child_res.unwrapErr());
|
||||
return Err(um);
|
||||
}
|
||||
|
||||
auto child_fds = child_fds_res.unwrap();
|
||||
|
||||
auto child = child_res.unwrap();
|
||||
for (auto& child_fd : child_fds) {
|
||||
child_fd.after_fork(child.in());
|
||||
}
|
||||
if (child.in_child()) {
|
||||
const char* exec_args[] = {
|
||||
getenv_opt("SHELL").value_or("bash"),
|
||||
"-c",
|
||||
iter->second.a_handler.pp_value.c_str(),
|
||||
nullptr,
|
||||
};
|
||||
|
||||
std::vector<ghc::filesystem::path> path_v;
|
||||
|
||||
auto src_path
|
||||
= ghc::filesystem::path(
|
||||
iter->second.a_handler.pp_location.sl_source.to_string())
|
||||
.parent_path();
|
||||
path_v.push_back(src_path);
|
||||
path_v.push_back(lnav::paths::dotlnav() / "formats/default");
|
||||
auto path_var = lnav::filesystem::build_path(path_v);
|
||||
|
||||
log_debug("annotate PATH: %s", path_var.c_str());
|
||||
setenv("PATH", path_var.c_str(), 1);
|
||||
execvp(exec_args[0], (char**) exec_args);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
auto out_reader = std::async(
|
||||
std::launch::async,
|
||||
[out_fd = std::move(child_fds[1].read_end())]() mutable {
|
||||
std::string retval;
|
||||
file_range last_range;
|
||||
line_buffer lb;
|
||||
|
||||
lb.set_fd(out_fd);
|
||||
while (true) {
|
||||
auto load_res = lb.load_next_line(last_range);
|
||||
if (load_res.isErr()) {
|
||||
log_error("unable to load next line: %s",
|
||||
load_res.unwrapErr().c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
auto li = load_res.unwrap();
|
||||
if (li.li_file_range.empty()) {
|
||||
break;
|
||||
}
|
||||
auto read_res = lb.read_range(li.li_file_range);
|
||||
if (read_res.isErr()) {
|
||||
log_error("unable to read next line: %s",
|
||||
load_res.unwrapErr().c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
auto sbr = read_res.unwrap();
|
||||
retval.append(sbr.get_data(), sbr.length());
|
||||
|
||||
last_range = li.li_file_range;
|
||||
}
|
||||
|
||||
return retval;
|
||||
});
|
||||
|
||||
auto err_reader = std::async(
|
||||
std::launch::async,
|
||||
[err_fd = std::move(child_fds[2].read_end()),
|
||||
handler = iter->second.a_handler.pp_value]() mutable {
|
||||
std::string retval;
|
||||
file_range last_range;
|
||||
line_buffer lb;
|
||||
|
||||
lb.set_fd(err_fd);
|
||||
while (true) {
|
||||
auto load_res = lb.load_next_line(last_range);
|
||||
if (load_res.isErr()) {
|
||||
log_error("unable to load next line: %s",
|
||||
load_res.unwrapErr().c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
auto li = load_res.unwrap();
|
||||
if (li.li_file_range.empty()) {
|
||||
break;
|
||||
}
|
||||
auto read_res = lb.read_range(li.li_file_range);
|
||||
if (read_res.isErr()) {
|
||||
log_error("unable to read next line: %s",
|
||||
load_res.unwrapErr().c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
auto sbr = read_res.unwrap();
|
||||
retval.append(sbr.get_data(), sbr.length());
|
||||
sbr.rtrim(is_line_ending);
|
||||
log_debug("%s: %.*s",
|
||||
handler.c_str(),
|
||||
sbr.length(),
|
||||
sbr.get_data());
|
||||
|
||||
last_range = li.li_file_range;
|
||||
}
|
||||
|
||||
return retval;
|
||||
});
|
||||
|
||||
auto write_res
|
||||
= child_fds[0].write_end().write_fully(gen.to_string_fragment());
|
||||
if (write_res.isErr()) {
|
||||
log_error("bah %s", write_res.unwrapErr().c_str());
|
||||
}
|
||||
child_fds[0].write_end().reset();
|
||||
auto finalizer = [anno,
|
||||
out_reader1 = out_reader.share(),
|
||||
err_reader1 = err_reader.share(),
|
||||
lf,
|
||||
line_number,
|
||||
handler = iter->second.a_handler.pp_value](
|
||||
auto& fc,
|
||||
auto_pid<process_state::finished>& child) mutable {
|
||||
auto& line_anno
|
||||
= lf->get_bookmark_metadata()[line_number].bm_annotations;
|
||||
auto content = out_reader1.get();
|
||||
if (!child.was_normal_exit()) {
|
||||
content.append(fmt::format(
|
||||
FMT_STRING(
|
||||
"\n\n\u2718 annotation handler \u201c{}\u201d failed "
|
||||
"with signal {}:\n\n<pre>\n{}\n</pre>\n"),
|
||||
handler,
|
||||
child.term_signal(),
|
||||
err_reader1.get()));
|
||||
} else if (child.exit_status() != 0) {
|
||||
content.append(fmt::format(
|
||||
FMT_STRING(
|
||||
"\n\n<span "
|
||||
"class=\"-lnav_log-level-styles_error\">"
|
||||
"\u2718 annotation handler \u201c{}\u201d exited "
|
||||
"with status {}:</span>\n\n<pre>{}</pre>"),
|
||||
handler,
|
||||
child.exit_status(),
|
||||
md4cpp::escape_html(err_reader1.get())));
|
||||
}
|
||||
line_anno.la_pairs[anno.to_string()] = content;
|
||||
lnav_data.ld_views[LNV_LOG].reload_data();
|
||||
lnav_data.ld_views[LNV_LOG].set_needs_update();
|
||||
};
|
||||
|
||||
lnav_data.ld_child_pollers.emplace_back(child_poller{
|
||||
(*ld)->get_file_ptr()->get_filename(),
|
||||
std::move(child),
|
||||
std::move(finalizer),
|
||||
});
|
||||
}
|
||||
lf->get_bookmark_metadata()[line_number].bm_annotations = la;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
} // namespace annotate
|
||||
} // namespace log
|
||||
} // namespace lnav
|
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Copyright (c) 2023, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lnav_log_annotate_cfg_hh
|
||||
#define lnav_log_annotate_cfg_hh
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "base/intern_string.hh"
|
||||
#include "yajlpp/yajlpp.hh"
|
||||
|
||||
namespace lnav {
|
||||
namespace log {
|
||||
namespace annotate {
|
||||
|
||||
struct annotation_def {
|
||||
std::string a_description;
|
||||
std::string a_condition;
|
||||
positioned_property<std::string> a_handler;
|
||||
};
|
||||
|
||||
struct config {
|
||||
std::map<intern_string_t, annotation_def> a_definitions;
|
||||
};
|
||||
|
||||
} // namespace annotate
|
||||
} // namespace log
|
||||
} // namespace lnav
|
||||
|
||||
#endif
|
@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Copyright (c) 2023, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lnav_log_annotate_hh
|
||||
#define lnav_log_annotate_hh
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/lnav.console.hh"
|
||||
#include "base/result.h"
|
||||
#include "log.annotate.cfg.hh"
|
||||
#include "vis_line.hh"
|
||||
|
||||
namespace lnav {
|
||||
namespace log {
|
||||
namespace annotate {
|
||||
|
||||
std::vector<intern_string_t> applicable(vis_line_t vl);
|
||||
|
||||
Result<void, lnav::console::user_message> apply(
|
||||
vis_line_t vl, std::vector<intern_string_t> annos);
|
||||
|
||||
} // namespace annotate
|
||||
} // namespace log
|
||||
} // namespace lnav
|
||||
|
||||
#endif
|
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import html
|
||||
import time
|
||||
import json
|
||||
import urllib.request
|
||||
|
||||
sys.stderr.write("reading stdin\n")
|
||||
inj = json.load(sys.stdin)
|
||||
sys.stderr.write("reading stdin done\n")
|
||||
|
||||
if False:
|
||||
print("Hello, World!")
|
||||
sys.exit()
|
||||
|
||||
RESOLVING_SERVICE_URL = "http://btresolver.eng.vmware.com:80/"
|
||||
DEFAULT_TIMEOUT = 10
|
||||
|
||||
req_url = "%s%s" % (RESOLVING_SERVICE_URL, "async_resolve_text_bts")
|
||||
log_msg = inj['log_msg']
|
||||
index = log_msg.find('[context]')
|
||||
if index != -1:
|
||||
log_msg = log_msg[index:]
|
||||
body = json.dumps([log_msg])
|
||||
req = urllib.request.Request(req_url, body.encode('utf-8'))
|
||||
resp = urllib.request.urlopen(req, timeout=DEFAULT_TIMEOUT)
|
||||
resolve_content = json.loads(resp.read())
|
||||
|
||||
sys.stderr.write("resolve %s\n" % resolve_content)
|
||||
if not resolve_content['success']:
|
||||
print(resolve_content['errorString'])
|
||||
sys.exit(1)
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
delay = 1
|
||||
|
||||
done = False
|
||||
while not done:
|
||||
get_url = "%s%s" % (RESOLVING_SERVICE_URL, "get_task")
|
||||
body = resolve_content['returnValue']['TaskIds'][0]
|
||||
get_req = urllib.request.Request(get_url, body.encode('utf-8'))
|
||||
get_resp = urllib.request.urlopen(get_req, timeout=DEFAULT_TIMEOUT)
|
||||
get_content = json.loads(get_resp.read())
|
||||
sys.stderr.write("get %s\n" % get_content)
|
||||
if get_content['returnValue']['state'] == 'RUNNING':
|
||||
if get_content['returnValue']['exception'] is None:
|
||||
time.sleep(delay)
|
||||
if delay < 10:
|
||||
delay = delay * 2
|
||||
else:
|
||||
print("<pre>\n%s</pre>" % html.escape(get_content['returnValue']['exception']))
|
||||
done = True
|
||||
elif get_content['returnValue']['state'] == 'COMPLETED':
|
||||
print("<pre>\n%s</pre>" % html.escape(get_content['returnValue']['output']))
|
||||
done = True
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://lnav.org/schemas/config-v1.schema.json",
|
||||
"log": {
|
||||
"annotations": {
|
||||
"org.lnav.test.no-handler": {
|
||||
"description": "annotation without a handler"
|
||||
},
|
||||
"org.lnav.test.no-condition": {
|
||||
"description": "annotation without a condition",
|
||||
"handler": "my-handler"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://lnav.org/schemas/config-v1.schema.json",
|
||||
"log": {
|
||||
"annotations": {
|
||||
"org.lnav.test": {
|
||||
"description": "test annotation",
|
||||
"condition": ":c_ip IS NOT NULL AND $TEST_ANNO = '1'",
|
||||
"handler": "anno-test.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo 'Hello, <span style="color: #f00">World</span>!'
|
@ -1,3 +1,3 @@
|
||||
{"log_line":0,"log_part":null,"log_time":"2009-07-20 22:59:26.000","log_idle_msecs":0,"log_level":"info","log_mark":0,"log_comment":null,"log_tags":null,"log_filters":null,"c_ip":"192.168.202.254","cs_method":"GET","cs_referer":"-","cs_uri_query":null,"cs_uri_stem":"/vmw/cgi/tramp","cs_user_agent":"gPXE/0.9.7","cs_username":"-","cs_version":"HTTP/1.0","sc_bytes":134,"sc_status":200,"cs_host":null}
|
||||
{"log_line":1,"log_part":null,"log_time":"2009-07-20 22:59:29.000","log_idle_msecs":3000,"log_level":"error","log_mark":0,"log_comment":null,"log_tags":null,"log_filters":null,"c_ip":"192.168.202.254","cs_method":"GET","cs_referer":"-","cs_uri_query":null,"cs_uri_stem":"/vmw/vSphere/default/vmkboot.gz","cs_user_agent":"gPXE/0.9.7","cs_username":"-","cs_version":"HTTP/1.0","sc_bytes":46210,"sc_status":404,"cs_host":null}
|
||||
{"log_line":2,"log_part":null,"log_time":"2009-07-20 22:59:29.000","log_idle_msecs":0,"log_level":"info","log_mark":0,"log_comment":null,"log_tags":null,"log_filters":null,"c_ip":"192.168.202.254","cs_method":"GET","cs_referer":"-","cs_uri_query":null,"cs_uri_stem":"/vmw/vSphere/default/vmkernel.gz","cs_user_agent":"gPXE/0.9.7","cs_username":"-","cs_version":"HTTP/1.0","sc_bytes":78929,"sc_status":200,"cs_host":null}
|
||||
{"log_line":0,"log_part":null,"log_time":"2009-07-20 22:59:26.000","log_idle_msecs":0,"log_level":"info","log_mark":0,"log_comment":null,"log_tags":null,"log_annotations":null,"log_filters":null,"c_ip":"192.168.202.254","cs_method":"GET","cs_referer":"-","cs_uri_query":null,"cs_uri_stem":"/vmw/cgi/tramp","cs_user_agent":"gPXE/0.9.7","cs_username":"-","cs_version":"HTTP/1.0","sc_bytes":134,"sc_status":200,"cs_host":null}
|
||||
{"log_line":1,"log_part":null,"log_time":"2009-07-20 22:59:29.000","log_idle_msecs":3000,"log_level":"error","log_mark":0,"log_comment":null,"log_tags":null,"log_annotations":null,"log_filters":null,"c_ip":"192.168.202.254","cs_method":"GET","cs_referer":"-","cs_uri_query":null,"cs_uri_stem":"/vmw/vSphere/default/vmkboot.gz","cs_user_agent":"gPXE/0.9.7","cs_username":"-","cs_version":"HTTP/1.0","sc_bytes":46210,"sc_status":404,"cs_host":null}
|
||||
{"log_line":2,"log_part":null,"log_time":"2009-07-20 22:59:29.000","log_idle_msecs":0,"log_level":"info","log_mark":0,"log_comment":null,"log_tags":null,"log_annotations":null,"log_filters":null,"c_ip":"192.168.202.254","cs_method":"GET","cs_referer":"-","cs_uri_query":null,"cs_uri_stem":"/vmw/vSphere/default/vmkernel.gz","cs_user_agent":"gPXE/0.9.7","cs_username":"-","cs_version":"HTTP/1.0","sc_bytes":78929,"sc_status":200,"cs_host":null}
|
||||
|
@ -1,9 +1,9 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters
|
||||
0,<NULL>,2016-06-30 12:00:01.000,0,trace,0,<NULL>,<NULL>,<NULL>
|
||||
1,<NULL>,2016-06-30 12:00:02.000,1000,debug,0,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2016-06-30 12:00:03.000,1000,debug2,0,<NULL>,<NULL>,<NULL>
|
||||
3,<NULL>,2016-06-30 12:00:04.000,1000,debug3,0,<NULL>,<NULL>,<NULL>
|
||||
4,<NULL>,2016-06-30 12:00:05.000,1000,info,0,<NULL>,<NULL>,<NULL>
|
||||
5,<NULL>,2016-06-30 12:00:06.000,1000,warning,0,<NULL>,<NULL>,<NULL>
|
||||
6,<NULL>,2016-06-30 12:00:07.000,1000,fatal,0,<NULL>,<NULL>,<NULL>
|
||||
7,<NULL>,2016-06-30 12:00:08.000,1000,info,0,<NULL>,<NULL>,<NULL>
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters
|
||||
0,<NULL>,2016-06-30 12:00:01.000,0,trace,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
1,<NULL>,2016-06-30 12:00:02.000,1000,debug,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2016-06-30 12:00:03.000,1000,debug2,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
3,<NULL>,2016-06-30 12:00:04.000,1000,debug3,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
4,<NULL>,2016-06-30 12:00:05.000,1000,info,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
5,<NULL>,2016-06-30 12:00:06.000,1000,warning,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
6,<NULL>,2016-06-30 12:00:07.000,1000,fatal,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
7,<NULL>,2016-06-30 12:00:08.000,1000,info,0,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
|
@ -1,14 +1,14 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,@fields/user,@fields/trace#
|
||||
0,<NULL>,2013-09-06 20:00:48.124,0,trace,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2013-09-06 20:00:49.124,1000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
4,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,<NULL>,steve@example.com,<NULL>
|
||||
7,<NULL>,2013-09-06 22:00:59.124,10000,debug5,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
9,<NULL>,2013-09-06 22:00:59.124,0,debug4,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
11,<NULL>,2013-09-06 22:00:59.124,0,debug3,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
13,<NULL>,2013-09-06 22:00:59.124,0,debug2,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
15,<NULL>,2013-09-06 22:00:59.124,0,debug,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
17,<NULL>,2013-09-06 22:01:49.124,50000,stats,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
19,<NULL>,2013-09-06 22:01:49.124,0,warning,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
21,<NULL>,2013-09-06 22:01:49.124,0,error,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
23,<NULL>,2013-09-06 22:01:49.124,0,critical,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
25,<NULL>,2013-09-06 22:01:49.124,0,fatal,0,<NULL>,<NULL>,<NULL>,<NULL>,line:1
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters,@fields/user,@fields/trace#
|
||||
0,<NULL>,2013-09-06 20:00:48.124,0,trace,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2013-09-06 20:00:49.124,1000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
4,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,steve@example.com,<NULL>
|
||||
7,<NULL>,2013-09-06 22:00:59.124,10000,debug5,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
9,<NULL>,2013-09-06 22:00:59.124,0,debug4,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
11,<NULL>,2013-09-06 22:00:59.124,0,debug3,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
13,<NULL>,2013-09-06 22:00:59.124,0,debug2,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
15,<NULL>,2013-09-06 22:00:59.124,0,debug,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
17,<NULL>,2013-09-06 22:01:49.124,50000,stats,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
19,<NULL>,2013-09-06 22:01:49.124,0,warning,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
21,<NULL>,2013-09-06 22:01:49.124,0,error,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
23,<NULL>,2013-09-06 22:01:49.124,0,critical,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
|
||||
25,<NULL>,2013-09-06 22:01:49.124,0,fatal,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,line:1
|
||||
|
@ -1,4 +1,4 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,user,cl
|
||||
0,<NULL>,2013-09-06 20:00:49.124,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,com.exmaple.foo
|
||||
1,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,<NULL>,steve@example.com,com.exmaple.foo
|
||||
3,<NULL>,2013-09-06 22:01:49.124,60000,error,0,<NULL>,<NULL>,<NULL>,<NULL>,com.exmaple.foo
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters,user,cl
|
||||
0,<NULL>,2013-09-06 20:00:49.124,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,com.exmaple.foo
|
||||
1,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,steve@example.com,com.exmaple.foo
|
||||
3,<NULL>,2013-09-06 22:01:49.124,60000,error,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,com.exmaple.foo
|
||||
|
@ -1,14 +1,14 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,arr,obj,lvl,user
|
||||
0,<NULL>,2013-09-06 20:00:48.124,0,trace,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,TRACE,<NULL>
|
||||
2,<NULL>,2013-09-06 20:00:49.124,1000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,INFO,<NULL>
|
||||
4,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,INFO,steve@example.com
|
||||
7,<NULL>,2013-09-06 22:00:59.124,10000,debug5,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG5,<NULL>
|
||||
9,<NULL>,2013-09-06 22:00:59.124,0,debug4,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG4,<NULL>
|
||||
11,<NULL>,2013-09-06 22:00:59.124,0,debug3,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG3,<NULL>
|
||||
13,<NULL>,2013-09-06 22:00:59.124,0,debug2,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG2,<NULL>
|
||||
15,<NULL>,2013-09-06 22:00:59.124,0,debug,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG,<NULL>
|
||||
17,<NULL>,2013-09-06 22:01:49.124,50000,stats,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,STATS,<NULL>
|
||||
19,<NULL>,2013-09-06 22:01:49.124,0,warning,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,WARNING,<NULL>
|
||||
21,<NULL>,2013-09-06 22:01:49.124,0,error,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,ERROR,<NULL>
|
||||
23,<NULL>,2013-09-06 22:01:49.124,0,critical,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,CRITICAL,<NULL>
|
||||
25,<NULL>,2013-09-06 22:01:49.124,0,fatal,0,<NULL>,<NULL>,<NULL>,"[""hi"", {""sub1"": true}]","{ ""field1"" : ""hi"", ""field2"": 2 }",FATAL,<NULL>
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters,arr,obj,lvl,user
|
||||
0,<NULL>,2013-09-06 20:00:48.124,0,trace,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,TRACE,<NULL>
|
||||
2,<NULL>,2013-09-06 20:00:49.124,1000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,INFO,<NULL>
|
||||
4,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,INFO,steve@example.com
|
||||
7,<NULL>,2013-09-06 22:00:59.124,10000,debug5,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG5,<NULL>
|
||||
9,<NULL>,2013-09-06 22:00:59.124,0,debug4,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG4,<NULL>
|
||||
11,<NULL>,2013-09-06 22:00:59.124,0,debug3,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG3,<NULL>
|
||||
13,<NULL>,2013-09-06 22:00:59.124,0,debug2,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG2,<NULL>
|
||||
15,<NULL>,2013-09-06 22:00:59.124,0,debug,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,DEBUG,<NULL>
|
||||
17,<NULL>,2013-09-06 22:01:49.124,50000,stats,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,STATS,<NULL>
|
||||
19,<NULL>,2013-09-06 22:01:49.124,0,warning,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,WARNING,<NULL>
|
||||
21,<NULL>,2013-09-06 22:01:49.124,0,error,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,ERROR,<NULL>
|
||||
23,<NULL>,2013-09-06 22:01:49.124,0,critical,0,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,CRITICAL,<NULL>
|
||||
25,<NULL>,2013-09-06 22:01:49.124,0,fatal,0,<NULL>,<NULL>,<NULL>,<NULL>,"[""hi"", {""sub1"": true}]","{ ""field1"" : ""hi"", ""field2"": 2 }",FATAL,<NULL>
|
||||
|
@ -1,4 +1,4 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,client_ip,request/method,request/uri,request/size,response/status,response/size,details1,details2,details3
|
||||
0,<NULL>,2017-03-24 20:06:26.240,0,info,0,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,200,443,<NULL>,<NULL>,<NULL>
|
||||
1,<NULL>,2017-03-24 20:12:47.764,381524,critical,0,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,500,4433,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2017-03-24 20:15:31.694,163930,warning,0,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,400,44345,"{""foo"": ""bar""}","{""foo"": ""bar""}","{""foo"": ""bar""}"
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters,client_ip,request/method,request/uri,request/size,response/status,response/size,details1,details2,details3
|
||||
0,<NULL>,2017-03-24 20:06:26.240,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,200,443,<NULL>,<NULL>,<NULL>
|
||||
1,<NULL>,2017-03-24 20:12:47.764,381524,critical,0,<NULL>,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,500,4433,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2017-03-24 20:15:31.694,163930,warning,0,<NULL>,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,400,44345,"{""foo"": ""bar""}","{""foo"": ""bar""}","{""foo"": ""bar""}"
|
||||
|
@ -1,4 +1,4 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,client_ip,request/method,request/uri,request/size,response/status,response/size,details1,details2,details3
|
||||
0,<NULL>,2017-03-24 16:06:26.240,0,info,0,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,200,443,<NULL>,<NULL>,<NULL>
|
||||
1,<NULL>,2017-03-24 16:12:47.764,381524,critical,0,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,500,4433,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2017-03-24 16:15:31.694,163930,warning,0,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,400,44345,"{""foo"": ""bar""}","{""foo"": ""bar""}","{""foo"": ""bar""}"
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters,client_ip,request/method,request/uri,request/size,response/status,response/size,details1,details2,details3
|
||||
0,<NULL>,2017-03-24 16:06:26.240,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,200,443,<NULL>,<NULL>,<NULL>
|
||||
1,<NULL>,2017-03-24 16:12:47.764,381524,critical,0,<NULL>,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,500,4433,<NULL>,<NULL>,<NULL>
|
||||
2,<NULL>,2017-03-24 16:15:31.694,163930,warning,0,<NULL>,<NULL>,<NULL>,<NULL>,1.1.1.1,GET,/example/uri/5,166,400,44345,"{""foo"": ""bar""}","{""foo"": ""bar""}","{""foo"": ""bar""}"
|
||||
|
@ -1,3 +1,3 @@
|
||||
log_line log_part log_time log_idle_msecs log_level log_mark log_comment log_tags log_filters col_0 col_1
|
||||
0 <NULL> 2021-05-19 08:00:01.000 0 info 0 <NULL> <NULL> <NULL> 1 /abc/def
|
||||
2 <NULL> 2021-05-19 08:00:03.000 2000 info 0 <NULL> <NULL> <NULL> 3 /ghi/jkl
|
||||
log_line log_part log_time log_idle_msecs log_level log_mark log_comment log_tags log_annotations log_filters col_0 col_1
|
||||
0 <NULL> 2021-05-19 08:00:01.000 0 info 0 <NULL> <NULL> <NULL> <NULL> 1 /abc/def
|
||||
2 <NULL> 2021-05-19 08:00:03.000 2000 info 0 <NULL> <NULL> <NULL> <NULL> 3 /ghi/jkl
|
||||
|
@ -1,2 +1,2 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,log_hostname,log_msgid,log_pid,log_pri,log_procname,log_struct,log_syslog_tag,syslog_version,col_0,TTY,PWD,USER,COMMAND
|
||||
0,<NULL>,2007-11-03 09:47:02.000,0,info,0,<NULL>,<NULL>,[1],veridian,<NULL>,<NULL>,<NULL>,sudo,<NULL>,sudo,<NULL>,timstack,pts/6,/auto/wstimstack/rpms/lbuild/test,root,/usr/bin/tail /var/log/messages
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters,log_hostname,log_msgid,log_pid,log_pri,log_procname,log_struct,log_syslog_tag,syslog_version,col_0,TTY,PWD,USER,COMMAND
|
||||
0,<NULL>,2007-11-03 09:47:02.000,0,info,0,<NULL>,<NULL>,<NULL>,[1],veridian,<NULL>,<NULL>,<NULL>,sudo,<NULL>,sudo,<NULL>,timstack,pts/6,/auto/wstimstack/rpms/lbuild/test,root,/usr/bin/tail /var/log/messages
|
||||
|
@ -0,0 +1,2 @@
|
||||
shell_exec('echo hi')
|
||||
hi␊
|
@ -1,27 +1,27 @@
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,log_hostname,log_msgid,log_pid,log_pri,log_procname,log_struct,log_syslog_tag,syslog_version,match_index,content
|
||||
2,<NULL>,2022-08-16 00:32:15.000,199000,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.cdscheduler""}"
|
||||
2,<NULL>,2022-08-16 00:32:15.000,199000,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" claims selected messages.\n\tThose messages may not appear in standard system log files or in the ASL database.""}"
|
||||
5,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.install""}"
|
||||
5,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" claims selected messages.\n\tThose messages may not appear in standard system log files or in the ASL database.""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.authd""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" sharing output destination ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,2,"{""value"":""/var/log/asl""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,3,"{""value"":"" with ASL Module ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,4,"{""value"":""com.apple.asl""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,5,"{""value"":"".\n\tOutput parameters from ASL Module ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,6,"{""value"":""com.apple.asl""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,7,"{""value"":"" override any specified in ASL Module ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,8,"{""value"":""com.apple.authd""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,9,"{""value"":"".""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.authd""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" sharing output destination ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,2,"{""value"":""/var/log/system.log""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,3,"{""value"":"" with ASL Module ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,4,"{""value"":""com.apple.asl""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,5,"{""value"":"".\n\tOutput parameters from ASL Module ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,6,"{""value"":""com.apple.asl""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,7,"{""value"":"" override any specified in ASL Module ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,8,"{""value"":""com.apple.authd""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,9,"{""value"":"".""}"
|
||||
14,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.authd""}"
|
||||
14,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" claims selected messages.\n\tThose messages may not appear in standard system log files or in the ASL database.""}"
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_annotations,log_filters,log_hostname,log_msgid,log_pid,log_pri,log_procname,log_struct,log_syslog_tag,syslog_version,match_index,content
|
||||
2,<NULL>,2022-08-16 00:32:15.000,199000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.cdscheduler""}"
|
||||
2,<NULL>,2022-08-16 00:32:15.000,199000,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" claims selected messages.\n\tThose messages may not appear in standard system log files or in the ASL database.""}"
|
||||
5,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.install""}"
|
||||
5,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" claims selected messages.\n\tThose messages may not appear in standard system log files or in the ASL database.""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.authd""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" sharing output destination ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,2,"{""value"":""/var/log/asl""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,3,"{""value"":"" with ASL Module ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,4,"{""value"":""com.apple.asl""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,5,"{""value"":"".\n\tOutput parameters from ASL Module ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,6,"{""value"":""com.apple.asl""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,7,"{""value"":"" override any specified in ASL Module ""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,8,"{""value"":""com.apple.authd""}"
|
||||
8,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,9,"{""value"":"".""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.authd""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" sharing output destination ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,2,"{""value"":""/var/log/system.log""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,3,"{""value"":"" with ASL Module ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,4,"{""value"":""com.apple.asl""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,5,"{""value"":"".\n\tOutput parameters from ASL Module ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,6,"{""value"":""com.apple.asl""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,7,"{""value"":"" override any specified in ASL Module ""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,8,"{""value"":""com.apple.authd""}"
|
||||
11,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,9,"{""value"":"".""}"
|
||||
14,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,0,"{""value"":""com.apple.authd""}"
|
||||
14,<NULL>,2022-08-16 00:32:15.000,0,info,0,<NULL>,<NULL>,<NULL>,<NULL>,Tims-Air,<NULL>,314,<NULL>,syslogd,<NULL>,syslogd[314],<NULL>,1,"{""value"":"" claims selected messages.\n\tThose messages may not appear in standard system log files or in the ASL database.""}"
|
||||
|
Loading…
Reference in New Issue