Skip to main content

This Package to see system log with Date Range and Process

Project description


lxlog

lxlog is a Python package that provides a simple interface to extract and format Linux logs. It uses the journalctl command-line tool and the pandas and prettytable libraries to extract log data for a given process name and time range, and format it into a table that can be displayed in the terminal.

Features

  • Extract Linux logs for a given process name and time range
  • Format log data into a table using the prettytable library
  • Display the table in the terminal.
  • Easy-to-use command-line interface.

Installation

You can install lxlog using pip, the Python package manager:

pip install lxlog

Usage

To use lxlog in your Python code, you can import the log_analysis() function from the lxlog package and call it with the desired parameters:

python

from lxlog import log_analysis
start_date = input("Enter start date (YYYY-MM-DD): ")
end_date = input("Enter end date (YYYY-MM-DD): ")
process_name = input("Enter process name: ")

result = log_analysis(start_date, end_date, process_name)
print(result)

This will print the log data as a formatted table in the terminal.

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.7.0.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

lxlog-0.7.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

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