{"id":19714774,"url":"https://github.com/cainky/unixlogmonitor","last_synced_at":"2025-04-29T19:33:13.053Z","repository":{"id":178687530,"uuid":"661685500","full_name":"cainky/UnixLogMonitor","owner":"cainky","description":"Unix server log monitoring. Completed as part of a technical interview.","archived":true,"fork":false,"pushed_at":"2024-02-06T00:39:00.000Z","size":186,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T21:48:31.958Z","etag":null,"topics":["log-monitor","log-monitoring","logging","logging-facilities","unix"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cainky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"cainky"}},"created_at":"2023-07-03T12:22:46.000Z","updated_at":"2024-04-12T00:13:31.000Z","dependencies_parsed_at":"2023-07-19T05:20:57.959Z","dependency_job_id":"e282c110-538c-4ac8-b015-4d1c9e0bfce3","html_url":"https://github.com/cainky/UnixLogMonitor","commit_stats":null,"previous_names":["cainky/flasklogmonitor","cainky/unixlogmonitor"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cainky%2FUnixLogMonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cainky%2FUnixLogMonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cainky%2FUnixLogMonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cainky%2FUnixLogMonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cainky","download_url":"https://codeload.github.com/cainky/UnixLogMonitor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251569689,"owners_count":21610600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["log-monitor","log-monitoring","logging","logging-facilities","unix"],"created_at":"2024-11-11T22:35:47.363Z","updated_at":"2025-04-29T19:33:08.038Z","avatar_url":"https://github.com/cainky.png","language":"Python","readme":"# UnixLogMonitor\n\nThis project offers a solution for on-demand log monitoring across multiple unix-based servers. With this service, it is no longer necessary to individually access each server and manually open the log files located at /var/log. Instead, by sending a simple REST request to a server, you can easily retrieve its /var/log files. This makes tracking and debugging system events considerably more efficient and user-friendly.\n\n## Installation and Setup\n\n1. Install Python 3.10.x\n2. [Install Poetry](https://python-poetry.org/docs/#installation) - Poetry is used for dependency management.\n\n```bash\ncurl -sSL https://install.python-poetry.org | python -\n```\n3. Install the project dependencies\n```bash\npoetry install\n```\n\n4. Run the server\n```bash\npoetry run python app.py\n```\nAlternatively you can use ```poetry shell``` to activate the environment and run python commands as you normally would: ```python app.py```\n\n## Usage\n\nMake a GET request to `/logs` to retrieve logs from `/var/log`. You can use the following query parameters:\n\n- `filename`: Specify a filename within `/var/log`.\n- `term`: Filter results based on this text/keyword.\n- `limit`: Specify the last n number of matching entries to retrieve within the log.\n\nFor example:\n\n```bash\ncurl http://localhost:5000/logs?filename=syslog\u0026term=error\u0026limit=5\n```\n\n\n## Project Files and Directories\n```\n.\n├── .env                # Environment variables\n├── README.md           # This file\n├── app.py              # The main application script\n├── views               # Request \u0026 response handling\n└── tests               # Tests for the app\n    └── var\n        └── log         # Directory for local testing of logs\n```\n#### `.env`\nBe sure to create this file for local testing and development.\n\u003cbr/\u003e \nYou can use the ```.env.example``` file to help you get started, just rename it to ```.env```\n\u003cbr/\u003e\n\nThis file contains environment variables for local development. It is read by `dotenv.load_dotenv()` at the start of `app.py`.\n\u003cbr/\u003e\nThe environment variables are:\n\n- `TESTING`: Determines whether the app is running in a local development environment. If `True`, the app will read from the local `tests/var/log` directory for log files. If `False` or not set, the app will read from `/var/log`.\n\n#### `README.md`\n\nThis file provides information about the project, including this description of the file structure.\n\n#### `app.py`\n\nThis is the main script for the Flask application. It defines the route for the log reading API and handles requests to that route. The log reading functionality is controlled by environment variables.\n\n#### `tests/var/log`\n\nThis directory is used for local testing of the log reading functionality. When `TESTING` is `True`, the app will attempt to read log files from this directory. You can place any files you want to test with in this directory.\n\n## Running the Tests\n\n```bash\npoetry run python -m unittest\n```\n\n## Contributing\n\nPlease open an issue to discuss potential contributions before submitting a pull request.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n\n","funding_links":["https://github.com/sponsors/cainky"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcainky%2Funixlogmonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcainky%2Funixlogmonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcainky%2Funixlogmonitor/lists"}