logcliasst


Namelogcliasst JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/titas2003/rsyslog_client_assist.git
SummaryGenerate client-side configuration for rsyslog
upload_time2024-08-01 21:30:34
maintainerNone
docs_urlNone
authorTitas Majumder
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:

1. **`client_ruleset_config`**: Generates an rsyslog RainerScript configuration string to define a ruleset with disk queue settings.
2. **`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:**

```python
config = client_ruleset_config("myRuleset", "192.168.1.100", 514, "tcp")
print(config)
```

```python
apply = apply_ruleset_client("/var/log/message", "message_log", "local3", "info", "myRuleset")
print(apply)
```


### `rsyslog` Configuration Template Generator

This Python script generates `rsyslog` configuration templates with TLS settings and disk queue configuration. The generated configuration can be used to securely forward logs to a remote `rsyslog` server while ensuring reliable buffering.

## Overview

The script creates an `rsyslog` configuration snippet based on user-provided parameters. This includes:
- TLS settings for secure communication.
- Disk queue settings for log buffering.

## Function: `generate_rsyslog_template`

This function generates an `rsyslog` configuration template.

### Arguments

- `cert_file` (str): Path to the CA certificate file.
- `target_host` (str): IP address or hostname of the remote `rsyslog` server.
- `protocol` (str): Protocol to use for communication (e.g., `tcp`).
- `port` (str): Port number on the remote server.
- `rule_name` (str): Name of the ruleset.


### Returns

- `str`: The generated `rsyslog` configuration template as a string.
#### Usage:
#### `client_tls_template(cert_file, target_host, protocol, port, rule_name)`



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/titas2003/rsyslog_client_assist.git",
    "name": "logcliasst",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Titas Majumder",
    "author_email": "titas20031996@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5a/a8/ef885e7cc907bbd677ed22ebac0db5d75a6d5d73ac5c5dd026f1e016cee1/logcliasst-0.1.1.tar.gz",
    "platform": null,
    "description": "# Rsyslog Configuration Generator\n\nThis Python application generates client-side configuration for rsyslog using RainerScript. The configuration includes defining a ruleset and applying it to monitor log files.\n\n## Overview\n\nThis application provides two main functions:\n\n1. **`client_ruleset_config`**: Generates an rsyslog RainerScript configuration string to define a ruleset with disk queue settings.\n2. **`apply_ruleset_client`**: Generates an rsyslog RainerScript configuration string to apply a previously defined ruleset to monitor a log file using the imfile module.\n\n## Prerequisites\n\n- Python 3.x\n- Basic understanding of rsyslog and RainerScript\n\n## Functions\n\n#### `client_ruleset_config(rule_name, server_ip, port, protocol)`\n\n#### `apply_ruleset_client(log_file, tag, facility, severity, rule_name)`\n\nGenerates a RainerScript configuration string to define a ruleset and apply the rule.\n\n**Arguments:**\n\n- `rule_name` (str): Name of the ruleset.\n- `server_ip` (str): IP address or hostname of the rsyslog server.\n- `port` (int): Port number to send logs to.\n- `protocol` (str): Protocol to use ('tcp' or 'udp').\n- `log_file` (str): Log file name where the rule should be applicable.\n- `tag` (str): tag of the log events.\n- `facility` (str): Facilities of the log events('local0' to 'local6', 'authpriv','mail' etc.).\n- `severity` (str): Log criticality('info','warn','crit' etc.).\n\n**Returns:**\n\n- `str`: RainerScript configuration string defining the ruleset.\n\n**Examples:**\n\n```python\nconfig = client_ruleset_config(\"myRuleset\", \"192.168.1.100\", 514, \"tcp\")\nprint(config)\n```\n\n```python\napply = apply_ruleset_client(\"/var/log/message\", \"message_log\", \"local3\", \"info\", \"myRuleset\")\nprint(apply)\n```\n\n\n### `rsyslog` Configuration Template Generator\n\nThis Python script generates `rsyslog` configuration templates with TLS settings and disk queue configuration. The generated configuration can be used to securely forward logs to a remote `rsyslog` server while ensuring reliable buffering.\n\n## Overview\n\nThe script creates an `rsyslog` configuration snippet based on user-provided parameters. This includes:\n- TLS settings for secure communication.\n- Disk queue settings for log buffering.\n\n## Function: `generate_rsyslog_template`\n\nThis function generates an `rsyslog` configuration template.\n\n### Arguments\n\n- `cert_file` (str): Path to the CA certificate file.\n- `target_host` (str): IP address or hostname of the remote `rsyslog` server.\n- `protocol` (str): Protocol to use for communication (e.g., `tcp`).\n- `port` (str): Port number on the remote server.\n- `rule_name` (str): Name of the ruleset.\n\n\n### Returns\n\n- `str`: The generated `rsyslog` configuration template as a string.\n#### Usage:\n#### `client_tls_template(cert_file, target_host, protocol, port, rule_name)`\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Generate client-side configuration for rsyslog",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/titas2003/rsyslog_client_assist.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09f305b3f74d763e395632c9f8a5710f8fac1ac4f7bff318d0915a468cdc3a2c",
                "md5": "7675369f02e8bd430f78d49477e4f4ed",
                "sha256": "72284bc1f08d6b1d449e1dd32ae1e98e3b9cc0dd5152760abd438e8c5b5aab4d"
            },
            "downloads": -1,
            "filename": "logcliasst-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7675369f02e8bd430f78d49477e4f4ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4887,
            "upload_time": "2024-08-01T21:30:33",
            "upload_time_iso_8601": "2024-08-01T21:30:33.068659Z",
            "url": "https://files.pythonhosted.org/packages/09/f3/05b3f74d763e395632c9f8a5710f8fac1ac4f7bff318d0915a468cdc3a2c/logcliasst-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5aa8ef885e7cc907bbd677ed22ebac0db5d75a6d5d73ac5c5dd026f1e016cee1",
                "md5": "22e07c22c3dd4037b1f0a1387c1aadcc",
                "sha256": "ff71a88bd75abe849b4693ecb4be917a8afccb622d0f2f79446ce5c04fce4858"
            },
            "downloads": -1,
            "filename": "logcliasst-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "22e07c22c3dd4037b1f0a1387c1aadcc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3935,
            "upload_time": "2024-08-01T21:30:34",
            "upload_time_iso_8601": "2024-08-01T21:30:34.994203Z",
            "url": "https://files.pythonhosted.org/packages/5a/a8/ef885e7cc907bbd677ed22ebac0db5d75a6d5d73ac5c5dd026f1e016cee1/logcliasst-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-01 21:30:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "titas2003",
    "github_project": "rsyslog_client_assist",
    "github_not_found": true,
    "lcname": "logcliasst"
}
        
Elapsed time: 0.71069s