Skip to content

Commit 10dfac9

Browse files
committed
Add validation for the logstash configuration
1 parent bc64147 commit 10dfac9

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Validate configuration syntax
2+
on: [push]
3+
jobs:
4+
test-syntax:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- run: |
9+
docker run --rm \
10+
--volume ./postfix.grok:/etc/logstash/patterns.d/postfix.grok \
11+
--volume ./50-filter-postfix.conf:/usr/share/logstash/pipeline/50-filter-postfix.conf \
12+
logstash:8.12.0 \
13+
logstash --config.test_and_exit -f /usr/share/logstash/pipeline/50-filter-postfix.conf
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
name: Test grok patterns
12
on: [push]
23
jobs:
3-
test:
4+
test-patterns:
45
runs-on: ubuntu-latest
56

67
steps:

test_config_syntax.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
docker run --rm -it \
6+
--volume $(pwd)/postfix.grok:/etc/logstash/patterns.d/postfix.grok \
7+
--volume $(pwd)/50-filter-postfix.conf:/usr/share/logstash/pipeline/50-filter-postfix.conf \
8+
logstash:8.12.0 \
9+
logstash --config.test_and_exit -f /usr/share/logstash/pipeline/50-filter-postfix.conf
File renamed without changes.

0 commit comments

Comments
 (0)