Skip to content

Commit

Permalink
Finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaircloth-splunk committed Jun 15, 2020
1 parent b2d9f64 commit 5ff6471
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions package/sbin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ for file in /opt/syslog-ng/etc/conf.d/local/context/*.example ; do cp --verbose

#splunk_index.csv updates
#Remove comment headers from existing config
touch /opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv
sed -i 's/^#//' /opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv
touch /opt/syslog-ng/etc/conf.d/local/context/splunk_metadata.csv
if [ -f /opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv ]; then
LEGACY_SPLUNK_INDEX_FILE=/opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv
fi
sed -i 's/^#//'
# Add new entries
awk '{print $0}' /opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv /opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv.example | sort -b -t ',' -k1,2 -u
awk '{print $0}' ${LEGACY_SPLUNK_INDEX_FILE} /opt/syslog-ng/etc/conf.d/local/context/splunk_metadata.csv /opt/syslog-ng/etc/conf.d/local/context/splunk_metadata.csv.example | sort -b -t ',' -k1,2 -u
#We don't need this file anylonger
rm -f /opt/syslog-ng/etc/context_templates/splunk_index.csv.example

rm -f /opt/syslog-ng/etc/context_templates/splunk_index.csv.example || true
rm -f /opt/syslog-ng/etc/context_templates/splunk_metadata.csv.example || true
if [ -f /opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv ]; then
mv /opt/syslog-ng/etc/conf.d/local/context/splunk_index.csv /opt/syslog-ng/etc/conf.d/local/context/splunk_index.deprecated
fi
cp --verbose -R /opt/syslog-ng/etc/local_config/* /opt/syslog-ng/etc/conf.d/local/config/
mkdir -p /opt/syslog-ng/var/log

Expand Down

0 comments on commit 5ff6471

Please sign in to comment.