Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agolo/logstash-test-runner
Logstash configuration testing framework
https://github.com/agolo/logstash-test-runner
devops logstash testing
Last synced: about 2 months ago
JSON representation
Logstash configuration testing framework
- Host: GitHub
- URL: https://github.com/agolo/logstash-test-runner
- Owner: agolo
- License: mit
- Created: 2017-08-30T15:20:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-21T03:33:28.000Z (almost 6 years ago)
- Last Synced: 2024-08-21T21:27:36.395Z (6 months ago)
- Topics: devops, logstash, testing
- Language: Shell
- Homepage: https://blog.agolo.com/the-easy-way-to-test-your-logstash-configuration-3f80eb5ffd59
- Size: 62.5 KB
- Stars: 103
- Watchers: 9
- Forks: 25
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logstash-test-runner
![image](http://i.imgur.com/hQm9yAb.gif)
Example tests are in the `__tests__` directory.
To add a tests, simply add a new directory with the given input `input.log`, the ETL configuration `logstash.conf`, and the expected output `output.log`.## Prerequisites
* NodeJS > v8
* Docker
* Bash > v4## Setup
* Clone repository
* Run `npm install`
* Setup your test directory as follows```sh
__tests__
crawlers
input.log
logstash.conf
output.log
mongo
input.log
logstash.conf
output.log
# ...
```* Make sure docker is running
* Run your tests```sh
# ./test.sh []# Run tests using the official Logstash 5.5.1 docker image
./test.sh __tests__# Run tests using a locally built logstash docker image
./test.sh __tests__ my_logstash_image:mytag
```NOTE: Multiline logs in logstash need translate in reverse to filebeat in terms of `multiline.match` from `previous` => `after` and `next` => `before`.
## Ignoring Timestamps
By default, we ignore `timestamp` and `@timestamp` fields. You can customize this in the [./test.sh](./test.sh) where we use the ignore flag like so `./log-diff.js -i`.