{"id":23155070,"url":"https://github.com/tengattack/logrus-agent-hook","last_synced_at":"2025-04-04T16:45:36.712Z","repository":{"id":47050784,"uuid":"141786731","full_name":"tengattack/logrus-agent-hook","owner":"tengattack","description":"Log Agent hook for logrus","archived":false,"fork":false,"pushed_at":"2023-05-22T08:23:06.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T02:21:37.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tengattack.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-07-21T06:18:27.000Z","updated_at":"2022-08-30T01:48:17.000Z","dependencies_parsed_at":"2022-08-23T14:11:00.895Z","dependency_job_id":null,"html_url":"https://github.com/tengattack/logrus-agent-hook","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/tengattack%2Flogrus-agent-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tengattack%2Flogrus-agent-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tengattack%2Flogrus-agent-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tengattack%2Flogrus-agent-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tengattack","download_url":"https://codeload.github.com/tengattack/logrus-agent-hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247215890,"owners_count":20903003,"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-12-17T20:15:17.100Z","updated_at":"2025-04-04T16:45:36.694Z","avatar_url":"https://github.com/tengattack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Log Agent hook for logrus\n\nWorks for [Logstash](https://www.elastic.co/products/logstash) or [Gogstash](https://github.com/tsaikd/gogstash).\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"github.com/tengattack/logrus-agent-hook\"\n    \"github.com/sirupsen/logrus\"\n    \"net\"\n)\n\nfunc main() {\n    log := logrus.New()\n    conn, err := net.Dial(\"tcp\", \"logstash.mycompany.net:8911\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    hook := logrusagent.New(conn, logrusagent.DefaultFormatter(logrus.Fields{\"app_id\": \"foo\"}))\n\n    log.Hooks.Add(hook)\n    log.Info(\"Hello World!\")\n}\n```\n\nThen, it becomes:\n\n``` json\n{\n  \"@timestamp\": \"2018-07-21T14:34:42.256+09:00\",\n    \"@version\": \"1\",\n      \"app_id\": \"foo\",\n       \"level\": \"INFO\",\n     \"message\": \"Hello World!\"\n}\n```\n\n# Inspired\n\n[logrus-logstash-hook](https://github.com/bshuster-repo/logrus-logstash-hook)\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftengattack%2Flogrus-agent-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftengattack%2Flogrus-agent-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftengattack%2Flogrus-agent-hook/lists"}