mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 19:41:44 +00:00
add 'service' parameter to syslog api call
so that we can filter the journal by service Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4178b82ab5
commit
341422727c
@ -565,6 +565,12 @@ __PACKAGE__->register_method({
|
|||||||
description => "Display all log until this date-time string.",
|
description => "Display all log until this date-time string.",
|
||||||
optional => 1,
|
optional => 1,
|
||||||
},
|
},
|
||||||
|
service => {
|
||||||
|
description => "Service ID",
|
||||||
|
type => 'string',
|
||||||
|
maxLength => 128,
|
||||||
|
optional => 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
returns => {
|
returns => {
|
||||||
@ -589,9 +595,18 @@ __PACKAGE__->register_method({
|
|||||||
my $rpcenv = PVE::RPCEnvironment::get();
|
my $rpcenv = PVE::RPCEnvironment::get();
|
||||||
my $user = $rpcenv->get_user();
|
my $user = $rpcenv->get_user();
|
||||||
my $node = $param->{node};
|
my $node = $param->{node};
|
||||||
|
my $service;
|
||||||
|
|
||||||
|
if ($param->{service}) {
|
||||||
|
my $service_aliases = {
|
||||||
|
'postfix' => 'postfix@-',
|
||||||
|
};
|
||||||
|
|
||||||
|
$service = $service_aliases->{$param->{service}} // $param->{service};
|
||||||
|
}
|
||||||
|
|
||||||
my ($count, $lines) = PVE::Tools::dump_journal($param->{start}, $param->{limit},
|
my ($count, $lines) = PVE::Tools::dump_journal($param->{start}, $param->{limit},
|
||||||
$param->{since}, $param->{until});
|
$param->{since}, $param->{until}, $service);
|
||||||
|
|
||||||
$rpcenv->set_result_attrib('total', $count);
|
$rpcenv->set_result_attrib('total', $count);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user