# 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)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/titas2003/rsyslog_client_assist.git",
"name": "rsyslog-client-assistant",
"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/b5/06/903261bace955f66ee38331a9c251f14f79d457af1785e50e5438ad82ed1/rsyslog_client_assistant-0.1.4.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",
"bugtrack_url": null,
"license": null,
"summary": "Generate client-side configuration for rsyslog",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/titas2003/rsyslog_client_assist.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7dee6581553d2056f474646d4119af2396c2853309018f9a0a8983792fc89334",
"md5": "c202c015085778868c01c461bf8cc40b",
"sha256": "2f86949ae42e26f3920ae4a9eb64805b5c7d828b9a54535ffcdf82d99d3d915c"
},
"downloads": -1,
"filename": "rsyslog_client_assistant-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c202c015085778868c01c461bf8cc40b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4351,
"upload_time": "2024-07-30T08:27:32",
"upload_time_iso_8601": "2024-07-30T08:27:32.316687Z",
"url": "https://files.pythonhosted.org/packages/7d/ee/6581553d2056f474646d4119af2396c2853309018f9a0a8983792fc89334/rsyslog_client_assistant-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b506903261bace955f66ee38331a9c251f14f79d457af1785e50e5438ad82ed1",
"md5": "af3843fafdacfe879f489516f7b6017d",
"sha256": "535aa9eea2f31ec0dcbe913430af4feb0999745ed17ca6a0dd054a0fce28a632"
},
"downloads": -1,
"filename": "rsyslog_client_assistant-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "af3843fafdacfe879f489516f7b6017d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 2726,
"upload_time": "2024-07-30T08:27:33",
"upload_time_iso_8601": "2024-07-30T08:27:33.987039Z",
"url": "https://files.pythonhosted.org/packages/b5/06/903261bace955f66ee38331a9c251f14f79d457af1785e50e5438ad82ed1/rsyslog_client_assistant-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-30 08:27:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "titas2003",
"github_project": "rsyslog_client_assist",
"github_not_found": true,
"lcname": "rsyslog-client-assistant"
}