{"id":37023048,"url":"https://github.com/kdrakon/splunk-logback-hec-appender","last_synced_at":"2026-01-14T02:45:44.562Z","repository":{"id":57736049,"uuid":"68381735","full_name":"kdrakon/splunk-logback-hec-appender","owner":"kdrakon","description":"A Splunk HTTP Event Collector Appender for Logback","archived":false,"fork":false,"pushed_at":"2017-10-17T22:44:05.000Z","size":87,"stargazers_count":9,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T22:32:39.992Z","etag":null,"topics":["logback","logback-appender","logging","splunk"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdrakon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-09-16T13:25:23.000Z","updated_at":"2023-08-25T02:20:01.000Z","dependencies_parsed_at":"2022-08-24T03:30:22.033Z","dependency_job_id":null,"html_url":"https://github.com/kdrakon/splunk-logback-hec-appender","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kdrakon/splunk-logback-hec-appender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdrakon%2Fsplunk-logback-hec-appender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdrakon%2Fsplunk-logback-hec-appender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdrakon%2Fsplunk-logback-hec-appender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdrakon%2Fsplunk-logback-hec-appender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdrakon","download_url":"https://codeload.github.com/kdrakon/splunk-logback-hec-appender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdrakon%2Fsplunk-logback-hec-appender/sbom","scorecard":{"id":553199,"data":{"date":"2025-08-11","repo":{"name":"github.com/kdrakon/splunk-logback-hec-appender","commit":"ffe66bd884d32f691c2ee16bddf46ebb876491ae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T11:31:34.678Z","repository_id":57736049,"created_at":"2025-08-20T11:31:34.678Z","updated_at":"2025-08-20T11:31:34.678Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["logback","logback-appender","logging","splunk"],"created_at":"2026-01-14T02:45:42.926Z","updated_at":"2026-01-14T02:45:44.553Z","avatar_url":"https://github.com/kdrakon.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Splunk Logback HTTP Event Collector Appender\n\n[![Build Status](https://travis-ci.org/kdrakon/splunk-logback-hec-appender.svg?branch=master)](https://travis-ci.org/kdrakon/splunk-logback-hec-appender)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.policarp/splunk-logback-hec-appender_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.policarp/splunk-logback-hec-appender_2.12)\n\nThis is a [Logback Appender](http://logback.qos.ch/manual/appenders.html) made for Splunk's HTTP Event Collector (HEC) API. Splunk provides their [own appenders](https://github.com/splunk/splunk-library-javalogging), but at the time of this libraries creation, the Logback one was quite limited in terms of configuration and the data you could append to log indexes. This appender provides much more logging data than the current standard Splunk appender — which supplies only log fields for *message* and *severity*. With the addition of JSON fields containing more logging metadata, complex Splunk search queries can be written. This can potentially lead to better insight into your application.\n\nSome of the inspiration for this appender is based on the capabilities of the [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder), which originally provided the ability to specify custom JSON fields in Logstash entries.\n\nIt is implemented using the principles of reactive streams. This was very straightforwardly done using the [Monix library](https://monix.io/).\n\n## Compatability\n- due to the use of the Skinny Framework's HTTP client, the minimum **Java** version is **8**. However, I haven't tested the appender in a Java project yet. Technically, it should be compatible, but please let me know if it definitely works.\n- I have tested the appender against the Enterprise Splunk Cloud HTTP Event Collector (*version 6.6.1*).\n\n## Configuration\n### Sample XML Configuration\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cconfiguration\u003e\n\n  \u003cappender name=\"splunk\" class=\"io.policarp.logback.SplunkHecAppender\"\u003e\n\n    \u003csplunkUrl\u003ehttps://somewhere.splunkcloud.com/services/collector/event\u003c/splunkUrl\u003e\n    \u003ctoken\u003e1234-5678-91011-ABC-321\u003c/token\u003e\n    \u003cbuffer\u003e25\u003c/buffer\u003e\n    \u003cflush\u003e10\u003c/flush\u003e\n    \u003cparallelism\u003e8\u003c/parallelism\u003e\n\n    \u003clayout class=\"io.policarp.logback.SplunkHecJsonLayout\"\u003e\n      \u003csource\u003emy-application\u003c/source\u003e\n      \u003ccustom\u003eappversion=${APP_VERSION}\u003c/custom\u003e\n      \u003ccustom\u003euser=${USER}\u003c/custom\u003e\n    \u003c/layout\u003e\n\n    \u003cfilter class=\"ch.qos.logback.classic.filter.ThresholdFilter\"\u003e\n      \u003clevel\u003eINFO\u003c/level\u003e\n    \u003c/filter\u003e\n\n  \u003c/appender\u003e\n\n  \u003croot level=\"DEBUG\"\u003e\n    \u003cappender-ref ref=\"splunk\"/\u003e\n  \u003c/root\u003e\n\n\u003c/configuration\u003e\n```\n\n### SplunkHecAppender\n#### Logback Configuration\n- `\u003csplunkUrl\u003e`\n  - The URL of the HEC endpoint \n  - e.g. https://somewhere.splunkcloud.com/services/collector/event\n- `\u003ctoken\u003e`\n  - The token that authorizes posting to the HEC endpoint\n  - e.g. _1234-5678-91011-ABC-321_\n- `\u003cbuffer\u003e`\n  - Log messages are buffered in memory off of the queue. Once a buffer is filled, logs are instantly posted to the HEC endpoint. This size also signifies the maximum payload size sent to the endpoint.\n  - 25 *(default)*\n- `\u003cflush\u003e`\n  - Specifies a timeout in **seconds** in which the buffer should be flushed regardless of the current number of logs in it. This ensures log messages don't stagnate.\n  - 30 *(default)*\n- `\u003cparallelism\u003e`\n  - Log messages are posted to the HEC endpoint in parallel. This number specifies how many parallel posts should happen asynchronously.\n  - defaults to number of CPU cores\n  \nThe appender also supports the addition of [Logback Filter's](http://logback.qos.ch/manual/filters.html) — see the XML example above.\n\n### SplunkHecJsonLayout\nBy default, the `SplunkHecAppender` will use a default configured `SplunkHecJsonLayout`. The JSON data is rendered using [json4s](https://github.com/json4s/json4s) from the following case classes:\n\n```scala\npackage object json {\n\n  trait EventJson\n\n  case class BaseJson(\n    time: Long,\n    event: EventJson,\n    host: Option[String] = None,\n    source: Option[String] = None,\n    sourcetype: Option[String] = None,\n    index: Option[String] = None\n  )\n\n  case class FullEventJson(\n    message: String,\n    level: String,\n    thread: String,\n    logger: String,\n    callingClass: Option[String] = None,\n    callingMethod: Option[String] = None,\n    callingLine: Option[String] = None,\n    callingFile: Option[String] = None,\n    exception: Option[String] = None,\n    stacktrace: Option[List[String]] = None,\n    customFields: Option[mutable.HashMap[String, String]] = None\n  ) extends EventJson\n}\n```\n\n#### Logback Configuration\n- `\u003ccustom\u003e`\n  - A custom field that is appended to log messages (under the JSON field `customFields`). This must be encoded as individual `\u003ccustom\u003e` tags with key-value pairs separated by an equal (`=`) sign. For example:\n    - applicationVersion=${GIT_APP_VERSION}\n    - applicationName=SuperCoolApp\n- `\u003cmaxStackTrace\u003e`\n  - A max-depth to trim stack traces. If the trace is trimmed, an ellipsis is appended to the end.\n  - 500 *(default)*\n- Standard [Splunk metadata fields](http://dev.splunk.com/view/event-collector/SP-CAAAE6P#meta) are configurable, including:\n  - `\u003csource\u003e`\n  - `\u003csourcetype\u003e`\n  - `\u003cindex\u003e`\n  - `\u003chost\u003e`\n  \n  #### Custom Layout\n  You can override the layout with a class extending either `SplunkHecJsonLayout`,`SplunkHecJsonLayoutBase`, or `LayoutBase[ILoggingEvent]`. Then `\u003clayout\u003e` can be specified in the `\u003cappender\u003e` section — see the XML example above\n\n## HTTP Client\nThe base implementation uses the [skinny-framework's HTTP client](https://github.com/skinny-framework/skinny-framework). It is a tiny library and does not bring with it many dependencies. `SplunkHecAppender` uses `SkinnyHttpHecClient` for HTTP communication.\n\nYou can however bring in your own implementation by mixing in your own class that extends `SplunkHecClient` with `SplunkHecAppenderBase`.\n\n**Note**: the `SplunkHecAppender` has a Logback filter automatically added that filters out logging from the Skinny HTTP client to avoid an infinite feedback loop. To filter out logging in its entirety, append something like this to your config:\n\n```xml \n\u003clogger name=\"skinny.http\" level=\"OFF\"/\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdrakon%2Fsplunk-logback-hec-appender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdrakon%2Fsplunk-logback-hec-appender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdrakon%2Fsplunk-logback-hec-appender/lists"}