{"id":37188267,"url":"https://github.com/smitajit/logtrics","last_synced_at":"2026-01-14T21:53:46.773Z","repository":{"id":140289234,"uuid":"256833365","full_name":"smitajit/logtrics","owner":"smitajit","description":"logtrics generates metrics by parsing regular expression. It provides abstract APIs and lua binding to build parser and metrics generation logic","archived":false,"fork":false,"pushed_at":"2020-06-08T18:46:58.000Z","size":72,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T20:37:41.473Z","etag":null,"topics":["graphite","logging","lua","metrics"],"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/smitajit.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":"2020-04-18T19:14:05.000Z","updated_at":"2024-06-19T07:53:08.872Z","dependencies_parsed_at":null,"dependency_job_id":"6cc78e7e-83dc-4e10-9b77-74a537c8b4cb","html_url":"https://github.com/smitajit/logtrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smitajit/logtrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitajit%2Flogtrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitajit%2Flogtrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitajit%2Flogtrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitajit%2Flogtrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smitajit","download_url":"https://codeload.github.com/smitajit/logtrics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitajit%2Flogtrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["graphite","logging","lua","metrics"],"created_at":"2026-01-14T21:53:46.099Z","updated_at":"2026-01-14T21:53:46.761Z","avatar_url":"https://github.com/smitajit.png","language":"Go","readme":"# logtrics\n\nlogtrics provide a way to parse logs, to generate metrics, notify and more.\nIt can read logs from multiple sources(console, UDP, TCP). It also provides interfaces through lua script to configure and customize your logging tricks :P\n\n### Configuration\n\n[sample](./examples/config.toml)\n\n```Usage:\nUsage:\n  logtrics [flags]\n\nFlags:\n      --buffer.size int         go channel default buffer size\n  -c, --config string           config file path (default \"/etc/logtrics/logtrics.toml\")\n      --graphite.debug          if enabled metrics will be logged\n      --graphite.host string    graphite server host (default \"127.0.0.1\")\n      --graphite.interval int   interval in secs (default 30)\n      --graphite.port int       graphite server port (default 2024)\n  -h, --help                    help for logtrics\n      --logging.level string    logging level (default \"info\")\n      --logging.type string     logging type, choices are \"syslog\", \"console\" (default \"console\")\n  -m, --modes strings           run modes, choices are \"console\", \"udp\", \"tcp\"'\n  -d, --script.dir string       lua scripts directory (default \"/etc/logtrics/scripts/\")\n  -f, --script.file string      lua script file path\n      --tcp.host string         tcp server listening host (default \"127.0.0.1\")\n      --tcp.port int            tcp server listening port (default 4003)\n      --udp.host string         udp server listening host (default \"127.0.0.1\")\n      --udp.port int            udp server listening port (default 4002)\n  -v, --version                 version for logtrics\n```\n\n### Modes\n\n    logtrics supports multiple mode to receive log line.\n\n- console - Mainly for debugging scripts\n- UDP/TCP - Receives logs using UDP/TCP socket. Mainly to be used with rsyslog [omfwd](https://www.rsyslog.com/doc/v8-stable/configuration/modules/omfwd.html)\n- filetail - Receives logs by tailing log file. (TODO)\n\n#### Console\n\nIn this mode, the log lines can be provided to the console prompt to debug the scripts.\n\n```\nlogtrics -m console -f examples/scripts/logtrics.lua --logging.level debug\n```\n\n#### UDP\n\nIn this mode, the log lines can be read from the UDP socket\n\n```\nlogtrics -m udp -f examples/scripts/logtrics.lua --logging.level debug --udp.port 4002 --udp.host localhost\n```\n\nsend logs using `echo \"hello \\\"World\\\"\" | nc -cu localhost 4002`\n\n#### TCP\n\nIn this mode, the log lines can be read from the TCP socket\n\n```\nlogtrics -m tcp -f examples/scripts/logtrics.lua --logging.level debug --tcp.port 4003 --tcp.host localhost\n```\n\nsend logs using `echo \"hello \\\"World\\\"\" | nc -c localhost 4003`\n\n### Lua Script\n\n[sample](./examples/scripts/logtrics.lua)\n\n```lua\nlogtrics {\n\tname = \"logtrics-example\",\n\tparser = {\n\t\ttype = \"re2\",\n\t\t-- expression for `hello \"World\"`. extracting word hello\n\t\texpression = 'hello \"(?P\u003cfirst\u003e[a-zA-z0-9]+)\"',\n\t},\n\thandler = function(fields)\n\t\tinfo(\"fields are %v\" , fields)\n\t\t-- graphite().counter(\"demo.counter.inc.value\").inc(value)\n\t\t-- graphite().counter(\"demo.counter.dec.value\").dec(value)\n\t\t-- graphite().timer(\"demo.timer.value\").update(value)\n\t\t-- graphite().gauge(\"demo.gauge.value\").update(value)\n\t\t-- graphite().meter(\"demo.meter.value\").mark(value)\n\t\tend,\n}\n\n```\n\n### [TODO](./TODO.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmitajit%2Flogtrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmitajit%2Flogtrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmitajit%2Flogtrics/lists"}