{"id":37643426,"url":"https://github.com/sanori/spark-access-log","last_synced_at":"2026-01-16T11:22:20.104Z","repository":{"id":57737677,"uuid":"155044296","full_name":"sanori/spark-access-log","owner":"sanori","description":"Simple HTTPd log (a.k.a. access.log) parser for Spark SQL","archived":false,"fork":false,"pushed_at":"2018-11-26T13:58:15.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-05T13:06:49.118Z","etag":null,"topics":["hive-udf","http-logs","nginx-log","nginx-logs","spark","spark-sql","spark-udf","udf"],"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/sanori.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-10-28T07:03:36.000Z","updated_at":"2018-11-11T01:38:56.000Z","dependencies_parsed_at":"2022-08-24T13:00:12.683Z","dependency_job_id":null,"html_url":"https://github.com/sanori/spark-access-log","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/sanori/spark-access-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanori%2Fspark-access-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanori%2Fspark-access-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanori%2Fspark-access-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanori%2Fspark-access-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanori","download_url":"https://codeload.github.com/sanori/spark-access-log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanori%2Fspark-access-log/sbom","scorecard":{"id":799813,"data":{"date":"2025-08-11","repo":{"name":"github.com/sanori/spark-access-log","commit":"d7b6c8f2649da309f585d8d5157fca816482fe62"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/6 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":"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":"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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 13 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-23T10:07:20.532Z","repository_id":57737677,"created_at":"2025-08-23T10:07:20.533Z","updated_at":"2025-08-23T10:07:20.533Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["hive-udf","http-logs","nginx-log","nginx-logs","spark","spark-sql","spark-udf","udf"],"created_at":"2026-01-16T11:22:19.501Z","updated_at":"2026-01-16T11:22:20.098Z","avatar_url":"https://github.com/sanori.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# access.log parser for Spark SQL\nSimple HTTPd log (a.k.a. access.log) parser for Spark SQL.\n\nCurrently, [Combined](https://httpd.apache.org/docs/2.4/en/logs.html#combined)\nand\n[Common](https://en.wikipedia.org/wiki/Common_Log_Format)\nlog formats are supported.\n\n## How to use\n\n### SQL (spark-sql)\nWhen start spark-sql:\n```sh\nspark-sql --packages net.sanori.spark:access-log_2.11:0.1.0\n```\n\nIn SQL, you can create user defined function and use it:\n```sql\n-- attach ToCombined as to_combined(text_line)\nCREATE OR REPLACE FUNCTION to_combined\nAS \"net.sanori.spark.ToCombined\";\n\n-- read raw log file as one column table\nCREATE OR REPLACE TEMP VIEW accessLogText\nUSING text\nOPTIONS (path \"access.log\");\n\n-- create parsed log as a table\nCREATE OR REPLACE TEMP VIEW accessLog\nAS SELECT log.*\n    FROM (\n        SELECT to_combined(value) AS log\n        FROM accessLogText\n    )\n```\n\n### Spark SQL (spark-shell)\nWhen start spark-shell:\n```sh\nspark-shell --packages net.sanori.spark:access-log_2.11:0.1.0\n```\nOr in build.sbt:\n```sbtshell\nlibraryDependencies += \"net.sanori.spark\" %% \"access-log\" % \"0.1.0\"\n```\n\n#### DataFrame\n```scala\nimport net.sanori.spark.accessLog.to_combined\nimport org.apache.spark.sql.functions._\n\nval lineDf = spark.read.text(\"access.log\")\nval logDf = lineDf\n  .select(to_combined(col(\"value\")).as(\"log\"))\n  .select(col(\"log.*\"))\n```\n\n#### Dataset\n```scala\nimport net.sanori.spark.accessLog.toCombinedLog\n\nval lineDs = spark.read.textFile(\"access.log\")\nval logDs = lineDs.map(toCombinedLog)\n```\n\n#### RDD\n```scala\nimport net.sanori.spark.accessLog.toCombinedLog\n\nval lines = sc.textFile(\"access.log\")\nval rdd = lines.map(toCombinedLog)\n```\n\n## What is provided\nCombined or Common logs are transformed to the table\nwhich has the following meaning:\n\n| name          | type      | default value        |\n|---------------|-----------|----------------------|\n| remoteAddr    | String    | \"\"                   |\n| remoteUser    | String    | \"\"                   |\n| time          | Timestamp | 1970-01-01T00:00:00Z |\n| request       | String    | \"\"                   |\n| status        | String    | \"\"                   |\n| bytesSent     | Long      | null                 |\n| httpReferer   | String    | \"\"                   |\n| httpUserAgent | String    | \"\"                   |\n\n\n## Other information\n\n### How to build\n```\nsbt clean package\n```\ngenerates `access-log_2.11-0.1.0.jar` in `target/scala-2.11`.\n\n### Motivation\n * To simplify analysis of web server logs\n * Most of the logs of web server, that is HTTP server, are in Combined or Common log format.\n * To make user defined function that can be used on spark-sql command\n\n### Alternative\nIf you want to view access.log as a table on Hive, not on Spark,\nor want to process various log formats,\n[nielsbasjes/logparser](https://github.com/nielsbasjes/logparser/)\nmight be better solution.\n\n### Contribution\nSuggestions, idea, comments, pull requests are welcome.\n * https://github.com/sanori/spark-access-log/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanori%2Fspark-access-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanori%2Fspark-access-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanori%2Fspark-access-log/lists"}