{"id":24840383,"url":"https://github.com/porkcharsui/caddy_splunk_hec_log","last_synced_at":"2025-07-02T21:03:52.597Z","repository":{"id":243931213,"uuid":"813809081","full_name":"porkcharsui/caddy_splunk_hec_log","owner":"porkcharsui","description":"Caddy module to extend logging to support outputting events directly to a Splunk HEC endpoint via HTTP","archived":false,"fork":false,"pushed_at":"2024-06-11T19:58:49.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T06:55:49.534Z","etag":null,"topics":["caddy","caddy-plugin","logging","splunk"],"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/porkcharsui.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":"2024-06-11T19:32:53.000Z","updated_at":"2024-06-11T20:13:05.000Z","dependencies_parsed_at":"2024-06-19T02:56:06.284Z","dependency_job_id":null,"html_url":"https://github.com/porkcharsui/caddy_splunk_hec_log","commit_stats":null,"previous_names":["porkcharsui/caddy_hec_splunk_log"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porkcharsui%2Fcaddy_splunk_hec_log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porkcharsui%2Fcaddy_splunk_hec_log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porkcharsui%2Fcaddy_splunk_hec_log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/porkcharsui%2Fcaddy_splunk_hec_log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/porkcharsui","download_url":"https://codeload.github.com/porkcharsui/caddy_splunk_hec_log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245592651,"owners_count":20640878,"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":["caddy","caddy-plugin","logging","splunk"],"created_at":"2025-01-31T06:55:51.923Z","updated_at":"2025-03-26T05:20:59.641Z","avatar_url":"https://github.com/porkcharsui.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# caddy_splunk_hec_log\n\nThis Caddy module extends logging to support outputting events directly to the Splunk HEC endpoint via HTTP.\n\nInspired by [neodyme-labs/influx_log](https://github.com/neodyme-labs/influx_log) caddy module.\n\n## Install\n\nFirst, the [xcaddy](https://github.com/caddyserver/xcaddy) command:\n\n```shell\n$ go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest\n```\n\nThen build Caddy with this Go module plugged in. For example:\n\n```shell\n$ xcaddy build --with github.com/porkcharsui/caddy_splunk_hec_log=.\n```\n\n# Usage\n\nMake sure to set the log encoder format to `json`. All below fields are required: \n\n* `url` - configures the Splunk HEC endpoint\n* `token` - Splunk HEC `token` (e.g. example below uses `SPLUNK_HEC_TOKEN`, set via environmental variable)\n* `flush_interval` - (optional; defaults to 10s) duration between bulk log events flushing to Splunk HEC  \n\nDuring Caddy startup, this module verifies connectivity to the configured HEC health check endpoint and will terminate if the health check is unsuccessful.\n\nIf a flush to the HEC fails, this module re-buffers the events and re-attempts to flush them on the next interval. If Caddy is terminated with events still in the buffer, the buffer will be flushed one time before shutdown. If flushing fails during shutdown, log events are lost even since they will not reach the HEC.\n\nThis module can be configured via a `caddy.json` or a `Caddyfile`:\n\n## Caddyfile\n```\nexample.nuna.cloud {\n\troot * example\n\tfile_server\n\tlog {\n\t\tformat json\n\t\toutput splunk_hec_log {\n\t\t\turl https://http-inputs-FOOBAR.splunkcloud.com\n\t\t\ttoken {$SPLUNK_HEC_TOKEN}\n\t\t\tflush_interval 2s\n\t\t}\n\t}\n}\n```\n\n# TODO\n\n- [ ] handle edge cases where Splunk HEC endpoint is inaccessible and Caddy is being terminated (e.g. write hole) \n\n\n# Legal\n\nSplunk® and Splunk® Cloud Platform are registered trademarks of Splunk Inc. in the United States and other countries. The use of the \"Splunk\" trademark is for descriptive purposes only and does not imply any affiliation with or endorsement by Splunk Inc.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporkcharsui%2Fcaddy_splunk_hec_log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fporkcharsui%2Fcaddy_splunk_hec_log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporkcharsui%2Fcaddy_splunk_hec_log/lists"}