-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·49 lines (42 loc) · 848 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·49 lines (42 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Prototype logstash config generator
shopt -s nullglob
# Nuke old
rm build/*.conf
# Create new config
for dir in config/*/; do
if [[ $dir =~ config/([^/]*)/ ]]; then
build_unit=${BASH_REMATCH[1]}
else
continue
fi
echo "Creating $build_unit"
(
# Input
for file in config/$build_unit/input-*.conf; do
echo "input {"
echo "# src-begin=$file"
cat $file
echo "# src-end=$file"
echo "} # end input"
done
echo ""
# Filter
for file in config/$build_unit/filter-*.conf; do
echo "filter {"
echo "# src-begin=$file"
cat $file
echo "# src-end=$file"
echo "} # end filter"
done
echo ""
# Output
for file in config/$build_unit/output-*.conf; do
echo "output {"
echo "# src-begin=$file"
cat $file
echo "# src-end=$file"
echo "} # end output"
done
) > build/logstash-${build_unit}.conf
done