{"id":19142277,"url":"https://github.com/martinbaillie/go-graylog","last_synced_at":"2025-09-25T22:50:54.686Z","repository":{"id":57506576,"uuid":"119153222","full_name":"martinbaillie/go-graylog","owner":"martinbaillie","description":"Golang library and reference client for interfacing the Graylog API.","archived":false,"fork":false,"pushed_at":"2019-01-31T09:52:24.000Z","size":3235,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-06T23:49:45.856Z","etag":null,"topics":["api","cli","golang","graylog","graylog-server","library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martinbaillie.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":"2018-01-27T10:08:27.000Z","updated_at":"2023-11-15T21:25:05.000Z","dependencies_parsed_at":"2022-08-29T20:01:05.465Z","dependency_job_id":null,"html_url":"https://github.com/martinbaillie/go-graylog","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/martinbaillie/go-graylog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinbaillie%2Fgo-graylog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinbaillie%2Fgo-graylog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinbaillie%2Fgo-graylog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinbaillie%2Fgo-graylog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinbaillie","download_url":"https://codeload.github.com/martinbaillie/go-graylog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinbaillie%2Fgo-graylog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262357494,"owners_count":23298457,"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":["api","cli","golang","graylog","graylog-server","library"],"created_at":"2024-11-09T07:26:37.254Z","updated_at":"2025-09-25T22:50:54.598Z","avatar_url":"https://github.com/martinbaillie.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/license-BSD-brightgreen.svg?style=flat-square)](/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/martinbaillie/go-graylog?style=flat-square)](https://goreportcard.com/report/github.com/martinbaillie/go-graylog)\n[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/martinbaillie/go-graylog)\n[![Build](https://img.shields.io/travis/martinbaillie/go-graylog/master.svg?style=flat-square)](https://travis-ci.org/martinbaillie/go-graylog)\n[![Release](https://img.shields.io/github/release/martinbaillie/go-graylog.svg?style=flat-square)](https://github.com/martinbaillie/go-graylog/releases/latest)\n\n# go-graylog\n\nThis repository contains Golang bindings for the complete Graylog API and a reference CLI that implements a very small subset of the API.\n\nThe CLI is self-serving at this stage i.e. I needed the current subset of commands implemented. However, if you find it useful and but lacking a certain command you need then don't be shy about raising an issue. Likewise, PRs are most welcome.\n\n### API\nThe library is currently coded to Graylog `v2.4.0-beta.3+a6b18a2`. YMMV if you're not on the 2.4 stream of Graylog (latest at the time of writing this).\n\nIt starts here: `go get -u github.com/martinbaillie/go-graylog/...` [[Godoc]](https://godoc.org/github.com/martinbaillie/go-graylog/pkg).\n\nIf you're developing with the library I would start by referencing your Graylog server's API browser at `\u003cgraylog server\u003e/api/api-browser` but then searching through `pkg` or the Godoc for the name of the endpoint—it's often not in the package you would expect due to some [awkward codegen](./api/README.md).\n\n### CLI\n\nAt this time, only search functionality is implemented in the CLI.\n\nFeatures of note:\n\n- Ability to search and merge messages from *multiple* Graylog servers with (`-s`) with colour coded results to differentiate (if `$TERM` supports).\n- Follow mode (`-f`) in `search relative` command for tail-like behaviour.\n- Use `-p, --pass -` to keep passwords out of your shell history.\n- Show/hide Graylog's own timestamp (in UTC or Local) with `-t, --timestamps`.\n\n##### Search Options\n```\nUsage:\n  graylog search [command]\n\nAvailable Commands:\n  absolute    Search for messages using an absolute timerange\n  keyword     Search for messages in a natural language timerange\n  relative    Search for messages starting from a relative timestamp\n\nFlags:\n  -h, --help         help for search\n  -t, --timestamps   print message timestamps (local timezone)\n      --utc -t       print UTC message timestamps (has no effect without -t)\n\nGlobal Flags:\n  -p, --pass string       graylog pass (use \"-\" for masked prompt) (default \"admin\")\n  -s, --servers strings   graylog server(s) to query (default [localhost:9000])\n  -u, --user string       graylog user (default \"admin\")  \n\nUse \"graylog search [command] --help\" for more information about a command.\n```\n\n##### Search: Absolute\n```\nSearch for messages using an absolute timerange, specified as from/to\nwith format yyyy-MM-ddTHH:mm:ss.SSSZ (e.g. 2014-01-23T15:34:49.000Z) or\nyyyy-MM-dd HH:mm:ss.\n\nUsage:\n  graylog search absolute [flags]\n\nFlags:\n      --from string   from this absolute timestamp e.g. \"2018-01-01 00:00:00\"\n  -h, --help          help for absolute\n      --to string     to this absolute timestamp e.g. \"2018-02-01 00:00:00\"\n\nGlobal Flags:\n  -d, --debug                 print debug information\n  -p, --pass string           graylog pass (use \"-\" for masked prompt) (default \"admin\")\n  -s, --servers stringSlice   graylog server(s) to query (default [localhost:9000])\n  -t, --timestamps            print message timestamps (local timezone)\n  -u, --user string           graylog user (default \"admin\")\n      --utc -t                print UTC message timestamps (has no effect without -t)\n  -x, --filter                Filter e.g. (streams:stream_id)\n```\n\n##### Search: Keyword\n```\nSearch for messages in a natural language timerange e.g. \"yesterday\" or \"2 weeks ago to wednesday\".\n\nUsage:\n  graylog search keyword [flags]\n\nFlags:\n  -h, --help             help for keyword\n      --keyword string   natural language timerange e.g. \"yesterday\" or \"2 weeks ago to wednesday\"\n\nGlobal Flags:\n  -p, --pass string       graylog pass (use \"-\" for masked prompt) (default \"admin\")\n  -s, --servers strings   graylog server(s) to query (default [localhost:9000])\n  -t, --timestamps        print message timestamps (local timezone)\n  -u, --user string       graylog user (default \"admin\")\n      --utc -t            print UTC message timestamps (has no effect without -t)\n  -x, --filter            Filter e.g. (streams:stream_id)\n```\n\n##### Search: Relative\n```\nSearch for messages starting from a relative timestamp until now.\n\nThe timestamp must be a valid Golang duration e.g. \"2h\".\n\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n\nUsage:\n  graylog search relative [flags]\n\nFlags:\n  -f, --follow              follow mode (tail-like functionality)\n  -h, --help                help for relative\n  -i, --interval duration   follow mode polling interval e.g. \"5m\" (default 5s)\n      --since duration      from this relative Golang timestamp until now e.g. \"2h\"\n\nGlobal Flags:\n  -p, --pass string       graylog pass (use \"-\" for masked prompt) (default \"admin\")\n  -s, --servers strings   graylog server(s) to query (default [localhost:9000])\n  -t, --timestamps        print message timestamps (local timezone)\n  -u, --user string       graylog user (default \"admin\")\n      --utc -t            print UTC message timestamps (has no effect without -t)\n  -x, --filter            Filter e.g. (streams:stream_id)      \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinbaillie%2Fgo-graylog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinbaillie%2Fgo-graylog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinbaillie%2Fgo-graylog/lists"}