Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lxlog-0.11.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lxlog-0.11.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for lxlog-0.11.0.tar.gz
Algorithm Hash digest
SHA256 4ea75c915c537c9e7d132dbf7afca6a3cb73b51598703fc4e68a4aebf0588264
MD5 7aaf76817766d1e9fc4b0a17f59e86ca
BLAKE2b-256 b8fc073c862d7d6c2d7c9513134f51f7304e0482ffcfe9a9144eec27a0ccd11f

See more details on using hashes here.

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

Hashes for lxlog-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 625746b2f7ccd21f31a4731113ed42b32098a372203b36bc78c169b98a8f96d8
MD5 914c50781102ecc4759468f36fabb9a4
BLAKE2b-256 8167d45072393da1ea802caa91e7e1275af86fd5be0f8edc6c87e1d5de80862e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page