diff --git a/.github/workflows/test_config_syntax.yml b/.github/workflows/test_config_syntax.yml new file mode 100644 index 0000000..baca5b9 --- /dev/null +++ b/.github/workflows/test_config_syntax.yml @@ -0,0 +1,12 @@ +on: [push] +jobs: + test-syntax: + runs-on: ubuntu-latest + container: + image: logstash:8.12.0 + volumes: + - $(pwd)/../../postfix.grok:/etc/logstash/patterns.d/postfix.grok + - $(pwd)/../../50-filter-postfix.conf:/usr/share/logstash/pipeline/50-filter-postfix.conf + steps: + - name: Validate configuration file syntax + run: logstash --config.test_and_exit -f /usr/share/logstash/pipeline/50-filter-postfix.conf diff --git a/.github/workflows/run_tests.yml b/.github/workflows/test_grok_patterns.yml similarity index 94% rename from .github/workflows/run_tests.yml rename to .github/workflows/test_grok_patterns.yml index 6617931..332dda1 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/test_grok_patterns.yml @@ -1,6 +1,6 @@ on: [push] jobs: - test: + test-patterns: runs-on: ubuntu-latest steps: diff --git a/test_config_syntax.sh b/test_config_syntax.sh new file mode 100755 index 0000000..a48c9c0 --- /dev/null +++ b/test_config_syntax.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -eux + +docker run --rm -it \ + --volume $(pwd)/postfix.grok:/etc/logstash/patterns.d/postfix.grok \ + --volume $(pwd)/50-filter-postfix.conf:/usr/share/logstash/pipeline/50-filter-postfix.conf \ + logstash:8.12.0 \ + logstash --config.test_and_exit -f /usr/share/logstash/pipeline/50-filter-postfix.conf diff --git a/runtests.sh b/test_grok_patterns.sh similarity index 100% rename from runtests.sh rename to test_grok_patterns.sh