{"id":13585993,"url":"https://github.com/jay7x/rsyslog_exporter_py","last_synced_at":"2025-07-07T01:06:30.689Z","repository":{"id":158347269,"uuid":"143017099","full_name":"jay7x/rsyslog_exporter_py","owner":"jay7x","description":"Export rsyslog counters as prometheus metrics (python + omprog version)","archived":false,"fork":false,"pushed_at":"2022-10-04T12:53:24.000Z","size":9,"stargazers_count":5,"open_issues_count":5,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T02:38:13.918Z","etag":null,"topics":["hacktoberfest","metrics","prometheus-exporter","rsyslog","rsyslog-stats"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jay7x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-31T13:21:21.000Z","updated_at":"2022-10-04T04:52:21.000Z","dependencies_parsed_at":"2024-08-01T16:42:00.287Z","dependency_job_id":null,"html_url":"https://github.com/jay7x/rsyslog_exporter_py","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jay7x/rsyslog_exporter_py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay7x%2Frsyslog_exporter_py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay7x%2Frsyslog_exporter_py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay7x%2Frsyslog_exporter_py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay7x%2Frsyslog_exporter_py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jay7x","download_url":"https://codeload.github.com/jay7x/rsyslog_exporter_py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jay7x%2Frsyslog_exporter_py/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263996079,"owners_count":23541399,"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":["hacktoberfest","metrics","prometheus-exporter","rsyslog","rsyslog-stats"],"created_at":"2024-08-01T15:05:15.634Z","updated_at":"2025-07-07T01:06:30.669Z","avatar_url":"https://github.com/jay7x.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# rsyslog prometheus exporter\n\nThis software is acting like a proxy. It reads rsyslog stats on stdin, convert them to the prometheus mertics and expose them via HTTP. Rsyslog stats are expected in 'json' format.\n\n## How to setup\n\n### 1. Put `rsyslog_exporter.py` into /usr/local/bin directory\n```\n$ sudo install -m 0755 -o root -g root -D -v rsyslog_exporter.py /usr/local/bin/\n'rsyslog_exporter.py' -\u003e '/usr/local/bin/rsyslog_exporter.py'\n```\n### 2. Store following snippet into /etc/rsyslog.d/stats.conf\n\n```\nmodule(load=\"omprog\")\n\nmodule(load=\"impstats\"\n  interval=\"60\"\n  resetCounters=\"off\"\n  format=\"json\"\n  ruleset=\"stats\"\n)\n\ntemplate(name=\"stats_exporter_tmpl\" type=\"string\" string=\"%msg%\\n\")\n\nruleset(name=\"stats\"\n) {\n  action(type=\"omprog\" name=\"stats_exporter\"\n    binary=\"/usr/bin/python -u /usr/local/bin/rsyslog_exporter.py -p 9292 -e 5 -d 120\"\n    signalOnClose=\"on\"\n    template=\"stats_exporter_tmpl\"\n  )\n}\n```\nPlease note `rsyslog_exporter.py` command line parameters:\n* `-e` timeout should be small enough to export metrics faster but big enough to prevent export of unfinished data block. 5s looks fine (and it's default value).\n* `-d` timeout should be 2-3 times of impstat's `interval` value. 120s-180s is ok for config above.\n\n### 3. Check rsyslog configuration systax by running `rsyslogd -N 1`\n### 4. Restart rsyslog if no errors found (`systemctl restart rsyslog` e.g.)\n### 5. Go to http://localhost:9292/ to see metrics\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay7x%2Frsyslog_exporter_py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjay7x%2Frsyslog_exporter_py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay7x%2Frsyslog_exporter_py/lists"}