{"id":22141198,"url":"https://github.com/daniel-cottone/serverless-es-logs","last_synced_at":"2025-08-19T10:13:24.846Z","repository":{"id":32810765,"uuid":"142683431","full_name":"daniel-cottone/serverless-es-logs","owner":"daniel-cottone","description":"A Serverless plugin to transport logs to ElasticSearch","archived":false,"fork":false,"pushed_at":"2024-12-08T18:21:16.000Z","size":1817,"stargazers_count":54,"open_issues_count":25,"forks_count":31,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T07:06:18.943Z","etag":null,"topics":["amazon-web-services","api","api-gateway","aws","aws-lambda","cloudwatch","cloudwatch-logs","elasticsearch","lambda","log","logger","logging","logs","serverless","serverless-framework","serverless-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/daniel-cottone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["daniel-cottone"]}},"created_at":"2018-07-28T14:24:25.000Z","updated_at":"2024-07-26T19:11:52.000Z","dependencies_parsed_at":"2023-11-08T04:22:25.885Z","dependency_job_id":"934ccf1c-cfbb-4512-8612-8707dd5ecba3","html_url":"https://github.com/daniel-cottone/serverless-es-logs","commit_stats":{"total_commits":578,"total_committers":15,"mean_commits":38.53333333333333,"dds":"0.22491349480968859","last_synced_commit":"04191ebff18be6076761aa715b7efe44e4138d5b"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-cottone%2Fserverless-es-logs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-cottone%2Fserverless-es-logs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-cottone%2Fserverless-es-logs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-cottone%2Fserverless-es-logs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-cottone","download_url":"https://codeload.github.com/daniel-cottone/serverless-es-logs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142074,"owners_count":20890653,"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":["amazon-web-services","api","api-gateway","aws","aws-lambda","cloudwatch","cloudwatch-logs","elasticsearch","lambda","log","logger","logging","logs","serverless","serverless-framework","serverless-plugin"],"created_at":"2024-12-01T21:11:15.638Z","updated_at":"2025-04-04T08:10:09.864Z","avatar_url":"https://github.com/daniel-cottone.png","language":"TypeScript","funding_links":["https://github.com/sponsors/daniel-cottone"],"categories":[],"sub_categories":[],"readme":"# serverless-es-logs\n\n[![serverless][sls-image]][sls-url]\n[![npm package][npm-image]][npm-url]\n[![Build status][gh-action-image]][gh-action-url]\n[![Coverage status][coveralls-image]][coveralls-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![Renovate][renovate-image]][renovate-url]\n\nA [Serverless][sls-url] plugin for transporting Cloudwatch log groups within your CloudFormation stack into Elasticsearch.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n\n## Installation\n\nInstall the plugin in your project:\n```bash\n$ yarn add serverless-es-logs --dev\n$ npm install serverless-es-logs --save-dev\n```\n\nAdd the plugin to your `serverless.yml`:\n```yaml\nplugins:\n  - serverless-es-logs\n```\n\n## Usage\n\nDefine your configuration using the `custom` configuration option in `serverless.yml`:\n\n```yaml\ncustom:\n  esLogs:\n    endpoint: some-elasticsearch-endpoint.us-east-1.es.amazonaws.com\n    index: some-index\n```\n\nYour logs will now be transported to the specified elasticsearch instance using the provided index.\n\n### Options\n\n#### apiGWFilterPattern\n\n(Optional) The filter pattern that the Cloudwatch subscription should use for your API Gateway access\nlogs. Default is `[event]`, but you can override this to provide a pattern that will match your custom\naccess logs format. See\n[Cloudwatch filter pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)\nfor more info.\n\n```yaml\ncustom:\n  esLogs:\n    apiGWFilterPattern: '[request_timestamp, apigw_request_id, http_method, resource_path, request_status, response_latency]'\n\nprovider:\n  logs:\n    restApi:\n      format: '$context.requestTimeEpoch $context.requestId $context.httpMethod $context.resourcePath $context.status $context.responseLatency'\n```\n\n#### endpoint\n\n(Required) The endpoint of the Elasticsearch instance the logs should be transported to.\n\n```yaml\ncustom:\n  esLogs:\n    endpoint: some-elasticsearch-endpoint.us-east-1.es.amazonaws.com\n```\n\n#### filterPattern\n\n(Optional) The filter pattern that the Cloudwatch subscription should use for your lambda\nfunctions. Default is `[timestamp=*Z, request_id=\"*-*\", event]`. See\n[Cloudwatch filter pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)\nfor more info.\n\n```yaml\ncustom:\n  esLogs:\n    filterPattern: '[timestamp=*Z, request_id=\"*-*\", event]'\n```\n\n#### includeApiGWLogs\n\n(Optional) An option to capture access logs created by API Gateway and transport them to Elasticsearch.\n\n```yaml\ncustom:\n  esLogs:\n    includeApiGWLogs: true\n\nprovider:\n  name: aws\n  logs:\n    restApi: true\n```\n\n#### index\n\n(Required) The Elasticsearch index that should be applied to the logs.\n\n```yaml\ncustom:\n  esLogs:\n    index: some-index\n```\n\n#### indexDateSeparator\n\n(Optional) The separator to use when creating the date suffix for the index. Default is `.`.\n\nThe format of the index will be: `\u003cindex\u003e-YYYY\u003cindexDateSeparator\u003eMM\u003cindexDateSeparator\u003eDD`\n\n```yaml\ncustom:\n  esLogs:\n    indexDateSeparator: '-'\n```\n\nThis will result in a date like `2020-04-20`.\n\n#### retentionInDays\n\n(Optional) The number of days that Cloudwatch logs should persist. Default is to never expire.\n\n```yaml\ncustom:\n  esLogs:\n    retentionInDays: 7\n```\n\n#### tags\n\n(Optional) Custom tags that should be applied to every log message processed by this plugin and sent to elasticsearch as fields.\n\n```yaml\ncustom:\n  esLogs:\n    tags:\n      some_tag: something\n      some_other_tag: something_else\n```\n\n#### useDefaultRole\n\n(Optional) Override role management for the log processer lambda and use the manually specified default role. Default is false.\n\n```yaml\ncustom:\n  esLogs:\n    useDefaultRole: true\n\nprovider:\n  name: aws\n  role: arn:aws:iam::123456789012:role/MyCustomRole\n```\n\n#### vpc\n\n(Optional) VPC configuration for the log processor lambda to have.\n\n```yaml\ncustom:\n  esLogs:\n    vpc: \n      securityGroupIds:\n        - sg-123456789\n      subnetIds:\n        - subnet-123456789\n        - subnet-223456789\n        - subnet-323456789\n```\n\n#### xrayTracingPermissions\n\n(Optional) Adds AWS Xray writing permissions to the processor lambda. You will need these if you enable tracing for ApiGateway on your service. \n\n```yaml\ncustom:\n  esLogs:\n    xrayTracingPermissions: true\n\nprovider:\n  tracing:\n    apiGateway: true\n```\n#### reservedConcurrency\n\n(Optional) Sets the reservedConcurrency of the lambda\n\n```yaml\ncustom:\n  esLogs:\n    reservedConcurrency: 3\n\nprovider:\n  tracing:\n    apiGateway: true\n```\n\n[sls-image]:http://public.serverless.com/badges/v3.svg\n[sls-url]:http://www.serverless.com\n[npm-image]:https://img.shields.io/npm/v/serverless-es-logs.svg\n[npm-url]:https://www.npmjs.com/package/serverless-es-logs\n[gh-action-image]:https://github.com/daniel-cottone/serverless-es-logs/workflows/Status%20check/badge.svg\n[gh-action-url]:https://github.com/daniel-cottone/serverless-es-logs/actions?query=workflow%3A%22Status+check%22\n[coveralls-image]:https://coveralls.io/repos/github/daniel-cottone/serverless-es-logs/badge.svg?branch=master\n[coveralls-url]:https://coveralls.io/github/daniel-cottone/serverless-es-logs?branch=master\n[snyk-image]:https://snyk.io/test/github/daniel-cottone/serverless-es-logs/badge.svg\n[snyk-url]:https://snyk.io/test/github/daniel-cottone/serverless-es-logs\n[renovate-image]:https://img.shields.io/badge/renovate-enabled-brightgreen.svg\n[renovate-url]:https://renovatebot.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-cottone%2Fserverless-es-logs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-cottone%2Fserverless-es-logs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-cottone%2Fserverless-es-logs/lists"}