select source,
count(source) as log_count
from logs
group by source
order by log_count desc;
select count(*) from logs;
select
json_extract(logs.msg, '$.MESSAGE') as message,
timestamp,
source,
json_extract(logs.msg, '$.SYSLOG_TIMESTAMP') as ts,
json_extract(logs.msg, '$.SYSLOG_IDENTIFIER') as syslog_id
from logs
where json_valid(msg)
and syslog_id in ('sshd', 'sshd-session')
and message like '%Accepted publickey%'
order by timestamp desc;
OpenSSH 9.8 and later log logins as sshd-session, so the query matches both names. See checking SSH logs on Linux.
select id,
timestamp,
source,
json_extract(logs.msg, '$.MESSAGE') as a_msg,
json_extract(logs.msg, '$._CMDLINE') as a_cmdline
from logs
where json_valid(msg)
and a_cmdline like '%sudo apt upgrade%'
order by timestamp desc
limit 100;
💌 Get notified on new features and updates