systemd-journal-remote use case update
This commit is contained in:
parent
2162092977
commit
91877b0570
3 changed files with 15 additions and 6 deletions
|
|
@ -117,6 +117,8 @@
|
||||||
cmd.push("--cursor=" + options.cursor);
|
cmd.push("--cursor=" + options.cursor);
|
||||||
if (options.after)
|
if (options.after)
|
||||||
cmd.push("--after=" + options.after);
|
cmd.push("--after=" + options.after);
|
||||||
|
if (options.merge)
|
||||||
|
cmd.push("-m");
|
||||||
|
|
||||||
/* journalctl doesn't allow reverse and follow together */
|
/* journalctl doesn't allow reverse and follow together */
|
||||||
if (options.reverse)
|
if (options.reverse)
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ let PacketBuffer = class {
|
||||||
/* The journalctl reading the recording */
|
/* The journalctl reading the recording */
|
||||||
this.journalctl = Journal.journalctl(
|
this.journalctl = Journal.journalctl(
|
||||||
this.matchList,
|
this.matchList,
|
||||||
{count: "all", follow: false});
|
{count: "all", follow: false, merge: true});
|
||||||
this.journalctl.fail(this.handleError);
|
this.journalctl.fail(this.handleError);
|
||||||
this.journalctl.stream(this.handleStream);
|
this.journalctl.stream(this.handleStream);
|
||||||
this.journalctl.done(this.handleDone);
|
this.journalctl.done(this.handleDone);
|
||||||
|
|
@ -454,7 +454,7 @@ let PacketBuffer = class {
|
||||||
this.journalctl = Journal.journalctl(
|
this.journalctl = Journal.journalctl(
|
||||||
this.matchList,
|
this.matchList,
|
||||||
{cursor: this.cursor,
|
{cursor: this.cursor,
|
||||||
follow: true, count: "all"});
|
follow: true, merge: true, count: "all"});
|
||||||
this.journalctl.fail(this.handleError);
|
this.journalctl.fail(this.handleError);
|
||||||
this.journalctl.stream(this.handleStream);
|
this.journalctl.stream(this.handleStream);
|
||||||
/* NOTE: no "done" handler on purpose */
|
/* NOTE: no "done" handler on purpose */
|
||||||
|
|
|
||||||
|
|
@ -238,6 +238,7 @@ class Logs extends React.Component {
|
||||||
this.entries = [];
|
this.entries = [];
|
||||||
this.start = null;
|
this.start = null;
|
||||||
this.end = null;
|
this.end = null;
|
||||||
|
this.hostname = null;
|
||||||
this.earlier_than = null;
|
this.earlier_than = null;
|
||||||
this.state = {
|
this.state = {
|
||||||
cursor: null,
|
cursor: null,
|
||||||
|
|
@ -282,12 +283,16 @@ class Logs extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
let matches = [];
|
let matches = [];
|
||||||
|
if (this.hostname) {
|
||||||
|
matches.push("_HOSTNAME=" + this.hostname);
|
||||||
|
}
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
since: formatDateTime(this.start),
|
since: formatDateTime(this.start),
|
||||||
until: formatDateTime(this.end),
|
until: formatDateTime(this.end),
|
||||||
follow: false,
|
follow: false,
|
||||||
count: "all",
|
count: "all",
|
||||||
|
merge: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.state.after != null) {
|
if (this.state.after != null) {
|
||||||
|
|
@ -322,6 +327,9 @@ class Logs extends React.Component {
|
||||||
this.start = this.props.recording.start;
|
this.start = this.props.recording.start;
|
||||||
this.earlier_than = this.props.recording.start;
|
this.earlier_than = this.props.recording.start;
|
||||||
}
|
}
|
||||||
|
if (this.props.recording.hostname) {
|
||||||
|
this.hostname = this.props.recording.hostname;
|
||||||
|
}
|
||||||
this.getLogs();
|
this.getLogs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -682,8 +690,7 @@ class View extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
r = {id: id,
|
r = {id: id,
|
||||||
matchList: ["_UID=" + this.uid,
|
matchList: ["TLOG_REC=" + id],
|
||||||
"TLOG_REC=" + id],
|
|
||||||
user: e["TLOG_USER"],
|
user: e["TLOG_USER"],
|
||||||
boot_id: e["_BOOT_ID"],
|
boot_id: e["_BOOT_ID"],
|
||||||
session_id: parseInt(e["TLOG_SESSION"], 10),
|
session_id: parseInt(e["TLOG_SESSION"], 10),
|
||||||
|
|
@ -735,7 +742,7 @@ class View extends React.Component {
|
||||||
* Assumes journalctl is not running.
|
* Assumes journalctl is not running.
|
||||||
*/
|
*/
|
||||||
journalctlStart() {
|
journalctlStart() {
|
||||||
let matches = ["_UID=" + this.uid];
|
let matches = ["_UID=" + this.uid, "+", "_EXE=/usr/bin/tlog-rec-session", "+", "_EXE=/usr/bin/tlog-rec", "+", "SYSLOG_IDENTIFIER=\"-tlog-rec-session\""];
|
||||||
if (this.state.username && this.state.username !== "") {
|
if (this.state.username && this.state.username !== "") {
|
||||||
matches.push("TLOG_USER=" + this.state.username);
|
matches.push("TLOG_USER=" + this.state.username);
|
||||||
}
|
}
|
||||||
|
|
@ -743,7 +750,7 @@ class View extends React.Component {
|
||||||
matches.push("_HOSTNAME=" + this.state.hostname);
|
matches.push("_HOSTNAME=" + this.state.hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
let options = {follow: true, count: "all"};
|
let options = {follow: true, count: "all", merge: true};
|
||||||
|
|
||||||
if (this.state.date_since && this.state.date_since !== "") {
|
if (this.state.date_since && this.state.date_since !== "") {
|
||||||
options['since'] = this.state.date_since;
|
options['since'] = this.state.date_since;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue