{"id":22288027,"url":"https://github.com/nrwiersma/snatch","last_synced_at":"2025-03-25T21:18:42.830Z","repository":{"id":57588485,"uuid":"154784334","full_name":"nrwiersma/snatch","owner":"nrwiersma","description":"Snatch is a l2met parser that inserts the data into InfluxDB","archived":false,"fork":false,"pushed_at":"2018-12-04T04:59:18.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T18:32:19.081Z","etag":null,"topics":["influxdb","l2met","parser"],"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/nrwiersma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-26T05:56:56.000Z","updated_at":"2022-01-18T16:18:31.000Z","dependencies_parsed_at":"2022-09-26T19:42:52.814Z","dependency_job_id":null,"html_url":"https://github.com/nrwiersma/snatch","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrwiersma%2Fsnatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrwiersma%2Fsnatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrwiersma%2Fsnatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrwiersma%2Fsnatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nrwiersma","download_url":"https://codeload.github.com/nrwiersma/snatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245543426,"owners_count":20632648,"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":["influxdb","l2met","parser"],"created_at":"2024-12-03T17:01:37.250Z","updated_at":"2025-03-25T21:18:42.810Z","avatar_url":"https://github.com/nrwiersma.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](http://svg.wiersma.co.za/github/project?lang=go\u0026title=snatch\u0026tag=l2met%20parser)\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/nrwiersma/snatch)](https://goreportcard.com/report/github.com/nrwiersma/snatch)\n[![Build Status](https://travis-ci.org/nrwiersma/snatch.svg?branch=master)](https://travis-ci.org/nrwiersma/snatch)\n[![Coverage Status](https://coveralls.io/repos/github/nrwiersma/snatch/badge.svg?branch=master)](https://coveralls.io/github/nrwiersma/snatch?branch=master)\n[![GitHub release](https://img.shields.io/github/release/nrwiersma/snatch.svg)](https://github.com/nrwiersma/snatch/releases)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nrwiersma/snatch/master/LICENSE)\n\n## About\n\nSnatch is a l2met parser that inserts the data into InfluxDB. If it cannot parse the line, it outputs\nback to stdout.\n\n## Installation\n\nDownload the [binary](https://github.com/nrwiersma/snatch/releases) or\n\n```bash\n$ go get github.com/nrwiersma/snatch/cmd/snatch\n```\n\n## Usage\n\nSnatch parse metrics in `logfmt` lines from `stdin` in the format\n```\nlvl=info msg= count#test=2 foo=\"bar\" size=10\n```\n\nThe time is optional, defaulting to now, and the `lvl` and `msg` will be ignored in the metrics.\nAll other non-metric pieces will be used as tags in the metric.\n\nWhile not standard, snatch handles sampling. You can add the sample rate at the end of the\nname separated by an `@`\n\n```\nlvl=info msg= count#test@0.1=2 foo=\"bar\" size=10\n``` \n\nSnatch requires the `--db` flag with the DSN of InfluxDB in the format\n\n```bash\n$ snatch --db=http://localhost:8086/database\n```\n\noptionally you can set the resolution of the buckets (default is `10s`)\n\n```bash\n$ snatch --db=http://localhost:8086/database --res=30s\n```\n\nSetting these options can be tedious, so a YAML config file can be used (default path is `~/.snatch.yaml`)\n\n```bash\n$ snatch --config=testdata/config.yaml\n```\n\nwhich is in the form\n\n```yaml\ndb: http://localhost:8086/metrics\nres: 30s\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrwiersma%2Fsnatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnrwiersma%2Fsnatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrwiersma%2Fsnatch/lists"}