{"id":28578317,"url":"https://github.com/digitalocean/logtalez","last_synced_at":"2025-06-11T01:09:32.867Z","repository":{"id":31722185,"uuid":"35288054","full_name":"digitalocean/logtalez","owner":"digitalocean","description":"logtalez is a minimal command line client (and API) for retrieving log streams from the rsyslog logging daemon over zeromq. ","archived":false,"fork":false,"pushed_at":"2016-12-06T18:49:19.000Z","size":49,"stargazers_count":75,"open_issues_count":0,"forks_count":4,"subscribers_count":183,"default_branch":"master","last_synced_at":"2025-01-15T00:19:46.070Z","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":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalocean.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}},"created_at":"2015-05-08T15:52:14.000Z","updated_at":"2024-06-26T08:39:56.000Z","dependencies_parsed_at":"2022-09-17T18:10:15.973Z","dependency_job_id":null,"html_url":"https://github.com/digitalocean/logtalez","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Flogtalez","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Flogtalez/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Flogtalez/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Flogtalez/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalocean","download_url":"https://codeload.github.com/digitalocean/logtalez/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Flogtalez/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178542,"owners_count":22817388,"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":"2025-06-11T01:09:31.565Z","updated_at":"2025-06-11T01:09:32.844Z","avatar_url":"https://github.com/digitalocean.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logtalez [![Build Status](https://travis-ci.org/digitalocean/logtalez.svg?branch=master)](https://travis-ci.org/digitalocean/logtalez) [![Doc Status](https://godoc.org/github.com/digitalocean/logtalez?status.png)](https://godoc.org/github.com/digitalocean/logtalez)\n\n![logtalez](https://i.imgur.com/DFZxsBi.png)\n\n## Problem Statement\nWe want to tail logs from remote servers as conveniently as if they were local, in a safe and secure manner.\n\n## Solution\nlogtalez - a library and command line client for subscribing to log streams from rsyslog using the [omczmq](https://github.com/rsyslog/rsyslog/tree/master/contrib/omczmq) output plugin..\n\n* Create dynamic topics using rsyslog's [parsing](http://www.rsyslog.com/doc/messageparser.html) and [template](http://www.rsyslog.com/doc/v8-stable/configuration/templates.html) features.\n* Subscribe to topics to receive the logs you want.\n* Publisher side filtering keeps bandwidth usage low.\n* Brokerless design keeps operation simple.\n* Ephemeral streaming keeps things light weight.\n* [CurveZMQ](http://curvezmq.org/) authentication and encryption keeps things secure.\n\n## Installation\n### Dependencies\n#### [libsodium](https://github.com/jedisct1/libsodium)\nVersion: 1.0.11 (or newer)\n\nSodium is a \"new, easy-to-use software library for encryption, decryption, signatures, password hashing and more\".  ZeroMQ uses sodium for the basis of the CurveZMQ security protocol.\n\n#### [ZeroMQ](http://zeromq.org/) \nVersion: 4.2.0 (or newer)\n\nZeroMQ is an embeddable [ZMTP](http://rfc.zeromq.org/spec:23) protocol library.\n\n#### [CZMQ](http://czmq.zeromq.org/)\nVersion: 4.0.1 (or newer)\n\nCZMQ is a high-level C binding for ZeroMQ.  It provides an API for various services on top of ZeroMQ such as authentication, actors, service discovery, etc.\n\n#### [GoCZMQ](http://https://github.com/zeromq/goczmq)\nGoCZMQ is a Go interface to the CZMQ API.\n\n#### [Rsyslog](http://www.rsyslog.com/)\nVersion: 8.9.0 or newer\n\nRsyslog is the \"rocket fast system for log processing\".\nYou will need to use the \"--enable-omczmq\" configure flag to build zeromq + curve support.\n\n### Generating Certificates\nlogtalez uses CURVE security certificates generated by the [zcert](http://api.zeromq.org/czmq3-0:zcert) API.  They are stored in [ZPL](http://rfc.zeromq.org/spec:4) format.  Logtalez includes a simple cert generation tool (curvecertgen) for convenience.\n\nTo generate a public / private key pair:\n\n```\n$ ./curvecertgen bogus_cert\nName: Brian\nEmail: bogus@whatever.com\nOrganization: Bogus Org\nVersion: 1\n```\n\nThe above would generate a bogus_cert and bogus_cert_secret file.\n\n### Configuring Your Rsyslog Server\n\nThe following rsyslog configuration snippet consists of:\n* A template that dynamically sets a \"topic\" on a message consisting of hostname.syslogtag + an \"@cee\" cookie and JSON message payload\n* A rule snippet that attempts to parse a syslog message as JSON, then outputs it over a zeromq publish socket using the template\n\n```\nmodule(load=\"mmjsonparse\")\nmodule(load=\"omczmq\")\n\ntemplate(name=\"pubsub_host_tag\" type=\"list\") {\n  property(name=\"hostname\")\n  constant(value=\".\")\n  property(name=\"syslogtag\" position.from=\"1\" position.to=\"32\")\n  constant(value=\"@cee:\")\n  constant(value=\"{\")\n  constant(value=\"\\\"@timestamp\\\":\\\"\")\n  property(name=\"timereported\" dateFormat=\"rfc3339\" format=\"json\")\n  constant(value=\"\\\",\\\"host\\\":\\\"\")\n  property(name=\"hostname\")\n  constant(value=\"\\\",\\\"severity\\\":\\\"\")\n  property(name=\"syslogseverity-text\")\n  constant(value=\"\\\",\\\"facility\\\":\\\"\")\n  property(name=\"syslogfacility-text\")\n  constant(value=\"\\\",\\\"syslogtag\\\":\\\"\")\n  property(name=\"syslogtag\" format=\"json\")\n  constant(value=\"\\\",\")\n  property(name=\"$!all-json\" position.from=\"2\")\n} \n\nruleset(name=\"zmq_pubsub_out\") {\n  action(\n    name=\"zmq_pubsub\"\n    template=\"pubsub_host_tag\"\n    type=\"omczmq\"\n    endpoints=\"tcp://*:24444\"\n    socktype=\"PUB\"\n    authtype=\"CURVESERVER\"\n    clientcertpath=\"/etc/curve.d/\"\n    servercertpath=\"/etc/curve.d/my_server_cert\"\n  )\n}\n\naction(type=\"mmjsonprase\")\nif $parsesuccess == \"OK\" then {\n  call zmq_pubsub_out\n} \n```\n\n## Usage\n\n`````go\n\timport \"github.com/digitalocean/logtalez\"\n\n\tfunc main() {\n\t\tendpoints := []string{\"tcp://127.0.0.1:24444,tcp://example.com:24444\"}\n\t\ttopics = []string{\"host1.nginx\",\"host2.nginx\",\"host3.nginx\"}\n\n\t\tserverCert := \"/home/me/.curve/server_public_cert\"\n\t\tclientCert := \"/home/me/.curve/client_public_cert\"\n\n\t\tlt, err := logtalez.New(endpoints, topics, serverCert, clientCert)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tbuf := make([]byte, 65560)\n\n\t\tfor {\n\t\t\tn, err := lt.Read(buf)\n\t\t\tif err != nil \u0026\u0026 err != io.EOF {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tfmt.Println(string(buf[:n]))\n\t\t}\n\t}\n`````\n\n## Tools That Work Well with Logtalez\n* [jq](https://stedolan.github.io/jq/) JSON processor\n* [humanlog](https://github.com/aybabtme/humanlog) \"Logs for humans to read.\"\n* Anything that can read stdout!\n\n## GoDoc\n\n[godoc](https://godoc.org/github.com/digitalocean/logtalez)\n\n## License\n\nThis project uses the MPL v2 license, see LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Flogtalez","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalocean%2Flogtalez","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Flogtalez/lists"}