Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/masci/elastic-logs
Fetch logs from GitHub workflows and ingest them to Elasticsearch
https://github.com/masci/elastic-logs
action actions elastic elasticsearch github-actions logs observability
Last synced: about 2 months ago
JSON representation
Fetch logs from GitHub workflows and ingest them to Elasticsearch
- Host: GitHub
- URL: https://github.com/masci/elastic-logs
- Owner: masci
- License: mit
- Archived: true
- Created: 2021-09-28T13:52:38.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-30T07:31:33.000Z (over 2 years ago)
- Last Synced: 2024-09-26T09:23:36.992Z (about 2 months ago)
- Topics: action, actions, elastic, elasticsearch, github-actions, logs, observability
- Language: TypeScript
- Homepage:
- Size: 1.69 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Elastic Logs Action
[![build-test](https://github.com/masci/elastic-logs/actions/workflows/test.yml/badge.svg)](https://github.com/masci/elastic-logs/actions/workflows/test.yml)
This action collect logs from a workflow run and send them to Elasticsearch
![Kibana](img/kibana.png)
## Usage
```yaml
some-job:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: build
run: this-will-fail
- name: elastic-logs
if: failure()
uses: masci/elastic-logs@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
cloud-id: ${{ secrets.CLOUD_ID }}
username: ${{ secrets.ES_USER }}
password: ${{ secrets.ES_PASS }}
job-names: build
```## Development
Install the dependencies
```bash
$ npm install
```Lint, test and build the typescript and package it for distribution
```bash
$ npm run all
```Run the tests :heavy_check_mark:
```bash
$ npm test> [email protected] test
> jestPASS __tests__/github.test.ts
Test jobs list retrieval
✓ Retrieve the list of jobs (4 ms)
✓ Cannot retrieve the list of jobs (1 ms)
✓ Filter jobs by name
Test logs retrieval
✓ Retrieve the logs (6 ms)
✓ Cannot retrieve the logs (1 ms)PASS __tests__/logs.test.ts
Test logs module
✓ conversion (8 ms)PASS __tests__/run.test.ts
Test config params
✓ Process job-names param (5 ms)
✓ Missing Elastic config paramsTest Suites: 3 passed, 3 total
Tests: 8 passed, 8 total
Snapshots: 0 total
Time: 3.309 s, estimated 4 s
Ran all test suites.
```