{"id":21055724,"url":"https://github.com/kak-tus/loghouse-acceptor","last_synced_at":"2025-05-15T23:32:46.361Z","repository":{"id":57535081,"uuid":"126548328","full_name":"kak-tus/loghouse-acceptor","owner":"kak-tus","description":"Accept and write logs to Clickhouse in LogHouse compatible format","archived":false,"fork":false,"pushed_at":"2019-11-05T20:20:38.000Z","size":385,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T17:01:33.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/kak-tus.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-23T23:24:32.000Z","updated_at":"2022-06-18T22:32:54.000Z","dependencies_parsed_at":"2022-09-26T18:21:48.733Z","dependency_job_id":null,"html_url":"https://github.com/kak-tus/loghouse-acceptor","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Floghouse-acceptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Floghouse-acceptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Floghouse-acceptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Floghouse-acceptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kak-tus","download_url":"https://codeload.github.com/kak-tus/loghouse-acceptor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442407,"owners_count":22071864,"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":[],"created_at":"2024-11-19T16:46:57.784Z","updated_at":"2025-05-15T23:32:43.601Z","avatar_url":"https://github.com/kak-tus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loghouse-acceptor\n\nAccept and write logs to ClickHouse in Loghouse compatible format.\n\nDaemon accepts log only in syslog RFC5424 format from rsyslog. Later may be will be added\nsome additinal protocols support.\n\n## Daemon configuration\n\nConfiguration is possible with environment variables\n\n### CLICKHOUSE_ADDR\n\nClickHouse address\n\n```\nCLICKHOUSE_ADDR=127.0.0.1:9000\n```\n\n### ACC_PERIOD\n\nPeriod in seconds to send data to ClickHouse if batch size is not reached.\n\n```\nACC_PERIOD=60\n```\n\n### ACC_BATCH\n\nBatch size to send to ClickHouse immediately.\n\n```\nACC_BATCH=10000\n```\n\n### ACC_TABLE_TYPE\n\nLoghouse table type. In most cases you need basic table type - default to Loghouse. But you can use other type - extended, with some additional vendored columns.\n\n```\nACC_TABLE_TYPE=basic\n```\n\n### ACC_PARTITION_TYPE\n\nConfigurable partitions periods - daily or hourly. Loghouse supports both types.\n\n```\nACC_PARTITION_TYPE=hourly\n```\n\n### ACC_SHARD_TYPE\n\nSharding type. If you didn't use shards and replicas set this to default value \"basic\". In other case see \"Sharding and replication in ClickHouse\" section.\n\n```\nACC_SHARD_TYPE=basic\n```\n\n### ACC_TABLE_CLUSTER\n\nCluster name in ClickHouse. See \"Sharding and replication in ClickHouse\" section.\n\n```\nACC_TABLE_CLUSTER=my-cluster\n```\n\n## Rsyslog configuration\n\nConfigure rsyslog to resend logs to daemon\n\n```\naction(type=\"omfwd\" Target=\"127.0.0.1\" Port=\"3333\" Protocol=\"tcp\" KeepAlive=\"on\" Template=\"RSYSLOG_SyslogProtocol23Format\")\n```\n\n## Running\n\n```\ndocker run --rm -it -p 3333:3333 -e ClickHouse_ADDR=127.0.0.1:9000 kaktuss/loghouse-acceptor\n```\n\n\n## Sharding and replication in ClickHouse\n\nIt is possible to use and create sharded and replicated partitions. See [replication](https://ClickHouse.yandex/docs/en/operations/table_engines/replication/) and [distributed](https://ClickHouse.yandex/docs/en/operations/table_engines/distributed/#table_engines-distributed) in ClickHouse docs.\n\nTo use this feature with loghouse-acceptor you need to configure two macros in ClickHouse.\n\n```\n\u003cmacros\u003e\n    ...\n    \u003cshard\u003e02\u003c/shard\u003e\n    \u003creplica\u003eexample05-02-1.yandex.ru\u003c/replica\u003e\n    ...\n\u003c/macros\u003e\n```\n\nThen configure cluster in ClickHouse\n\n```\n\u003cremote_servers\u003e\n  \u003cmy-cluster\u003e\n    ...\n  \u003c/my-cluster\u003e\n\u003cremote_servers\u003e\n```\n\nThen set ACC_SHARD_TYPE variable to basic_sharded and ACC_TABLE_CLUSTER to your cluster name.\n\n```\nACC_SHARD_TYPE=basic_sharded\nACC_TABLE_CLUSTER=my-cluster\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkak-tus%2Floghouse-acceptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkak-tus%2Floghouse-acceptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkak-tus%2Floghouse-acceptor/lists"}