Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niceguyit/synology_abfb_log_parser
Synology Active Backup for Business log parser
https://github.com/niceguyit/synology_abfb_log_parser
activebackup python3 synology
Last synced: 2 months ago
JSON representation
Synology Active Backup for Business log parser
- Host: GitHub
- URL: https://github.com/niceguyit/synology_abfb_log_parser
- Owner: NiceGuyIT
- License: mit
- Created: 2022-12-11T14:08:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T19:05:34.000Z (9 months ago)
- Last Synced: 2024-10-13T08:09:44.596Z (3 months ago)
- Topics: activebackup, python3, synology
- Language: Python
- Homepage:
- Size: 63.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Synology Active Backups for Business log parser
`synology_abfb_log_parser` parses the [Synology Active Backups for Business][1] logs on the agent allowing and provides a way to search the logs. The examples show how to send a TRMM alert for various log entries.
[1]: https://kb.synology.com/en-br/DSM/help/ActiveBackup/activebackup_business_activities?version=7
## Events
Events have the following structure. Given this log entry:
```text
Nov 25 22:12:34 [INFO] async-worker.cpp (56): Worker (0): get event '1: routine {"subaction": "heart_beat"}', start processing
```The events returned will be like this:
```Python
events[0] = {
"datetime": "datestamp.datestamp class",
"timestamp": "Nov 25 22:12:34",
"priority": "INFO",
"method_name": "async-worker.cpp",
"method_num": "56",
"message": "Worker (0): get event '1: routine {\"subaction\": \"heart_beat\"}', start processing",
"json": {
"subaction": "heart_beat"
},
}
```A simple script to print all ERRORs in the last 3 hours.
```Python
import datetime
import synology_abfb_log_parserafter = datetime.timedelta(**{"hours": 3})
find = {
'priority': 'ERROR',
}
synology = synology_abfb_log_parser.abfb_log_parser.ActiveBackupLogParser(
after=after,
)
synology.load()
found = synology.search(find=find)
print(found)
```