Generate client-side configuration for rsyslog
Project description
Rsyslog Configuration Generator
This Python application generates client-side configuration for rsyslog using RainerScript. The configuration includes defining a ruleset and applying it to monitor log files.
Overview
This application provides two main functions:
client_ruleset_config
: Generates an rsyslog RainerScript configuration string to define a ruleset with disk queue settings.apply_ruleset_client
: Generates an rsyslog RainerScript configuration string to apply a previously defined ruleset to monitor a log file using the imfile module.
Prerequisites
- Python 3.x
- Basic understanding of rsyslog and RainerScript
Functions
client_ruleset_config(rule_name, server_ip, port, protocol)
apply_ruleset_client(log_file, tag, facility, severity, rule_name)
Generates a RainerScript configuration string to define a ruleset and apply the rule.
Arguments:
rule_name
(str): Name of the ruleset.server_ip
(str): IP address or hostname of the rsyslog server.port
(int): Port number to send logs to.protocol
(str): Protocol to use ('tcp' or 'udp').log_file
(str): Log file name where the rule should be applicable.tag
(str): tag of the log events.facility
(str): Facilities of the log events('local0' to 'local6', 'authpriv','mail' etc.).severity
(str): Log criticality('info','warn','crit' etc.).
Returns:
str
: RainerScript configuration string defining the ruleset.
Examples:
config = client_ruleset_config("myRuleset", "192.168.1.100", 514, "tcp")
print(config)
apply = apply_ruleset_client("/var/log/message", "message_log", "local3", "info", "myRuleset")
print(apply)
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
File details
Details for the file rsyslog_client_assistant-0.1.3.tar.gz
.
File metadata
- Download URL: rsyslog_client_assistant-0.1.3.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.20.0 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1e8b96a7d62533b7581df8ea9a31ff33d9caacead5f63c235ec9f7872feb5cc |
|
MD5 | b799559429b7a98e1d0a8c0e53a04cf6 |
|
BLAKE2b-256 | 7a7afc43913eb7c623366825de2afea3b6a793cf8f35414602a67b799d8df195 |
File details
Details for the file rsyslog_client_assistant-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: rsyslog_client_assistant-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.20.0 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbd7736a7588ed9306f52b87705ff6c21405828a2002875c8ab958fcfe1791bb |
|
MD5 | c327c1d058c18ed519bd626f29ccc13b |
|
BLAKE2b-256 | 14293fcad902db1e50749b4edd4cd90c861d7bebb1eb2091cc18ebb6123a7504 |