Skip to content

Commit 56e3a83

Browse files
authored
Create validate-logstash.sh
1 parent b20b568 commit 56e3a83

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```
2+
#!/bin/bash
3+
4+
NAME_LOGSTASH='logstash.conf'
5+
6+
PATH_LOGSTASH='/etc/logstash/conf.d'
7+
8+
echo "The check command verifies the syntax of Logstash configuration files:"
9+
mustache check "${PATH_LOGSTASH}/${NAME_LOGSTASH}"
10+
11+
echo "The lint command checks for problems in Logstash configuration files: "
12+
mustache lint --auto-fix-id "${PATH_LOGSTASH}/${NAME_LOGSTASH}"
13+
14+
echo "The format command, mustache returns the provided configuration files in a standardized format: "
15+
#mustache format --write-to-source "${PATH_LOGSTASH}/${NAME_LOGSTASH}"
16+
```
17+
18+
```
19+
/usr/share/logstash/bin/logstash --config.test_and_exit -f /etc/logstash/conf.d/logstash.conf
20+
```

0 commit comments

Comments
 (0)