Page MenuHomeVyOS Platform

Ability to get logs in machine readable format
Needs testing, NormalPublicFEATURE REQUEST

Description

Ability to get logs in a machine-readable format
For example:

sudo journalctl --output json

Options or some of them:
--all - All logs
--boot - all logs since boot
--last x - last x entries
--since - Show entries not older than the specified date
--unit - Show logs from the specified unit
--facility Show entries with the specified facilities
--utc Express time in Coordinated Universal Time (UTC)

Details

Difficulty level
Unknown (require assessment)
Version
1.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Improvement (missing useful functionality)

Related Objects

StatusSubtypeAssignedTask
OpenFEATURE REQUESTNone
Needs testingFEATURE REQUESTViacheslav

Event Timeline

Viacheslav updated the task description. (Show Details)
Viacheslav changed Version from - to 1.4.
Viacheslav changed the task status from Open to In progress.Nov 1 2022, 3:45 PM
Viacheslav claimed this task.
Viacheslav changed the task status from In progress to Needs testing.Nov 2 2022, 2:39 PM

Requires rewriting function show to python-systemd

def show():
    from systemd import journal
    output = journal.Reader()
    return [line for line in output]

Needs to think about how to use arguments with new implementation in systemd-python

root@r14:/home/vyos# /usr/libexec/vyos/op_mode/log.py show --help
usage: log.py show [-h] [--raw] [--boot] [--count COUNT] [--facility FACILITY] [--reverse] [--utc] [--unit UNIT]

optional arguments:
  -h, --help           show this help message and exit
  --raw
  --boot
  --count COUNT
  --facility FACILITY
  --reverse
  --utc
  --unit UNIT
root@r14:/home/vyos#