A package for analyzing system log files
Project description
Installation
You can install lxlog using pip:
pip install lxlog Usage
To use lxlog, you can import the main function and call it with the required parameters:
python
from lxlog import main
start_date = input("Enter start date (YYYY-MM-DD): ")
end_date = input("Enter end date (YYYY-MM-DD): ")
log_type = input("Enter log_type: ")
result = main(start_date, end_date, log_type)
print(result)
The main function accepts three parameters:
start_date: The start date of the log data to analyze in the format YYYY-MM-DD.
end_date: The end date of the log data to analyze in the format YYYY-MM-DD.
log_type: The type of log data to analyze, either syslog or maillog.
If log_type is syslog, the function will prompt for the name of the process to filter for. The function returns a string containing the formatted log data. Some examples:
To get Input form user
python code
from lxlog import main
start_date = input("Enter start date (YYYY-MM-DD): ")
end_date = input("Enter end date (YYYY-MM-DD): ")
log_type = input("Enter log_type: ")
result = main(start_date, end_date, log_type)
print(result)
In log_type use either syslog or maillog as input.
Filter syslog data for the sshd process between January 1st and January 7th, 2022:
python code
from lxlog import main
result = main(“2022-01-01”, “2022-01-07”, “syslog”, process_name=“sshd”)
print(result)
Filter maillog data between January 1st and January 7th, 2022: python code
from lxlog import main
result = main(“2022-01-01”, “2022-01-07”, “maillog”)
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lxlog-0.11.0.tar.gz.
File metadata
- Download URL: lxlog-0.11.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ea75c915c537c9e7d132dbf7afca6a3cb73b51598703fc4e68a4aebf0588264
|
|
| MD5 |
7aaf76817766d1e9fc4b0a17f59e86ca
|
|
| BLAKE2b-256 |
b8fc073c862d7d6c2d7c9513134f51f7304e0482ffcfe9a9144eec27a0ccd11f
|
File details
Details for the file lxlog-0.11.0-py3-none-any.whl.
File metadata
- Download URL: lxlog-0.11.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
625746b2f7ccd21f31a4731113ed42b32098a372203b36bc78c169b98a8f96d8
|
|
| MD5 |
914c50781102ecc4759468f36fabb9a4
|
|
| BLAKE2b-256 |
8167d45072393da1ea802caa91e7e1275af86fd5be0f8edc6c87e1d5de80862e
|